DEV Community

Which mainstream programming language has the ugliest syntax?

Ben Halpern on March 06, 2018

Regardless of the language's usefulness, which language fails the beauty contest the worst?

Collapse
 
david_j_eddy profile image
David J Eddy

Does BASH count? :|

if [! -d './directory']; then
  echo 'nope'
else
  echo 'yep'
fi
Enter fullscreen mode Exit fullscreen mode

:|

Collapse
 
vorakl profile image
vorakl • Edited

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

[[ -d directory ]] && echo yep || echo nope
Collapse
 
joseprl89 profile image
Josep

that is even harder to read

Thread Thread
 
sent2null profile image
David Saintloth • Edited

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

Collapse
 
david_j_eddy profile image
David J Eddy

That is going to be very helpful! Thank you.

Collapse
 
dserodio profile image
Daniel Serodio

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

Collapse
 
moopet profile image
Ben Sinclair

*cough* set -o to turn an option on and set +o to turn it off *cough*

Collapse
 
ben profile image
Ben Halpern

Bash counts!

Collapse
 
casperbraske profile image
Luis

It's beautiful, IMO. <3

Collapse
 
elmuerte profile image
Michiel Hendriks

That would be Bourne Shell's fault, not BASH.

Collapse
 
erikthered profile image
Erik Nelson • Edited

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.

Collapse
 
tobias_salzmann profile image
Tobias Salzmann

Java Syntax has the weird ability to direct the attention to the less important parts of the code first.

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
 
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 😅

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
 
kaydacode profile image
Kim Arnett 

Objective C
Or should I say
[[[[[[[[[objective c]]]]]]]]]]

Collapse
 
ryanhaber profile image
Ryan Haber

PHP

Oldschool-wise, I can never forgive Pascal it's := operator.

Collapse
 
ben profile image
Ben Halpern

Can you tell me more about the := operator?

Collapse
 
lavigi profile image
eva

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.

Collapse
 
chainq profile image
Károly Balogh

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.

Collapse
 
qm3ster profile image
Mihail Malo

=== and !== look rad in Fira Code

Collapse
 
databasesponge profile image
MetaDave 🇪🇺

And there was me thinking it was from ADA ... it's like archaeology, this, just stripping layers away.

Thread Thread
 
ryanhaber profile image
Ryan Haber

Historical linguistics is a real discipline in natural languages. I love the analogies between natural languages and computer languages.

Thread Thread
 
databasesponge profile image
MetaDave 🇪🇺

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.

Collapse
 
ryanhaber profile image
Ryan Haber

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

Thread Thread
 
chainq profile image
Károly Balogh • Edited

I believe there's worse than PHP, but that alone doesn't make any PHP better for sure. :)

BTW, I always think about replacing : with be and = with equal in my mind when reading Pascal code. So a:=1; is let a be equal 1. Same works with colon elsewhere, for example type definitions like var x: integer; can be read as let 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

Thread Thread
 
ryanhaber profile image
Ryan Haber

No, it's a nice thought. It does work, as far as I can remember. Maybe it's what Pascal's creators were thinking.

Collapse
 
michaelgv profile image
Mike

PHP: it’s not a bad syntax, it’s just not what some people like, and they’ve formed opinionated debates over it.

Collapse
 
antjanus profile image
Antonin J. (they/them) • Edited

Especially if you look at more modern PHP. I really like Laravel's code style.

For non-PHP developers, a few syntax niceties:

  1. All variables have a $ prefix. So $post = getPost($id).
  2. Accessing class properties (non-static) is done via an arrow: $request->has('name')
  3. Accessing static properties is done via :: (by far my favorite). Route::get('/api/posts', function() {});

I also like PHP namespacing:

namespace Vendor\Lib\Class;

and accessing the namespace:

use Vendor\Lib\Class;
Thread Thread
 
ethan profile image
Ethan Stewart

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! 🤷🏻‍♂️

Thread Thread
 
antjanus profile image
Antonin J. (they/them)

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.

Thread Thread
 
moopet profile image
Ben Sinclair

I really dislike PHP namespacing.

Collapse
 
anasik profile image
Anas Ismail Khan

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.

Thread Thread
 
jeroendedauw profile image
Jeroen De Dauw

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.

Thread Thread
 
ryanhaber profile image
Ryan Haber

Lol. It helps. :D

Collapse
 
ryanhaber profile image
Ryan Haber

