Regardless of the language's usefulness, which language fails the beauty contest the worst?
For further actions, you may consider blocking this person and/or reporting abuse
Regardless of the language's usefulness, which language fails the beauty contest the worst?
For further actions, you may consider blocking this person and/or reporting abuse
Syakir -
Thomas Hansen -
Jimmy McBride -
RemoteWLB -
Top comments (232)
Does BASH count? :|
:|
Sorry but it's ugly only because it's wrong (there should have been additional spaces before and after square brackets) ;)
The BASH is powerful and its syntax allows to write easy to read code. It just needs some rules to follow. For instance, there can be found a quite good Shell Style Guide from Google
In this particular example, it could be written even simpler
that is even harder to read
That's the funny thing about these questions (and variations of them can be found in developer forums going back to the early 80's and usenet groups) they are highly subjective.
This should not be surprising as language to large degree encapsulates methods of thinking and psychologists and linguists will tell you quickly that there are vastly many different ways of thinking.
The fluidity of spoken languages ability to relay information comes not from their terseness it comes from their interpretability.
Programming languages are syntactically terse means of conveying information about how to shift bits in low level computer memory cores which in their abstractions from that low level task must necessarily replicate the possible interpretability of the syntax and that will vary with the mode of thinking of the reader. It's a paradox of information transfer between beings with vastly different ways of thinking about the particular ingredients of language revealing itself.
To me, a person who prefers syntax that is explicit over implicit the first version looks more interpretable than the second (my main criteria for this are two fold, a) my personal preference and b) how I think most other engineers would think about it and in particular to ensure that as many as possible would have as little effort as possible in capturing the meaning of the code )
Everything beyond that is subjective bickering....
That is going to be very helpful! Thank you.
IMHO the worst bash quirk is not being able to put whitespace around the assignment operator, ie.:
foo = bar # syntax error
foo=bar # works as expected
*cough*
set -o
to turn an option on andset +o
to turn it off *cough*Bash counts!
It's beautiful, IMO. <3
That would be Bourne Shell's fault, not BASH.
Java's verbosity gets old pretty fast. Especially after seeing what's possible with other JVM languages.
Kotlin is a joy to use, in part because of how expressive yet succinct it is. Going back and forth between the two makes Java's flaws much more visible, unfortunately.
Java Syntax has the weird ability to direct the attention to the less important parts of the code first.
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 sayingfunction
. Swift, Go, Rust, they all do it.What's the benefit of typing out function?
There is none, it just adds more characters
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.
There's a reason why we don't all prefer our Shakespeare or our technical documentation in SMS/text speak :).
Writing code Shakespeare style would be awful.
f
already stands forfunction
in mathematics:it's just what you start with, the next one would be
g(x)
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.
the modifiers are necessary to differentiate non-final private/protected non-static methods with a return type ... it makes total sense π
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."fun is short for function"
"Oh ok"
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.
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.Itβs actually a βfewer charactersβ argument.
Actually in javascript es6 you don't have to type any word to create a function just () => {} which is the best notation IMHO
Objective C
Or should I say
[[[[[[[[[objective c]]]]]]]]]]
PHP
Oldschool-wise, I can never forgive Pascal it's
:=
operator.Can you tell me more about the
:=
operator?In Pascal, a:=33 would assign the value 33 to variable a. The is-equal operator was just =. It was less error prone than what finally stuck, thanks to C and Java ---> = to assign values, == to compare them.
I strongly disagree, with the Pascal remark, but I'm a Pascal lover, so I'm probably biased the other way. I'd say
:=
vs.=
is much better and a lot less error prone and ugly than=
vs.==
let alone===
in some languages.Also
:=
was not even a Pascal invention, but much older. It comes from ALGOL actually, IIRC.=== and !== look rad in Fira Code
And there was me thinking it was from ADA ... it's like archaeology, this, just stripping layers away.
Historical linguistics is a real discipline in natural languages. I love the analogies between natural languages and computer languages.
Yes, and there's definitely a "thing" with code quality being correlated to natural readability too.
I come from an ORACLE background originally, and it would drive me insane to see people uppercasing their SQL, like it was an act of kindness to the compiler, and us humans have to suck up the inconvenience. I used to send people photos of major highway direction signs and ask "WHY DO YOU THINK WE DO NOT PUT INFORMATION THAT HAS TO BE QUICKLY ABSORBED IN UPPER CASE? Which do you find easier to read?".
I was also once instructed that all text in a BI system's reports should be in fixed pitch uppercase β got out of it by showing how wide that made every text-heavy report.
TL;DR; People are sometimes quite dumb.
All very fair points. I never minded Pascal as a language. Just that assignment operator.
I had forgotten it came from ALGOL.
But you agree PHP is hideous?
:D
I believe there's worse than PHP, but that alone doesn't make any PHP better for sure. :)
BTW, I always think about replacing
:
withbe
and=
withequal
in my mind when reading Pascal code. Soa:=1;
islet a be equal 1
. Same works with colon elsewhere, for example type definitions likevar x: integer;
can be read aslet var x be integer;
... It makes the whole syntax quite readable for me.But I'm not a native English speaker, so sorry if this just makes it even worse. :P
No, it's a nice thought. It does work, as far as I can remember. Maybe it's what Pascal's creators were thinking.
PHP: itβs not a bad syntax, itβs just not what some people like, and theyβve formed opinionated debates over it.
Especially if you look at more modern PHP. I really like Laravel's code style.
For non-PHP developers, a few syntax niceties:
$
prefix. So$post = getPost($id)
.$request->has('name')
::
(by far my favorite).Route::get('/api/posts', function() {});
I also like PHP namespacing:
and accessing the namespace:
As someone who's used PHP in the past, all of your niceties are among the many reasons I don't care for the language π to each their own though! π€·π»ββοΈ
Haha, I can understand that. I actually liked the namespacing so much, I wrote a babel plugin that rewrites import paths in JS to work similarly. Not EXACTLY the same, but it's very similar.
I really dislike PHP namespacing.
I agree. There's nothing bad about the syntax. True, the language could be better. There are 99 reasons to dislike PHP but syntax is definitely not one of them.
PHP has been my main language for 10 years.
-> instead of . is rather unfortunate. Much harder to type :/
$var instead of var is also not idea if you ask me, though at least not as silly as needing to hit 3 keys.
That does not make the syntax as a whole ugly though.
Lol. It helps. :D
True enough. The syntax isn't bad as in defective or overly verbose. It does look inelegant to me, though.
You might have to blame ADA for that.
PL/SQL also uses it β it is very closely related to ADA.
I personally find JavaScript to be absolutely hideous.
Javascript is very close to start looking like a bunch of emojis:
()=> :}
()=> :}
isn't a valid span of JS in any non-string context, but there is bound to be a Haskell library that introduces a()=>:}
binary operator/infix function.(This is a joke, all of
():}
are reserved characters)HA! You are 100% right!
It's right behind Java, IMHO. It's much easier to read obfusticated C than JS.
Right, I mean... so many parentheses. I know that's not an aesthetic issue but trying to figure out where everything begins and ends makes my brain cry.
Sounds like you need Bracket Pair Colorizerβ’
This is by far the most useful comment I've read here, thanks Mihail
Why would anybody care to read obfuscated code in the first place without the help of formatter? Unless you are developer of bundler...
Definitely, but there are some small signs to become more handleable.
Same here.
Objetive-C have a special place in the darkness places of my heart.
"Wait, how many [ do I have? [[[[[ fuck this shit!"
And yet there are people who insist Objective-C is somehow a great language, ahead of its time. Like Javascript and C++. LOL
[[[alloc Shit] init] intercourseWith:Penguin]]]
Reminds me of ClojureScript.
I vote for Objective C as well
Explicit is better than implicit, right? Doesn't get more explicit than that :D
this is terrifying yet taught as the "standard" for the first two years of every university that starts with java (the beginner language not the uni name LOL) ;_;
Unpopular opinion but Python.
Personally find it difficult to read. It's like supposed to be really easy to learn and write but in the process lost any structure in longer file. Other languages based on whitespace like Ruby or Lua have clear endings to blocks. Python just drops out the block without a clear indication.
We're not alone!
I think Python is deceptively ugly, because at first you expect it to be sensible but when you actually try to understand it you find the ugliness in it's whitespace.
At least stuff like Lisp and Objective-C have the courage to show their ugliness loud and proud. (and oh goodness! those are ugly!)
I grew up on 6500-family and Z-80 assembler, and I find those very easy to read, despite some of the cramping from the mnemonics and addressing modes.
I wrote a lot RPG for IBM systems during the 80's and 90's. RPG is still (IMHO) the best business language in terms of clean syntax. It's essentially a hopped-up macro assembler language.
Java's syntax has always made my head hurt. It has wayy too many rules and doesn't trust that devs have the capacity for making the right decision.
Python's syntax doesn't cure all of Java's sins, but it has the decided benefit of its syntax not getting in the way of problem solving.
If you follow the guidelines in PEP-008, make good decisions, discuss those decisions openly, respect the analytical capacity of the Programmer of the Future, you can write not just good syntactically clean and readable Python, but code that's maintainable.
These are all big if's I grant you, but I'd rather solve problems and get work done than try to make Java happy.
I see the opposite problem. The lack of syntax is a bigger annoyance than how verbose Java is. This is why there are so many different languages; everyone has different opinions on how to solve problems. :)
As someone who has never worked with Python professionally it felt like I was fighting the formatter any time I wanted to quickly jot down temporary code while working through a problem.
The WHITESPACE is exactly the problem.
Lisp, "ugly"? best oxymoron ever.
Oxymoron? Best misnorm ever. Oxymoron is when the antonym meets its base word.
Absolutely. My pet peeves with it are:
Python lacks punctuation, in the logical sense of the word. If punctuation was an unnecessary lexical tool, people wouldn't use it in English. It helps convey meaning.
Abbreviations. What the hell does "t", "p", "x", "y", "pd", "plt" and "sns" stand for? The community has a horrible notion for naming conventions. The most popular Stack Overflow posts have this style of naming and it's making the language hard to learn.
Underscores. Who decided that this "init" with two sets of double undescores should be one of the things developers write most often? It's not readable.
All of these things make Python hard to understand.
I'm personally a big fan of Python, but I still totally agree with #3. Even though I write python pretty regularly, 95% of the time I just copy and paste the whole:
(copy & pasted)
Oh yeah, despite complaining so much I still like it overall as a language.
I hate python too. Lack of {} make it difficult to read, debug, write and whitespaces are a nightmare. It is also a nightmare to copy and paste snippets.
The greatness of Python is proportional to its ugliness
Basically every language that's actually paid my bills (which means I can't hate them too much:
Java:
so much boilerplate private static final void getter arghh
C++:
Ever had<to const<try to > parse> this nonesense const?
Perl:
my $head has @had enough of this %_#&
Obj-C:
Did no one [get theMessage:message] that sometimes you have to actually @Read code?
Obj-C: what if C++ but everything is different just because
...and then there's Objective-C++
I want to tell whoever made it: "What did source code ever do to you?!?"
I always hate dealing with our VB code base. You thought parenthesis and curly braces were bad, what about a whole statement to terminate a block:
End If
End Case
End For
.Then there is having to continue a multi-line statement with an ending underscore
_
.Then there's
Sub
vsFunc
keywords. If I useSub
then later decide I need to return a value, I have to change the keyword toFunc
in order to do so or it will not compile.There are probably more I'm not thinking of.
VB.net was my first language, and I have a special hatred of it. (What sort of lunatic thought
Dim
made even the SLIGHTEST bit of sense for initializing a variable???)HAHAHAHA That's literally the first thing all VB.net developers, who generally tend to hate VB.net, say.
Even I was like "Hey what's this Dim.. oh wait, that's a variable being declared."
I believe
Dim
is short for dimension. Not sure why the syntax is so array-focused.Technically a scalar value is just a special case where an array only has one dimension and one element... I remember it from QBasic in the 90s and apparently it goes back to Fortran.
True point. Although. technically declaring a value is also called
instantiation
, but that doesn't makeInstant
a good keyword for declaring a variable. :-PDim goes back to VB's BASIC roots. You didn't have to declare most scalar variables, but you had to use 'Dim' to 'Dim'ension arrays.
In some dialects, strings were treated as scalars and didn't require declaration, but other dialects required you to 'Dim' them as arrays.
As was mentioned, it may even go further back to FORTRAN, but that's a bit before my time.
/grognard hat off.
Be glad
ReDim Preserve
isn't a thing any more :PDIM was short for dimension. In early BASIC forms, it was to declare an array by indicating its size. Later it was repurposed to do any sort of declaration.
Back in the day, I worked on a VB Embedded program but didn't have the devices yet so worked in VB 6. All well before .NET.
When I started to port it over, I found that VB differed. Like, VBe and VB6 had incompatible
for
loops. Or maybewhile
. I didn't like VB much either way, but it worked. It's the incompatibility that's ugly to me..NET ftw
I suddenly remembered my very first programming language back in 1989 (?). GW-BASIC. And line numbers.
π
GW-BASIC was my very first language, too! :D
Some comments may only be visible to logged-in visitors. Sign in to view all comments.