DEV Community

Discussion on: Which mainstream programming language has the ugliest syntax?

Collapse
 
nektro profile image
Meghan (she/her)

To each his own haha, I love Java for how verbose it is and really dislike Kotlin. Operator overrides are a really neat idea but I can't get over the fun/func craze of using it instead of just saying function. Swift, Go, Rust, they all do it.

Collapse
 
chrisvasqm profile image
Christian Vasquez • Edited

I agree with you on the fun part. I've been getting more into JavaScript recently and I can see the use of the full word (function) being better for beginners overall.

Thread Thread
 
hrmny profile image
Leah

"fun is short for function"

"Oh ok"

Thread Thread
 
chrisvasqm profile image
Christian Vasquez • Edited

Yeah, but I still haven't seen the first person who doesn't question what fun is the first time they see it.

Sometimes being clear and short don't go hand to hand.

Thread Thread
 
nektro profile image
Meghan (she/her)

there's a readability factor that I feel is added when you use the whole function. Especially for compiled languages, the "less characters" argument has no weight at all.

Thread Thread
 
series0ne profile image
series0ne

It’s actually a “fewer characters” argument.

Thread Thread
 
aramix profile image
Aram Bayadyan • Edited

Actually in javascript es6 you don't have to type any word to create a function just () => {} which is the best notation IMHO

Collapse
 
hrmny profile image
Leah

What's the benefit of typing out function?

There is none, it just adds more characters

Thread Thread
 
chrisvasqm profile image
Christian Vasquez • Edited

Then we should use f because "un" would just add a few more characters 🤔.

I think there's a fine line between short and too short.

Thread Thread
 
alainvanhout profile image
Alain Van Hout

There's a reason why we don't all prefer our Shakespeare or our technical documentation in SMS/text speak :).

Thread Thread
 
juhohame profile image
Juho Häme

Writing code Shakespeare style would be awful.

Thread Thread
 
awwsmm profile image
Andrew (he/him)

f already stands for function in mathematics:

y = f(x)
Thread Thread
 
hrmny profile image
Leah

it's just what you start with, the next one would be g(x)

Collapse
 
xtabdeveloping profile image
Márton Kardos

Rust goes like: Fn... And I don't think there's anything wrong with writing instead of function, with good syntax highlighting there's barely a difference. I don't think code becomes any more readable by writing longer words. And Java's verbosity doesn't increase the readability at all. "final public static void" Btw you don't even have a function keyword in Java and nobody tends to make a problem of it.

Thread Thread
 
mojo2012 profile image
Matti

the modifiers are necessary to differentiate non-final private/protected non-static methods with a return type ... it makes total sense 😅