True enough. The syntax isn't bad as in defective or overly verbose. It does look inelegant to me, though.

Collapse
 
databasesponge profile image
MetaDave 🇪🇺

You might have to blame ADA for that.

PL/SQL also uses it – it is very closely related to ADA.

Collapse
 
tiffanywismer profile image
Tiffany Wismer

I personally find JavaScript to be absolutely hideous.

Collapse
 
cutiko profile image
Erick Navarro

Javascript is very close to start looking like a bunch of emojis:
()=> :}

Collapse
 
qm3ster profile image
Mihail Malo

()=> :} 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)

Collapse
 
dougblackjr profile image
Doug Black

HA! You are 100% right!

Collapse
 
edoxtator profile image
Doc

It's right behind Java, IMHO. It's much easier to read obfusticated C than JS.

Collapse
 
tiffanywismer profile image
Tiffany Wismer

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.

Thread Thread
 
qm3ster profile image
Mihail Malo

Sounds like you need Bracket Pair Colorizer

Thread Thread
 
twobridges profile image
Dean Grande

This is by far the most useful comment I've read here, thanks Mihail

Collapse
 
vintprox profile image
Rodion Borisov

Why would anybody care to read obfuscated code in the first place without the help of formatter? Unless you are developer of bundler...

Collapse
 
ewnx01 profile image
Drunken Dev

Definitely, but there are some small signs to become more handleable.

Collapse
 
nickfazzpdx profile image
Nicholas Fazzolari

Same here.

Collapse
 
chocolim profile image
Choco Lim

Objetive-C have a special place in the darkness places of my heart.

Collapse
 
shaioz profile image
Shai Ohev Zion

"Wait, how many [ do I have? [[[[[ fuck this shit!"

Collapse
 
cbordeman profile image
Chris Bordeman

And yet there are people who insist Objective-C is somehow a great language, ahead of its time. Like Javascript and C++. LOL

Collapse
 
eljayadobe profile image
Eljay-Adobe

[[[alloc Shit] init] intercourseWith:Penguin]]]

Thread Thread
 
mouvedia profile image
G.

Reminds me of ClojureScript.

Collapse
 
danielkun profile image
Daniel Albuschat

I vote for Objective C as well

Collapse
 
atyborska93 profile image
Angelika Cathor • Edited
private static final OpinionAboutJava opinionAboutJava = OpinionAboutJavaFactory.getOpinionAboutJava("ugh...")
Collapse
 
evanoman profile image
Evan Oman

Explicit is better than implicit, right? Doesn't get more explicit than that :D

Collapse
 
lacanlale profile image
Jonathan Lacanlale • Edited

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) ;_;

Collapse
 
vishnuharidas profile image
Vishnu Haridas
val opinionAboutKotlin = getOpinionAboutKotlin("Aha!")
Collapse
 
dhandspikerwade profile image
Devin Handspiker-Wade • Edited

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.

Collapse
 
mjb2kmn profile image
MN Mark

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!)

Collapse
 
edoxtator profile image
Doc

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.

Thread Thread
 
dhandspikerwade profile image
Devin Handspiker-Wade

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.

Collapse
 
chigix profile image
Richard Lea

The WHITESPACE is exactly the problem.

Collapse
 
wplj profile image
wplj

Lisp, "ugly"? best oxymoron ever.

Thread Thread
 
faranaiki profile image
Muhammad Faran Aiki

Oxymoron? Best misnorm ever. Oxymoron is when the antonym meets its base word.

Collapse
 
vladinator profile image
Vlady Veselinov • Edited

Absolutely. My pet peeves with it are:

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

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

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

Collapse
 
tterb profile image
Brett Stevenson • Edited

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:

if __name__ == "__main__":
  main()
Enter fullscreen mode Exit fullscreen mode

(copy & pasted)

Thread Thread
 
vladinator profile image
Vlady Veselinov

Oh yeah, despite complaining so much I still like it overall as a language.

Collapse
 
markcaggiano7 profile image
M.C.

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.

Collapse
 
thais profile image
Thais Hamilton

The greatness of Python is proportional to its ugliness

Collapse
 
val_baca profile image
Valentin Baca • Edited

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?

Collapse
 
twof profile image
Alex Reilly

Obj-C: what if C++ but everything is different just because

Collapse
 
val_baca profile image
Valentin Baca

...and then there's Objective-C++

