Erik Engheim
Aug 5, 2021

--

I thought you had a point initially until I tested it. Turns out this isn't really true. Here is a minimized JavaScript expression over one line:

if(x>10){y=100;}else if(x>5){y=50;}else{y=10;}

This is 46 character long. In Julia I can write the same expression like this:

if x>10 y=100 elseif x>5 y=50 else y=10 end

That is 43 characters long. Hence actually shorter.

Julia is here simply using space instead of characters like (), { and ;

Sure you can cut out the semicolons but then you only get down to 43 characters so you still don't beat the Julia solution.

--

--

Erik Engheim
Erik Engheim

Written by Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Responses (1)