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
Dmitry K -
Archie -
Luxand.cloud -
Opajobi Oyegoke -
Oldest comments (232)
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.
PHP: it’s not a bad syntax, it’s just not what some people like, and they’ve formed opinionated debates over it.
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
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.
True enough. The syntax isn't bad as in defective or overly verbose. It does look inelegant to me, though.
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.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.
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.
=== and !== look rad in Fira Code
You might have to blame ADA for that.
PL/SQL also uses it – it is very closely related to ADA.
A C++ variadic template, with move operations, lambdas, and static conditions, is essentially unreadable.
All of C++ is a syntactical morass.
True, but filled with little hidden gems, thus we continue to slog through it.
We need a simpler syntax for C++ :)
Some recent addition to the language help with that. Things like "if constexpr" permit to get rid of some SFINAE, and lambdas are generally helpfull into simplifying some code.
Well, even if the syntax for lambdas is...
(this is just an useless example of code that nobody should ever write)
;-)
Indeed. +1 for using \n instead of std::eol.
Indeed! (You probably mean
std::endl
;-))And yes, this thing is the devil and should not be used. I'm sad so much books and courses about C++ use this thing as a "new line" character, it is not. It happens to print one before flushing.
std::cin and std::cout will synchronize themselves, you don't need to flush by hand, you just makes your program slower that it should be, and this tend to make me angry ;-)
Oh yeah, I meant
std::endl
... haha I have read too much about LF and CRLF eol's these daysRemark, I wouldn't be a bad thing to have a global called "eol" or "lf" in std that doesn't flush the output. :-)
But it's really a shame that they called this thing "endl"...
We need to switch to Rust. :)
Ada 95 or Lisp.
I actually enjoyed Lisp's parentheses art, but still ugly.
Writing LISP with a simple editor that didn't "match" opening and closing parentheses automatically. That was fun!
LOL I learned Ada in college, just before 95. I thought it was very elegant. Then Ada 95 tacked on OOP and ruined it.
Java
Brainfuck.
ArnoldC
"mainstream"?
dev.to is built with Brainfuck.
No kidding?
Open-Source it and we will see ;)
dev.to/ben/the-devto-codebase-will...
lol best answer.
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.
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.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
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 😅
Java Syntax has the weird ability to direct the attention to the less important parts of the code first.
Ugliest I ever dealt with is BASIC. Not Visual Basic from MS, but old-school
20 GOTO 10
BASIC.But that was 30 years ago and I never did it for pay.
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
For as many under-the-hood advancements they have when I first came across Go and Rust I denounced them at first because of how ugly they are.
With Rust's lifetimes and it's type system you sometimes end up with pretty crazy type signatures.
RefCell<Rc<'a &Mutex>>>
mostly that's if you are trying to write concurrent code though.Yeah, Rust is awful in my opinion! I mean, if you value some of the compiler guarantees it offers, I guess that's fair enough, but it seems more like an academic exercise to me than a usable programming language. One should not have to struggle with a language just to get frequently-used and standard types of logic working.
I get put off by the parenthetical soup that Lisp can sometimes become, but I've never encountered a syntax I hated more than Objective-C. Had to dig in some old iOS code in Obj-C at a previous job for an app we were planning to build, it made me want to tear my eyes out
Golang
I still love it, chunky retro capitalization and awkward indentation and all, but even I have to admit that the inner elegance of a well-designed SQL query only shines through sometimes.
php by far
I nominate C++.
I like that C++ has the Spiral Rule.
I'm worried that it needs it.
C has the Spiral Rule. C++ broke it.
Objetive-C have a special place in the darkness places of my heart.
I vote for Objective C as well
"Wait, how many [ do I have? [[[[[ fuck this shit!"
[[[alloc Shit] init] intercourseWith:Penguin]]]
Reminds me of ClojureScript.
And yet there are people who insist Objective-C is somehow a great language, ahead of its time. Like Javascript and C++. LOL
Some comments may only be visible to logged-in visitors. Sign in to view all comments.