I want to tell whoever made it: "What did source code ever do to you?!?"

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

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

If condition1 And condition2 _
   And condition3 Then

End If
Enter fullscreen mode Exit fullscreen mode

Then there's Sub vs Func keywords. If I use Sub then later decide I need to return a value, I have to change the keyword to Func in order to do so or it will not compile.

There are probably more I'm not thinking of.

Collapse
 
codemouse92 profile image
Jason C. McDonald

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

Collapse
 
anasik profile image
Anas Ismail Khan

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

Thread Thread
 
kspeakman profile image
Kasey Speakman

I believe Dim is short for dimension. Not sure why the syntax is so array-focused.

Thread Thread
 
dmfay profile image
Dian Fay

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.

Thread Thread
 
codemouse92 profile image
Jason C. McDonald • Edited

True point. Although. technically declaring a value is also called instantiation, but that doesn't make Instant a good keyword for declaring a variable. :-P

Thread Thread
 
tinsoldier6 profile image
Jason Gade

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

Collapse
 
daniel15 profile image
Daniel Lo Nigro

Be glad ReDim Preserve isn't a thing any more :P

Collapse
 
cbordeman profile image
Chris Bordeman

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

Collapse
 
jacoby profile image
Dave Jacoby

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 maybe while. I didn't like VB much either way, but it worked. It's the incompatibility that's ugly to me.

.NET ftw

Collapse
 
ryanhaber profile image
Ryan Haber

I suddenly remembered my very first programming language back in 1989 (?). GW-BASIC. And line numbers.

😐

Collapse
 
cbordeman profile image
Chris Bordeman

GW-BASIC was my very first language, too! :D

Collapse
 
eljayadobe profile image
Eljay-Adobe

I like this game.

Ugly syntax:

  • C++
  • Perl
  • PHP
  • Intel assembly
  • Erlang
  • Eiffel

Verbose, unwieldly, and/or awkward syntax... but not what I'd quite call truly ugly:

  • Java
  • C#
  • JavaScript
  • TypeScript
  • Scala
  • BASIC
  • FORTRAN
  • COBOL
  • Objective-C

I just don't like it syntax:

  • Pascal (Object Pascal, Delphi, Oxygene)
  • SQL
  • Ruby
  • Haskell
  • LISP
  • MATLAB

