DEV Community

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

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