ProgrammerHumor

helloWorldImSatan

helloWorldImSatan
https://i.redd.it/cj6djl7tg8cf1.gif
Reddit

Discussion

Agiwlesz

I have searched the codebase of my company (pretty large codebase). 2 files named JavaScript.java found!

1 day ago
big_guyforyou OP
:py:

so there is more than one satan

1 day ago
thonor111

Or satan only has one joke and has to repeat it multiple times

1 day ago
WhenInDoubt_Kamoulox

Satan: My Java program identifies as Javascript 🤣🤣 checkmate atheists 🤣🤣

1 day ago
FireMaster1294
:py:

Javascript.jar.js.exe

1 day ago
spryllama
:p:

The Satan is coming from inside the house!

1 day ago
TypicalArachnid08

cursed code detected. Exorcism scheduled

1 day ago
shnelya

they walk among us

1 day ago
LucaTheNativeSpeaker

Please don't confuse my AI assistant, otherwise I won't be able to fix it myself

1 day ago
YouDoHaveValue

Protect your code against upstart juniors with these simple tricks!

  • zero width characters

  • Obscure unicode (а vs a) characters in names.

  • Functions and statements that never run but will be included in analysis if (varThatisAlwaysFalse) {...}

  • preprocessing build flags that only evaluate in runtime

1 day ago
CoffeeKisser

The real Satan is always in the comments

1 day ago
Skylect

Thanks for telling it how it works! lol

21 hours ago
Mr-Memelord420

Teach me how to write scripts in Java

1 day ago
big_guyforyou OP
:py:
console.log(`public class Test {
public static void main(String[] args) {
    System.out.println("Hello World");
    }
}`)
1 day ago
Mr-Memelord420

Im pretty sure you can go to jail for this

1 day ago
big_guyforyou OP
:py:
python_java_script = lambda: '''
console.log(`public class Test {
public static void main(String[] args) {
System.out.println("Hello World");
}}`)
'''
1 day ago
Hohenheim_of_Shadow

Jython script is a real thing and widely used in the automotive industry apparently

1 day ago
AceMKV
:py:

I mean Jython which is Python compiled to Java Bytecode has been around for as long as CPython I believe.

1 day ago
Carnonated_wood
:cp::kt::js::py:

Isn't CPython the default implementation? Correct me if I'm wrong

1 day ago
AceMKV
:py:

Yes it is

1 day ago
Nervous_Teach_5596

Yet no WebClient, neither WebResponse, HTMLPage and no page.executeJavaScript

1 day ago
JackNotOLantern

No, that is java in a script. Your should write something like

System.out.println("consol.log(\"this is a script\")");

And then redirect the standard output to a js executor

22 hours ago
MagicalPizza21

Jascriptsva

1 day ago
lachsimzweifel

Not entirely sure this would work, but Jshell exists and it might be able to execute script like files.

1 day ago
SenorSeniorDevSr

It would, but you also have JEP 330: Launch Single-File Source-Code Programs

It's been around since Java 11, and is old as dirt. How have people not heard about this?

11 hours ago
SenorSeniorDevSr

JEP 330: Launch Single-File Source-Code Programs

This would be a simple way. You could also use JShell + shebangs like a NormalPersonFactory.newInstance(), but where's the fun in that?

11 hours ago
MagicalPizza21

How dare you start your class name with a LOWERCASE LETTER?

1 day ago
ZunoJ
:cs: :asm: :c:

It's the file name

14 hours ago
MagicalPizza21

In Java, the file name has to match the class name, last I checked.

14 hours ago
ZunoJ
:cs: :asm: :c:

Not if there are no public classes in the file

14 hours ago
MagicalPizza21

Huh. TIL

14 hours ago
Afsheen_dev

Lol this is so relatable! I've done that before and ended up with bunch of errors.

1 day ago
Nervous_Teach_5596

implementation ('org.htmlunit:htmlunit:4.13.0')

1 day ago
timothee_64
:cp:

Now reimplement it in JavaScript.

1 day ago
tfngst
:cs:

And wrote the code with actual Java script as in Javanese Java, Indonesia.

1 day ago
314159265358979326

I like using the name "monte_python.py" for personal scripts using monte carlo methods written in python. It's decidedly unproductive but amuses me.

1 day ago
8threads

This can happen if you’re using GWT.

1 day ago
lonelyroom-eklaghor
:c::j::py::re:

I need some Jshell up my arse

23 hours ago
chat-lu
:rust: :elixir-vertical_4: :re: :clj: :py: :kt: :j: :bash: :js:

How is that weird? There is a full blown implementation of javascript in java.

13 hours ago
SenorSeniorDevSr

Rhino is old and not really recommended. GraalVM is the current hotness.

11 hours ago
SenorSeniorDevSr

You can also just call it script.java then run it using java script.java

This is all thanks to JEP 330, which lets you make Java eh... scripts.

11 hours ago
cheezballs

Eh, I dunno that a Java file can be called a script. Maybe some, sure.

1 day ago
cibule249

u/savevideo

1 day ago
_terrapin

script.java

2 hours ago
ugotmedripping

I feel you could shorten it to js.java for efficiency

2 hours ago
navetzz

The real joke here is scripting in java

1 hour ago