Nice syntax:

  • CoffeeScript
  • C
  • Python
  • D (...basically redoes C++ syntax so it doesn't suck)
  • OCaml or F#
  • Lua
  • 6502 assembly
  • 68000 assembly
  • Prolog (... the syntax is nice; the language is painful)

Syntax that I'm not sufficiently familiar with to find the flaws, but I bet I'd find it nice, or at least not ugly:

  • Swift
  • Go
  • Kotlin
  • Groovy
  • Boo
  • Ada
Collapse
 
christopheriolo profile image
Christophe Riolo

You put OCaml in "nice syntax" and Haskell in "don't like". I've learned programming mostly with OCaml so I love it but I've been considering also learning Haskell, since I believe it is more popular. Would you say your view why you don't like Haskell? :)

Collapse
 
eljayadobe profile image
Eljay-Adobe

I think plain OCaml and Haskell are probably about tied for popularity.

If you include F# as a kind of OCaml (since it is pretty much OCaml for .NET, as a first-class supported citizen by Microsoft), then OCaml wins the popularity contest in a landslide.

If you are deciding between Haskell versus Scala or Clojure ... well, I think either Scala or Clojure have Haskell beat.

Haskell is a pure FP.

Clojure is Lisp with FP added. (Normally targeting JVM, but can target .NET or transpile to JavaScript. Probably a bother to target .NET or JS.)

Scala is OO, with FP; targeting JVM. (In contrast to F# which is FP, with OO added in order to support .NET requirements.)

Thread Thread
 
mudia profile image
mudia

I find it fascinating that you think that Haskell uglier than OCaml! As a new hobby/amateur programmer, I find that your description of the two languages is the exact opposite. I know nothing of OCaml but just looking at comparisons of code and it seems that both languages are similar but Haskell is cleaner and has some nicer syntax options, especially when it comes to function composition.

Collapse
 
eljayadobe profile image
Eljay-Adobe

I find OCaml's syntax to be very, very clean, and Haskell's syntax to be unnecessary awkward and clumsy. YMMV.

Thread Thread
 
christopheriolo profile image
Christophe Riolo

Well I like the globally unambiguous (except for variants with parameters arguably) and above all unforgiving syntax of ocaml so I will surely agree :)

Thread Thread
 
mudia profile image
mudia

I am an amateur and seeking what to learn. It seems that Haskell is the holy grail of functional programming. I think OCaml only has success because it caught on in certain European Universities (especially in France).

In terms of popularity though, it seems that its reputation fro being too difficult has held it back. However, there are enough people that tell you that Scala sucks as a functional programming language. I tried starting it, and it's just ugly and tedious.

Anyway, as you are an OCaml expert maybe something like this will help you
science.raphael.poss.name/haskell-...

Thread Thread
 
eljayadobe profile image
Eljay-Adobe

Thank you for you interest.

Since you are seeking what to learn, and you are enjoying Haskell, I would say stick with Haskell.

Programming languages are tools. If Haskell can handle the kinds of problems that you are working on, then that's a good tool for the job.

If you discover a programming challenge that Haskell is not the right tool for the job, then that would be a good time to consider alternative languages.

Regardless, Haskell will teach you a lot of good programming habits. And those good habits will be applicable to any other programming language you learn in the future.

Collapse
 
sam_ferree profile image
Sam Ferree

Wish I got to write in 6502 assembly... My OS professor made us write the machine code direct... and those 16 bit words were virtual, but the chip was designed so that the least significant byte was first... so you have to invert your variables HEX notation...

I still have nightmares.

Collapse
 
igormp profile image
Igor Moura

Intel's assembly syntax is really gorgeous when compared to AT&T's syntax

Collapse
 
eljayadobe profile image
Eljay-Adobe

It's not the Intel vs AT&T syntax that is the problem, it's the 80x86, Itanium and AMD64 syntax that is the problem.

I'd add that RISC syntax of DEC Alpha and PowerPC assembly is likewise ugly, but for different reasons than Intel's syntax.

Thread Thread
 
igormp profile image
Igor Moura

Ops, my bad there.

Pretty much any CISC ISA is kinda ugly when compared to most RISC ones.
MIPS, RISC-V (and even ARM to some extent) are way better to read and write, even if that means more lines of code in the end.

Thread Thread
 
eljayadobe profile image
Eljay-Adobe

I'd put 6502 or 68000 up against any RISC assembly, any day. 68000 was especially enjoyable. 6502 was small enough to hold in your head. Both were great fun. And, alas, both have utterly gone by the wayside.

Collapse
 
edoxtator profile image
Doc

I loved 6500 family assembler. So simple, direct.

Collapse
 
programliftoff profile image
Programming Liftoff

I think you’d put Ada under the verbose category. Definitely a lot of typing

Collapse
 
lyfolos profile image
Muhammed H. Alkan

Bad syntax: Erlang
Nice syntax: Coffeescript

... Really?

Collapse
 
eljayadobe profile image
Eljay-Adobe

What do you find particularly bad about Erlang's syntax?

Thread Thread
 
lyfolos profile image
Muhammed H. Alkan

I love Erlang already dude, that guy just says CoffeeScript is better than Erlang's syntax. That's dumb

Thread Thread
 
eljayadobe profile image
Eljay-Adobe

Oh... I didn't say Erlang had bad syntax. I said Erlang has ugly syntax.

I thought you were saying Erlang had bad syntax.

If I were targeting the Erlang VM, I'd probably use Elixir.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

A C++ variadic template, with move operations, lambdas, and static conditions, is essentially unreadable.

Collapse
 
eljayadobe profile image
Eljay-Adobe

All of C++ is a syntactical morass.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

True, but filled with little hidden gems, thus we continue to slog through it.

Collapse
 
skyrpex profile image
Cristian Pallarés

We need a simpler syntax for C++ :)

Collapse
 
ybalrid profile image
Arthur Brainville

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

[&](const std::string& some_adjective){std::cout << "... a bit " << some_adjective << " sometimes ...\n";}("laborious");

(this is just an useless example of code that nobody should ever write)

;-)

Thread Thread
 
skyrpex profile image
Cristian Pallarés

Indeed. +1 for using \n instead of std::eol.

Thread Thread
 
ybalrid profile image
Arthur Brainville

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 ;-)

Thread Thread
 
skyrpex profile image
Cristian Pallarés

Oh yeah, I meant std::endl... haha I have read too much about LF and CRLF eol's these days

Thread Thread
 
