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!

22 hours ago
big_guyforyou OP
:py:

so there is more than one satan

22 hours ago
thonor111

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

22 hours ago
WhenInDoubt_Kamoulox

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

22 hours ago
FireMaster1294
:py:

Javascript.jar.js.exe

22 hours ago
spryllama
:p:

The Satan is coming from inside the house!

20 hours ago
TypicalArachnid08

cursed code detected. Exorcism scheduled

22 hours ago
shnelya

they walk among us

22 hours ago
LucaTheNativeSpeaker

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

22 hours 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

19 hours ago
CoffeeKisser

The real Satan is always in the comments

19 hours ago
Skylect

Thanks for telling it how it works! lol

12 hours ago
Mr-Memelord420

Teach me how to write scripts in Java

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

Im pretty sure you can go to jail for this

22 hours 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");
}}`)
'''
22 hours ago
Hohenheim_of_Shadow

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

22 hours ago
AceMKV
:py:

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

20 hours ago
Carnonated_wood
:cp::kt::js::py:

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

18 hours ago
AceMKV
:py:

Yes it is

16 hours ago
Nervous_Teach_5596

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

21 hours 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

14 hours ago
MagicalPizza21

Jascriptsva

21 hours ago
lachsimzweifel

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

21 hours 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?

3 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?

3 hours ago
MagicalPizza21

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

21 hours ago
ZunoJ
:cs: :asm: :c:

It's the file name

6 hours ago
MagicalPizza21

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

6 hours ago
ZunoJ
:cs: :asm: :c:

Not if there are no public classes in the file

6 hours ago
MagicalPizza21

Huh. TIL

6 hours ago
Afsheen_dev

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

21 hours ago
Nervous_Teach_5596

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

21 hours ago
timothee_64
:cp:

Now reimplement it in JavaScript.

21 hours ago
tfngst
:cs:

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

19 hours 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.

16 hours ago
8threads

This can happen if you’re using GWT.

15 hours ago
lonelyroom-eklaghor
:c::j::py::re:

I need some Jshell up my arse

15 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.

5 hours ago
SenorSeniorDevSr

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

3 hours ago
cheezballs

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

18 hours ago
cibule249

u/savevideo

17 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.

3 hours ago