ybalrid profile image
Arthur Brainville

Remark, 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"...

Collapse
 
cbordeman profile image
Chris Bordeman

We need to switch to Rust. :)

Collapse
 
sam_ferree profile image
Sam Ferree

Does PERL still count as mainstream?

Because PERL.

Collapse
 
nancyd profile image
Nancy Deschenes • Edited

Totally PERL. Except maybe it doesn't count, as it is, afterall, a write-once language.

If you need to read it, you're better off rewriting it, it'll be faster and easier.

Collapse
 
mshappe profile image
Michael Scott Shappe

I don't understand why Perl is so low down in this list. It should have been dead first. I mean, I used to adore Perl, because of what you could do with it--it was the first of the "scripting" languages that felt really capable, and for a while I wrote everything in it.

But go back and try to read it, even if you wrote it yourself...gah...

Collapse
 
kshoultz profile image
Kevin

I was going to say perl

Collapse
 
bosepchuk profile image
Blaine Osepchuk

I vote for perl as well.

Thread Thread
 
mbtts profile image
mbtts • Edited

I haven't found any of the C style/family languages that bad, but Perl would probably get my vote. In the code I looked at and wrote there were too many squiggles and not enough words. In worst cases looks like hieroglyphics to me.

 
antjanus profile image
Antonin J. (they/them)

which is really awesome because it forces you to show where you're declaring the value, and where you're just reassigning it via =. Absolutely love this syntax.

Thread Thread
 
ryanhaber profile image
Ryan Haber

Yeah, but if I recall, the syntax made it redundant anyway, since Pascal wouldn't accept assignments in the middle of a logic evaluation, for instance, would it?

Thread Thread
 
antjanus profile image
Antonin J. (they/them)

I've no idea, I've never done any Pascal.

Thread Thread
 
arj profile image
arj

Correct, Pascal didn't allow assignments in expressions as an assignment was a statement and not an expression.

In C an assignment is an expression and thus it is allowed to be included into other expressions.

In Pascal though you never had trouble with this:

if (x = "command") {
   std::cout << x << std::end;
}
Collapse
 
vikkio88 profile image
Vincenzo

Go? I like it but the error checking and the way it simulates objects oriented programming via struct and receiver is disgusting to look at

Collapse
 
ogfris profile image
Fris

idk what's wrong with that, it has one of the best syntax and structs are good when you adapt yourself to it

Collapse
 
vikkio88 profile image
Vincenzo

"one of the best syntax" according to which parameters? It is personal preference after all, isn't it?
The error management is horrible to read, for example, I find more readibletl try catches, rather than checking all the time if error not nil.

Thread Thread
 
ogfris profile image
Fris

i guess you just don't like new things.

Thread Thread
 
vikkio88 profile image
Vincenzo

I do like plenty of new things, is just go syntax that makes me puke.
Why are you taking this so personally? lol
It's just a personal opinion

Thread Thread
 
ogfris profile image
Fris

i felt attacked

Thread Thread
 
vikkio88 profile image
Vincenzo

are you in the golang core developer team?

lol

mine is just a personal preference that I expressed.

Thread Thread
 
ogfris profile image
Fris

i wish i were... lol im not im just a fellow gopher

Collapse
 
vintprox profile image
Rodion Borisov

Usually those who don't appreciate Golang's syntax are immediately sent by pro gophers to go learn some computer science, lol. Buncha weirdos in the net!

Collapse
 
eronaeon profile image
eronaeon

Golang

Collapse
 
defman profile image
Sergey Kislyakov

Brainfuck.

Collapse
 
jacoby profile image
Dave Jacoby

"mainstream"?

Collapse
 
ben profile image
Ben Halpern

dev.to is built with Brainfuck.

Thread Thread
 
anasik profile image
Anas Ismail Khan

No kidding?

Thread Thread
 
defman profile image
Sergey Kislyakov

Open-Source it and we will see ;)

Thread Thread
 
mouvedia profile image
G.
Collapse
 
maestromac profile image
Mac Siri

lol best answer.

Collapse
 
nektro profile image
Meghan (she/her)

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.

Collapse
 
nestedsoftware profile image
Nested Software • Edited

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.

Collapse
 
dfockler profile image
Dan Fockler

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.

Collapse
 
dougdescombaz profile image
doug descombaz

I like semicolons, parenthesis, and curly braces. Very unambiguous stuff. I don't get a thrill out of optional syntax that allows a language to double as a DSL for something else. Slight verbosity isn't the critical problem in engineering.

Collapse
 
aaronsapa1 profile image
Aarón Ch. Sánchez

Ruby

Collapse
 
xtabdeveloping profile image
Márton Kardos

I'm pretty sure you're alone with that xD

Collapse
 
christopheriolo profile image
Christophe Riolo

Nope! I dislike it too :)

Thread Thread
 
itchysand profile image
Itchy-Sand

Seriously? Ruby is syntax is poetry compared to other languages.

Thread Thread
 
alainvanhout profile image
Alain Van Hout

Try debugging poetry. The syntactic vocabulary is far too large for it to be elegant (imo, obviously).

Thread Thread
 
itchysand profile image
Itchy-Sand

Totally agree with you on debugging. It may not be as practical, but I don't find it ugly. Actually, I think these properties are mutually exclusive.

Thread Thread
 
alainvanhout profile image
Alain Van Hout

It guess it depends on whether you think inelegance is ugly, and then whether a far too large vocabulary is inelegant or not.

Collapse
 
jwbowen profile image
Jason Bowen

Java

Collapse
 
ethan profile image
Ethan Stewart

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

Collapse
 
danielsarmiento profile image
Daniel

Ada 95 or Lisp.

I actually enjoyed Lisp's parentheses art, but still ugly.

Collapse
 
lavigi profile image
eva

Writing LISP with a simple editor that didn't "match" opening and closing parentheses automatically. That was fun!

Collapse
 
cbordeman profile image
Chris Bordeman • Edited

LOL I learned Ada in college, just before 95. I thought it was very elegant. Then Ada 95 tacked on OOP and ruined it.

Collapse
 
jacoby profile image
Dave Jacoby

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.

Collapse
 
dwd profile image
Dave Cridland

Well, obviously Perl. There was a long-running gag that Perl5 had ceased development because Larry Wall had run out of symbols to assign random meanings to. But that's not mainstream anymore, I suppose. Mostly because it was so ugly.

So, then; Erlang ->
is horrible ->
looks = if someone was snorting Perl ->
and sneezed;
end,

Honestly. That's an awful syntax.

Collapse
 
aswathm78 profile image
Aswath KNM

JS has the most ugliest syntax . No offence great language . But do we still need semi colons, braces, old style loop declaration etc.. ??

Collapse
 
hrmny profile image
Leah

Well, js is an old language and is c-like, so blame that ig

But you can leave out semicolons in most places and use functional loops

Collapse
 
vintprox profile image
Rodion Borisov

Bruh, stop using obviously outdated tutorials and look around: we have ECMAScript 2016+, and it's better JavaScript you'll ever see (TypeScript takes my cake though 😉). Semicolons never were mandatory, loop declaration is less verbose.

Collapse
 
robbydmz profile image
Robby

do we still need semi colons, braces, old style loop declaration

No we don't, semi colons are optional and there are better loop declarations in modern ecmascript.

Collapse
 
briankephart profile image
Brian Kephart

My first impression of Javascript was that it combined the slower performance of an interpreted scripting language with the finicky curly-brace/semicolon syntax of C, then gave overly verbose names to all the most common methods. I'm sure there's uglier out there, but this combination really stuck in my mind when I first used it.

(Yeah, I know V8, ES6, etc. It's gotten better, but I've never forgotten that first impression.)

Collapse
 
robbydmz profile image
Robby

You're first impression is unfortunately just a first impression. The 'slower performance of an interpreted scripting language' is a myth since it is actually compiled to native by the V8 engine.

Collapse
 
mbtts profile image
mbtts

XSLT if it counts as mainstream (maybe not now).

For the uninitiated it is a way to program using XML alone. Typically it is used to convert from one XML document into another XML document using an even bigger third XML document known as a "stylesheet". Unsurprisingly this process typically requires a heap-full of memory and copious amounts CPU.

I might be doing it a disservice but I found it hard to comprehend, hard to write and transforms non trivial to debug.

Collapse
 
kriang profile image
kristofferanger • Edited

Swift is ugliest, look at this AppDelegate method for example...

override func application(_ sender: NSApplication, delegateHandlesKey key: String) -> Bool {
    return key == "tasks"
  }
Collapse
 
anasik profile image
Anas Ismail Khan

I nominate C++.

Collapse
 
jakebman profile image
jakebman

I like that C++ has the Spiral Rule.

I'm worried that it needs it.

Collapse
 
eljayadobe profile image
Eljay-Adobe

C has the Spiral Rule. C++ broke it.

Collapse
 
stefandorresteijn profile image
Stefan Dorresteijn

Objective-C is the ugliest thing I've ever seen.

I personally really dislike the PHP and JS syntax. Ruby and Elixir have a special place in my heart. I just want to write English and have it translate to code.

Collapse
 
jxpx777 profile image
Jamie Phelps

AppleScript is by far the ugliest language I have to deal with on a regular basis. For all its attempts to be “English like”, I have never once written anything but the most trivial statements without at least an hour of futzing. It’s simply brutal.

Collapse
 
kauhat profile image
Jack Fletcher

Anything related to shell scripting. Special shout out to CMakeLists.txt.

PHP is fine. Take away the $ and you've got something that looks like any other language.

Collapse
 
pbkarlsson profile image
Philip Karlsson

Before learning Javascript, I'd have said Javascript. It took a while to get used to things like passing functions as arguments to functions.

Now however I'd probably say Python. At first glance it might not look that bad, but I find the lack of (), {} and semicolons mildly annoying.

Collapse
 
akashdeepsingh profile image
Akashdeep Singh

I wonder why no one's mentioned HTML. It is a language, and if you were typing on an IDE without closing-tag-matching, it's an absolute nightmare to work with. Thankfully, I've largely gotten jobs with backend programming so I've not had to wrestle too much.

Collapse
 
djtai profile image
David Taitingfong

I'm assuming because by technicality it isn't a "programming" language. I've always found HTML easy to read and comprehend though, but hey - that's just my opinion.

Collapse
 
rahra profile image
Bernhard R. Fischer

Definitely python. Oldschool 80's-style. I wonder how this could become so popular.

Collapse
 
dmfay profile image
Dian Fay

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.

Collapse
 
igormp profile image
Igor Moura

I feel a personal hatred for JS, PHP, C++, Haskell, Lisp and Java.
I dislike Rust's syntax, but also feel like that's a necessary evil for what the language offers.

Python is on a weird spot where it can be both beautiful to read or a whole hell for you.

On the other hand, I'm all love for C, Go, and most archs' asm <3

Collapse
 
jvarness profile image
Jake Varness

I feel like if you tried hard enough, or didn't try nearly as hard as you should, you can make any modern language look abysmal.

C takes the cake for me because I don't think you can make the code, nor the error messages, look particularly great.

Collapse
 
leob profile image
leob • Edited

Perl !

And I'm also not a huge fan of PHP's syntax, too many $'s even though I'm contemplating doing my next project with Laravel (trade-off between PHP's language syntax and Laravel's great community and ecosystem).

I see people picking on Java, the good thing about Java is its readability, that's why it is so popular with companies ... but yes, way more verbose than it needs to be.

Collapse
 
edoxtator profile image
Doc

Java makes my back hurt. It's like COBOL 77. Three hundred lines to add two numbers together and display the result.

Collapse
 
rpoirier profile image
Reese Poirier

Python 2 - so bad I avoided the language like the plague until Python 3 changed my mind about it
Ruby - my new bête noire
Perl - Though I love it so, it is hardly easy on the eyes
[[[[[[[Objective C]]]]]]]]
(Most ((functional(languages))) - though I may only like Haskell through Stockholm syndrome

Collapse
 
eddienewpath profile image
Eddie Dong

I know java and ruby only so I do not have much to say about other languages. Java is definitely verbose but I don't see it as ugly. ruby is build to write elegant code but I find it a bit of awkward and insecure because of its simplicity.

Collapse
 
felipperegazio profile image
Felippe Regazio

php by far

Collapse
 
bertilmuth profile image
Bertil Muth

Perl. I was first fascinated by the "there is more than one way to do it" philosophy. But Perl makes it very easy to produce really unreadable, hard to maintain code. (Unless you love regular expressions. Which I don't, even if I find them useful in some cases.)

Collapse
 
thallesaraujo profile image
Thalles Henrique

I was literally searching on Google “Why Ruby is so ugly?” when this article appeared on the list. “puts” in Brazilian Portuguese is a slang for “oh, fuck!”, or when something was messed up. And when I saw a code example with:

say = ‘hello’
5.times { puts say }

I only could think what kind of psychopathy is that.

Collapse
 
djviolin profile image
István Lantos

Maybe related, although not syntax, more like design:
wiki.theory.org/index.php/YourLang...

Collapse
 
johannestegner profile image
Johannes

CoffeeScript by far, its horrid, I rather write brainfuck than Coffee!

Collapse
 
k2t0f12d profile image
Bryan Baldwin

Does sendmail.cf count?

Collapse
 
michaeldober profile image
Michael Ober

Powershell. MS removed the relative simplicity of the dotNet framework as implemented in C# and VB and saddled it with *nix style syntax.

Collapse
 
databasesponge profile image
MetaDave 🇪🇺

Anything with too many squiggles and punctuations.

[
]
{
}

etc.

You know which ones I mean.

Collapse
 
jonathasrr profile image
Jon Ribeiro

Ruby

Collapse
 
timolinn_ profile image
Timothy Onyiuke • Edited

I'm of the opinion that most (if not all) language syntax looks pretty anyways, as soon as you view the code with a cool IDE, with pretty font and theme. Also formatted by a code formatter.

Collapse
 
hannahkfrank profile image
Hannah Frank • Edited

Every time I read a perl script I figure someone's cat has been running around their keyboard pressing random punctuation.

Collapse
 
aghost7 profile image
Jonathan Boudreau

Ugh, here we go again with the language wars...

Collapse
 
nyambol profile image
Michael Powe • Edited

Why would anyone call this syntax ugly?

$="krJhruaesrltre c a cnP,ohet";$.=$1,print$2while s/(..)(.)//;

(The textbox code is stripping the underscore off the $_ var.)

Collapse
 
t3ndai profile image
Prince T Dzonga

Java for verbosity , PHP for just confusion, Obj-C wtf. Old JS for fuck you.

Collapse
 
alainvanhout profile image
Alain Van Hout

Some people find one-liners beautiful. I personally really dislike such dense code (python, go, some streams of js), but that's perhaps experience impacting appreciation.

Collapse
 
sandeepkamboj12 profile image
Sandeep kamboj

assembly language

Collapse
 
mcfedr profile image
Fred Cox

Ruby, everytime. Non obvious, lacking symbols that define blocks of code. Horrible.

Collapse
 
tinsoldier6 profile image
Jason Gade

I will add another vote for C++.

I've seen many good and clear examples in books and on the web.

In actual, working source code? runs away, screaming

Collapse
 
jandedobbeleer profile image
Jan De Dobbeleer

Any language where "good" programmers can't display purpose/intent fits the bill in my book. Therefore I'm inclined to nominate Bash. No matter how good you are, it sucks at that due to its syntax.

Collapse
 
qm3ster profile image
Mihail Malo

Rust. It is forcing me to consider allowing semicolons in my JavaScript.
F# would never do such a thing!

Collapse
 
vidthekid profile image
Geeda

TeX/LaTeX

Collapse
 
strredwolf profile image
STrRedWolf

FORTRAN. 'Nuff said. shudders

Collapse
 
coopsource profile image
Co-op Source

COBOL or Postscript

Collapse
 
thanniab profile image
Thannia Blanchet

Go

Collapse
 
jamesbsk profile image
James Bissick

Objective-C and Python

Collapse
 
andrewlucker profile image
Andrew Lucker

Node.js; not Javascript, just Node, because of how everything is designed around callbacks.

callbackhell.com/

Collapse
 
lffg profile image
Luiz Felipe Gonçalves

not anymore

Collapse
 
lyassa profile image
lyassa • Edited

Any language that uses ":=" for assignment - GO and Pascal comes to mind, and any language that uses tabs or spaces to define scope in the code - Python Spin and make come to mind.

Collapse
 
kayis profile image
K • Edited

I'd say Perl, PHP and Haskell. Oh and Objective-C of course xD

Collapse
 
biros profile image
Boris Jamot ✊ /

This discussion is really unfair for JS developers :)

Collapse
 
lyfolos profile image
Muhammed H. Alkan

ATS.

Collapse
 
tarzan212 profile image
tarzan212

Surprised that Javascript have not been mentionned more! Truly hideous syntax!

Collapse
 
lyassa profile image
lyassa

Any language that uses ":=" for assignment - GO and Pascal comes to mind, and any language that uses tabs or spaces to define scope in the code - Python, Spin and make come to mind.

Collapse
 
justynclark profile image
Justyn Clark

FreeMarker... Yuck!😝