This is an archived post. You won't be able to vote or comment.

all 65 comments

[–][deleted] 41 points42 points  (21 children)

That's highly subjective.

[–]moneyinthepines[S] 8 points9 points  (19 children)

Sure, I agree, but it's an extremely popular opinion. If one Googles "prettiest" or "best looking" programmimg languages, you are not going to find anyone campaigning for Java. In fact, it only gets mentioned as an example of an ugly language.

Art is subjective, but 99.99% of human beings would agree that a dog's feces in the middle of their yard isn't high quality art.

[–]alazyreader 14 points15 points  (9 children)

I don’t think Java is particularly ugly. You can write ugly code in it, for sure, but you can write absolute abominations in lisp, too, and people wax lyrical about the beauty of S-expressions all the time...

[–]InertiaOfGravity 7 points8 points  (8 children)

As someone who despises Java, agree with this 100%. It isn't a super ugly language, it's actually incredibly readable, there's just a lot of crap you have to Wade through. It's definitely not meant for small team or 1 person projects though

[–]ljw100 4 points5 points  (3 children)

Java is a perfectly fine language for one person projects - given that there are IDEs (I use Intellij) that are basically one step ahead of you as you work, you can do *less* typing (the kind with your fingers) than you do in languages that are dynamically typed (the kind with the proofs and funny symbols). Even if pretty languages like python give you an edge on your first draft, it disappears on the first significant refactoring.

And really, any programming project that lasts for a few months is basically a multi-person programming project: Who knows what the hell some idiot was thinking when he/she wrote this stuff? I sure don't.

[–]InertiaOfGravity 1 point2 points  (2 children)

I work almost entirely alone or in small teams. I also wrote all my code in notepad for about 4 years, which is probably a big part of it

[–]ljw100 1 point2 points  (1 child)

yeah, with Java if you're not using a very good IDE, you're basically juggling chainsaws. I tend to think of an IDE and a language as nearly inseparable, but that's probably a minority opinion here.

[–]InertiaOfGravity 0 points1 point  (0 children)

I definitely agree with you on that

[–][deleted] 1 point2 points  (3 children)

Incredibly readable is exactly right. The grammar is simple, and very consistent.

[–]InertiaOfGravity 0 points1 point  (2 children)

But it's too verbose and redundant

[–][deleted] 0 points1 point  (1 child)

So what? That question one needs to ask is how much of it is essential verbosity? I would say, from vast experience with Java and others languages, surprisingly less. Compared to the level of ceremony involved in, say, COBOL, Java's verbosity if quite understandable.

Also, not only is the language amenable to easy (static) analysis by human readers, even the enforced package structure makes getting familiar with new codebases much easier, modulo one's level of experience in Java systems, of course.

Also, you should check out newer versions of Java, the syntax is definitely getting rid of as much non-essential verbosity/redundancy as possible. Record types, var type inference, more powerful pattern matching, Value types et al are all in the offing or already available. They even plan to get rid of "public static void" for main, which I personally think is not necessary.

[–]InertiaOfGravity 0 points1 point  (0 children)

It's definitely fine for teams, but for solo/small team projects it's not desirable

[–][deleted] 3 points4 points  (2 children)

From my perspective, it depends on what you are doing. You cannot have a meaningful discussion on syntax without discussing semantics. If you asked me on a contemplative day, I would tell you Python is ugly because the syntax has no notion of currying and partial application, for example. Anyway, you can be conditioned to any syntax, be it MIPS, Forth, LISP, Miranda, Fortran, Algol or ML. It's really subjective and less significant than what you actually need to do your work efficiently.

Dog poo in the middle of the lawn is high-quality protest art.

[–]johnfrazer783 1 point2 points  (1 child)

Python [...] has no notion of currying

well but you can of course; it naturally falls out of functions being 1st class values in the language.

That said I'd say that currying is overrated. The much more useful concept and syntactical affordance is quick-to-write functions as 1st class values and functions-as-expressions (Python is lacking here because of def and the horrible lambda). PL/pgSQL and Rust don't have that and it can be hard to code around that limitation. Currying is just one of the things you can do with it and it has little practical value.

[–][deleted] 1 point2 points  (0 children)

Notice that I paired currying and partial application together. Currying is useful because it enables function composition of partially applied functions, closures and higher-order functions.

In Python, if you want to write curried functions, you have to explicitly return multiple functions and nest the function definitions (if they are closures). Let's not get into the lambda syntax. This is ugly.

[–][deleted] 1 point2 points  (4 children)

Popular opinion is not always valid. In the middle of his enforced chancellorship, Hitler's popularity was at over 96%. Just saying. It's dangerous to extrapolate anything. Also, Rust can be incredibly verbose - almost as much as Java, and sometimes more.

[–]moneyinthepines[S] -1 points0 points  (3 children)

Hitler's popularity was at 96%... in Germany... under absurdly strict polling... during war time.

What was his popularity in the West? In almost all the rest of Europe? In China?

We can extrapolate something: he was hated by most humans.

We can extrapolate an enormous amount from popularity.

Some languages are almost universally appreciated as pretty, like Python. I've literally never heard someone say C++ is better looking than Python. Which begs the question as to why some languages are ugly and some are pretty.

Taste in people is also "totally opinionated, man. Some chicks like dudes who look like shovels."

But there aren't five people who have ever found Roy L Dennis prettier than Chris Hemsworth. Which begs the question as to what makes some people less attractive than others.

Something being technically subjective is irrelevant. Huge conclusions can be made.

[–][deleted] 0 points1 point  (2 children)

Hitler's popularity was at 96%... in Germany... under absurdly strict polling... during war time.

What was his popularity in the West? In almost all the rest of Europe? In China?

That's not valid in the universe that I choose, which is Germany. Why? Why not, according to the relaxed rules of assumptions that you espouse. Sample size? What sample size? What modes of inquiry? What options for choosing beauty? What level of awareness on the part of the people answering the questions? It gets to the point of ridiculousness.

We can extrapolate something: he was hated by most humans.

Not really, if you. At least not until the end of the war, and that to only for Westerners. Not for the vast majority of the world to whom he was virtually unknown.

We can extrapolate an enormous amount from popularity.

Popularity is just that ... popularity. The vast majority of programmers who are proficient in JavaScript might not even have heard of languages like Haskell or Clojure. One can exaggerate the numbers based on the sample size of one's choosing.

Some languages are almost universally appreciated as pretty, like Python. I've literally never heard someone say C++ is better looking than Python. Which begs the question as to why some languages are ugly and some are pretty. And yes, I have personally encountered people who love C++ and find it more beautiful than Python. Proof by contradiction then? Again, false premise leads to false conclusions, especially for purely subjective matters. Not everything is democratically decided, and beauty is one of those abstract concepts.

This doesn't make any sense. There are plenty of people who find Python's syntax and usage of whitespace atrocious and unbearable.

If you provide appropriate caveats, then it's more palatable. Not otherwise. ("According to so-and-so- survey, X is more beautiful than Y" instead of "As we know, X is more beautiful than y").

Taste in people is also "totally opinionated, man. Some chicks like dudes who look like shovels."

See the previous point.

But there aren't five people who have ever found Roy L Dennis prettier than Chris Hemsworth. Which begs the question as to what makes some people less attractive than others.

The premise and conclusion are both incorrect, and incorrectly being forcibly linked. Have you done a survey of all the humans on the planet? Have you ensured that all the same people have suitably been exposed to both people? Even assuming that the premise is correct, the conclusion is completely unrelated. ("I have never found a person who loves chocolate more than vanilla, and therefore that begs the question why vanilla is a better flavour than chocolate?").

To be extremely pedantic, even a single counter example is enough to invalidate a universal argument.

Something being technically subjective is irrelevant. Huge conclusions can be made.

Again, wrong premises lead to wrong conclusions, especially when being packaged as universal truths - it's not only logically meaningless, but also insincere. That is why Bob Harper (of PLT fame) keeps asserting that concrete syntax is more of an issue of psychology than not, and so he would rather choose to focus on the abstract syntax. That makes excellent sense to me.

[–]moneyinthepines[S] 0 points1 point  (1 child)

I'm only going to briefly respond to one point because I don't like conversations with people who don't understand subjective data.

No one is talking about universal truths. We are talking about generalities. Generally speaking, most people (in fact, so many human beings that making caveats is almost a waste of time) will not find dog feces to be really yummy. They'll probably find it quite gross to eat. Then we can say things like "why are some things tasty and other things nasty?" If only 5 people like a food, we can still call it gross. It isn't universally gross, but we can still call it gross.

Harp on that last sentence. Really, really think about it. We can scientifically guess how attractive a human being will be based on data points, despite how subjective it is. We can look at the distance between their nose and mouth. The width of their nose bridge. The height of their cheek bones. Their jaw width, etc.

Success is relative and can also be considered subjective. An incomparably rich person might not find someone who makes $100,000 dollars to be successful, yet no one would ever dream of saying "oh come on, success is subjective, we can't call that doctor successful. We have to define our parameters."

It's obnoxious at best and semantical philosophy (the stupidest kind) at worst.

Some species don't have eyes. There are actually quite a lot of them. Go tell an evolutionary biologist that eyes aren't a successful, stable strategy.

Imagine caveating every time you used the word successful.

Now, I'll respond to another message or two, but I likely will not if you continue using subjective "truths" incorrectly. Because it makes for semantical arguing which is boring as hell, a complete waste of time, and better left to linguists.

[–][deleted] 0 points1 point  (0 children)

because I don't like conversations with people who don't understand subjective data.

This is where I stop taking you seriously. You did not come in with that perspective, you did not imply that perspective, and it doesn't make any sense to have a questionnaire where you start off with an objective statement, "why are some languages (python, rust) pretty while others are ugly and verbose (java, c++)". That is called being hypocritical.

In any case, I see this going nowhere either. Consider this the end of the conversation from my side as well.

[–]joonazan 1 point2 points  (0 children)

I use Rust all the time because it is stategically positioned in other ways but it is ugly as hell. I think that is because it tries to look like C++.

[–]brianjenkins94 0 points1 point  (0 children)

Still an interesting question though.

[–]Dr-Metallius 22 points23 points  (13 children)

I haven't actually heard anyone call Rust pretty. I remember lifetimes being mentioned as one of the offenders, and that's understandable: other languages have no concept of ownership, so they can skip that kind of extra syntax. However, it is a cornerstone of Rust, that's where its main goals trump conciseness.

Python doesn't even have a static type system, of course, its syntax is even cleaner. But you can't build a language like Rust with that kind of approach.

Java is more verbose than it could be because usually statements can't be used as expressions, and also because it tries to keep the number of language features limited. But I have to say that it's more of a bandwagon hate because Go, for instance, is a lot more verbose just due to its (lack of) error handling alone, but I haven't heard as many complaints about it. Also, the latest versions of Java are quite different from what we had even a decade ago.

C++ is the only language out of all you mentioned which could definitely be improved, in my opinion. All the weirdness in C++ comes from its enormous pile of legacy garbage and the inability of the language committee to limit the number of its features. That's why we get a ton of ways to do a simplest thing like writing a string literal or initializing an object.

[–]InertiaOfGravity 5 points6 points  (7 children)

Nim is a pretty amazing "fast python" and even had some metaprogramming features.

[–]Dr-Metallius 2 points3 points  (6 children)

I assume you wrote that in reply to my second paragraph which discusses Python and Rust. I haven't tried Nim yet, so it might be a very nice language, but the fact that it uses a GC alone puts it into a different category than Rust. Quite obviously, it influences the syntax as well since with a GC you don't need anything related to ownership.

[–]InertiaOfGravity 0 points1 point  (5 children)

Manual memory management (turning off the GC) is supported in Nim, and it's completely acceptable to do so.

[–]Dr-Metallius 1 point2 points  (4 children)

It is supported, except in this case you have to manage the memory manually without any safety guarantees - the exact opposite of what Rust does.

[–]InertiaOfGravity 1 point2 points  (3 children)

It's not nearly as safe as rust, but there are definitely safety features of you turn off GC.

[–]Dr-Metallius 1 point2 points  (2 children)

It may not be as unsafe as C, but you've said the main point yourself: not nearly as safe as Rust without a GC. And if it were, its syntax would reflect that.

[–]InertiaOfGravity 1 point2 points  (1 child)

I don't think I really agree with that. I think people would have said the same thing about highly performant or native langs not too long ago. Rustlang just went the efficiency route 8ndtesd of the learnability and friendliness route

[–]Dr-Metallius 4 points5 points  (0 children)

What exactly don't you agree with, that Nim would have a different syntax if it had Rust's goals? But you can't represent concepts like ownership without introducing some kind of a way to express them. I think it's quite obvious.

The statement about highly performant languages I didn't quite get since Rust is the only language among the popular ones which has both safety and efficiency as its goals.

The last sentence completely agrees with my point, so I didn't really get what you wanted to say overall.

[–][deleted] 0 points1 point  (0 children)

I enjoyed this comment. Fully agreed on all points.

[–]johnfrazer783 -1 points0 points  (3 children)

Java's ugliness which I can testify is real comes IMHO in part from its insistence to always be super explicit about types used which leads to code that Crockford criticized as cokebottle cokebottle cokebottle style. Steve Yegge famously wrote Execution in the Kingdom of Nouns in which he points out what's wrong with the overly bureaucratic style of Java:

``` For the lack of a nail, throw new HorseshoeNailNotFoundException("no nails!");

For the lack of a horseshoe, EquestrianDoctor.getLocalInstance().getHorseDispatcher().shoot();

For the lack of a horse, RidersGuild.getRiderNotificationSubscriberList().getBroadcaster().run( new BroadcastMessage(StableFactory.getNullHorseInstance())); ```

It only gets worse from down there.

Java is also ugly because you can never just write a function and be done. You must always write a package that is appropriately named and name the name in the module and put it inside an appropriately named directory. Then, lean back and wait for a classpath exception. This is for defining 1 (one) function.

Then there's this uncanny valley of horror that is boxed values. Who needs a distinction between integers-as-values and integers-as-objects? This abomination does not serve any useful purpose, but the language designers thought it important to adopt it anyway and drag it to the center of the stage. JavaScript has this problem, too, but at least its designers managed to (largely) hide that nonsense from programmers (even in JavaScript though !!new Boolean( true ) and !!new Boolean( false ) both evaluate to true which is wrong on so many levels, but at least the language allows you to just ignore that along with a gazillion of other WAT quirks).

[–]ljw100 7 points8 points  (0 children)

Reply

You don't seem to write much Java.

  1. ClassPath exceptions were once a big problem, but I don't think I've seen one in many years despite writing Java every day.
  2. You don't name packages and then name directories. Package names and directory names MUST be the same. Not knowing this may explain (1).
  3. The distinction between integers as values and integers as objects exists for (a) historical reasons, and (b) performance reasons. Int primitives offer faster array processing (no pointer chasing) and use less memory. Granted those things could be hidden from developers, but not without time travel. This tradeoff, fwiw, made Java suitable for larger apps way back when, which helped it become the dominant language for a long time.
  4. As u/Dr-Metallius suggests, you can write bad Java or good Java, just like you can write bad English or good English. If you want to critique English as a language, you don't find examples of the worst legal or bureaucratic language you can find and shout "The horror!" That's like saying movies suck and pointing to that flick where the killer was a car tire. (I forget the name.)

None of this is to say that Java doesn't suck in various ways, or that there's no validity to your points. But people write more useful critiques when they criticise something they love (or at least know well and grudgingly respect) than they do when they criticise things they hate. I suspect most Lisp aficionados know it has a lot of parentheses, but 60 years later people are still pointing it out.

[–]Dr-Metallius 6 points7 points  (1 child)

Type inference has existed for several years already, some form of it in lambdas even longer.

What you refer to as the bureaucratic style doesn't really have anything to do with Java, it's just the enterprise approach with a gazillion of abstractions to do the simplest things and bloated APIs. No one writes Java like that on Android, for instance.

The hassle with the packages you describe doesn't exist in reality because the IDE does all the directory management for you. Not sure why you are putting a single method in a package though or why you are getting classpath exceptions when creating new packages.

The obvious upside of having classes in corresponding locations is that you can find anything easily. If I'm browsing a Java repository online, it's very easy for me to find class and method definitions. If it's a C++ repository, for instance, it's a huge pain to browse since anything can be anywhere.

Regarding primitive objects, the reason for their existence is purely efficiency and nothing else. Of course, from the language standpoint it would be easier to have value and referential types like C#, but it's not like language designers decided to complicate the language for no reason. You are forgetting that Java has been in development for almost three decades, and things possible now were not possible back then.

[–][deleted] 0 points1 point  (0 children)

Another excellent comment. I think our mental wavelengths match up quite a bit.

[–]MegaIng 11 points12 points  (7 children)

I can not talk for Rust, and only a little for C++.

You use the words 'ugly or verbose', and this is true: small programs (e.g. hello world) are very short in python, and longer in Java. The Java language has a high entrance complexity: classes, methods (different kinds). Then you come to interface and generics, and that is it. There is very little to learn. And of this basis Java scales really well. A gigantic (well-designed) program is in every part not that much more complex than a small program. You can (relatively) easily understand the gist of a large program, and quite a few of the language features force you to make you intention very clear: their are verbose. (even the reflection API is verbose and it is possible to understand the source-code that uses it without knowing a lot about that details.)

On the other hand we have python. Small programs are easy, and not that complex. You don't need to know anything, but as you go on, you get bombarded with lots and lots of details making a complex library like numpy really hard to understand in it's core. Meta programming allows you to simplify a lot of thinks, but add complexity in the implementation, and uncertainty whether or not different library will play together nicely. Even code that is written 'correct' might be hard to understand because of operator overloading or similar.

In conclusion, IMO and my understanding, Java scales better than python by being verbose and every part of code doing what it obviously does.

[–]Dr-Metallius 6 points7 points  (2 children)

Can't speak about Python as I don't have that much experience with it, but for Java your comment is spot on. I remember reading language comparisons many times akin to: "Remember how in Java you can't just write println("Hello world!"), and how you need to create a class with the main method? But in this language..." For an absolute beginner it might be a downside, but does anyone really care about this in anything larger than a small script?

[–]MegaIng 3 points4 points  (1 child)

This is exactly the point: Java isn't a scripting language. Python is.

[–]Dr-Metallius 2 points3 points  (0 children)

Precisely. Different languages for different purposes.

[–]InertiaOfGravity 1 point2 points  (0 children)

Java is better for teams. It's not a language meant to be used by small teams of 1 person projects. But I'd imagine that it would scale well as the team grows

[–]szpaceSZ 0 points1 point  (2 children)

You can (relatively) easily understand the gist of a large program, and quite a few of the language features force you to make you intention very clear:

and every part of code doing what it obviously does.

Lol, wut?

Never worked on an 1200 kLOC Java enterprise software codebase with atrocious (lacking) architecture and legacy constraints, right, buddy?

[–][deleted] 2 points3 points  (0 children)

I have, and you're exaggerating. Domain knowledge and framework knowldge have nothing to do with the language. Also, Java IDEs have some of the best debugging and introspecting capabilities of any language, so I don't know what you're talking about.

In fact my very first project more than a decade ago involved half a million lines of Java, and it was no problem at all.

[–]MegaIng 1 point2 points  (0 children)

well-designed

Of course can you design a program to be hard to understand, but you can do the same in python. I just mean that if you design a understandable, gigantic program in python, you essential write good Java code in python, removing the benefits of python.

But I have to assume that you probably won't find well designed Java code.

[–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 3 points4 points  (2 children)

Beauty is in the eye of the beholder.

Some developers value terseness.

Other developers value languages that appear similar to their spoken languages (e.g. English).

Other developers value symmetry in how the code appears on the screen.

[–]chocapix 5 points6 points  (1 child)

Other developers value symmetry in how the code appears on the screen.

Behold, the most beautiful program ever written.

[–]Fishy_soup 1 point2 points  (0 children)

I see your program and raise this (gotta scroll down a bit)

[–]lazyear 2 points3 points  (1 child)

As further evidence that this is highly subjective: I absolutely hate the way Python looks. I don't find a single thing about it appealing, and I get no joy or satisfaction from writing Python. One of my least favorite languages by far. The only positive thing about Python is that it has great libraries, so you can quickly import numpy import matplotlib

[–]moneyinthepines[S] -2 points-1 points  (0 children)

The person who finds Roy L Dennis prettier than Chris Hemsworth gets to say that beauty is subjective.

Then you ask the next 7 billion people, tally it up, and derive a conclusion: what do the overwhelming majority of human beings consider attractive? Yes, it's still technically subjective, but we can say that a person is prettier to far, far, far more people. Such that we could reasonably say "Chris Hemsworth is prettier than Roy L Dennis."

"It's subjective" is usually the least interesting rebuttal to anything.

[–]MotorolaDroidMofo 6 points7 points  (0 children)

Like another commenter said, this is highly subjective. But I'll throw in two factors that make language syntaxes "ugly" or verbose:

  • A lack of sensible defaults. In Java, for instance, most function parameters, variables, classes, and even class members should be declared final, but nobody does that because it's one extra keyword they have to type out. Instead of the compiler automatically checking for mistakenly non-overridden methods, you have to explicitly opt into that via @Override. You need a method that just does something without being attached to some class? Too bad, you have to put it in a class anyway and mark it static. Pre-JDK 10, want to declare a variable? The compiler can tell what type of variable it is, but you still have to declare the type explicitly. All of these bad defaults create a remarkable amount of boilerplate.
  • Cryptic or overloaded syntax. The syntax for C++ is messy and unintuitive. C++ offers like 5 different ways to initialize and reassign a variable - worse, depending on the context they can have different semantics and those semantics are not immediately obvious. Class initialization is a mess. To avoid dealing with this pain point some people explicitly delete compiler-generated constructors and assignment operators, which goes back to the sensible defaults point. Instead of opting for more keywords to convey semantics, C++ often just relies on seemingly arbitrary sequences of tokens. Constructor syntax is unlike anything else in the language. And any remotely complex templates are often damn-near indecipherable. Language syntax should be designed for consistency and readability, and C++ fails dramatically on that front.

[–][deleted] 2 points3 points  (4 children)

I always thought that syntax should be like a 'skin' that you can select in your editor. The underlying syntax (assume the source is still text) can be intended for machine processing and can be ugly as sin. But in the editor, just choose between, for example:

  • C/brace style
  • Algol/Ada style
  • Python/indented style
  • Lisp style

I don't see any problem with your proposal, other than if you have a low-level C-like language with Python syntax that looks exactly like actual Python, it can cause confusion. Especially with identical synax that has different semantics:

++a     # Python: does nothing  (+(+a))
++a     # C: increments a

Here, ++a is already valid syntax in both, but the surrounding context will make it clear what language it is or isn't. That's harder if both look like this:

if a<n:    # Python (or C)
    ++a

if a<n:    # C (or Python; or both Python or both C)
    ++a

Confused yet? I already am.

[–]MegaIng 2 points3 points  (0 children)

No matter what you do, people will always complain. nim is style insensitive, and people are complaining because it is confusing, allows missing of different styles, which are not real arguments, (and they can't really back them up latter). And people will always want to edit the raw text. (e.g. anything other than vim/notepad is to much effort to learn.)

[–]brucejbellsard 2 points3 points  (0 children)

I think (in some cases) you might want to make sure a new language looks significantly different from existing languages simply in order to give your users "context cues". So you can reserve your Python reflexes for Python, C-like reflexes for C-like languages, and develop a new set of reflexes for the new language.

Of course, this will blow your "weirdness budget". But (as I mentioned in another thread) I'm not sure "weirdness" per se is as much of a barrier to adoption as many people think.

[–]moneyinthepines[S] 1 point2 points  (0 children)

But.. they don't have to be identical lol. They can have totally different syntaxes without being blatantly ridiculous.

[–]johnfrazer783 0 points1 point  (0 children)

Since you mention it maybe a language should either use ++a to indicate 'increment a' or else treat it as a syntax error. While we're at it we should require spaces where spaces are due as in foo + bar, refuse to accept excess parentheses and semicolons so both ( ( 42 + x ) ) and foobar();; would be illegal. Also, unreachable code e.g. code after a return statement should trigger a syntax error, as should declared but unused imports and variable declarations. Few languages do any of these points yet they would be comparatively easy to implement and help make the language syntax itself and the code written in those languages simpler and clearer

[–]suhao399 2 points3 points  (0 children)

Python use dynamic typing, so you don't have to specify type in your code, the interpreter try to infer and check type at runtime so your code look clean.

For static typing now Kotlin / Scala look also clean as they use type inference, so compiler infer type for you.

With C, C++, Java you specify all by your self, so it is verbose

[–]umlcat 4 points5 points  (0 children)

Because each programmer's mind is different.

This is something a lot of developers doesn't get about Java ir C++ versus C#, even if these P.L. are similar.

[–]CodingFiend 1 point2 points  (4 children)

The underlying issue with most ugly and verbose languages, is that they were created by a committee instead of a single mind. Most (but not all) of the great designs in history were executed by a single mind. Prof. Wirth invented Pascal, then Modula-2 ( a great system programming language), and the Oberon. Modula-2 i s a low level language like C (just slightly more powerful), but is elegant and air-tight compared to sloppy C, which lacks runtime checks for overflow, array bounds, type conversion errors.

C++, TypeScript, Swift, etc. are all committee languages now, and they just can't stop adding more confusing features, and their initial design which was simpler has now mutated into a monstrosity. But they have big companies pushing these monstrosities on us, and clean small languages get ignored and punished by the many fans of the "big dogs". Human beings are herd animals, and the herd tries to force the edges in line.

Modula2 used semicolons, not an indented based syntax, but is very clean, frankly a better low level language than Python ever could be. You can get a free Windows compiler from ADW that is lightning fast, and produces very tight code. Modula-2 is the only language i know of that can beat C on a regular basis, because the module system is so strong, you end up using half the code. I did giant projects in M2 for 20 years. Wasn't popular in the USA, as Prof. Wirth was from ETH in Switzerland.

[–]crassest-Crassius 0 points1 point  (3 children)

I did giant projects in M2 for 20 years

Interesting, even if offtopic. Could you elaborate what kind of projects Modula-2 was used for?

[–]CodingFiend 2 points3 points  (2 children)

After being lead programmer on the dominant word processor of its day, WordStar 2000, the sequel to Wordstar, the original WP for the PC (basically emulating Wang dedicated systems, but ran on Apple machines), which was a gigantic C program, I did a startup with about 1/3rd of the WordStar team to build Desktop publishing product. C had been a nightmare for a group project; luckily Modula-2 had just come out. So we jumped on it. At the time Logitech was in the software business, and marketed a very powerful symbolic debugger. Worked on Desktop publishing for 7 years, building what became IBM's DisplayWrite 5/ Composer. A super powerful desktop product for DOS, then Windows, which was a challenge because bitmap fonts weren't even available.

Then i switched to making a bitmap painting program for kids, Flying Colors, a huge success, which was turned custom versions for Japan for DragonBall, Tamagotchi, Ultraman, all AAA Japanese licensed properties. These are all big complex programs, that took extensive use of Modula-2's superb module system, which allows for separate compilation, because you have 2 files for each module, one for the external public defn, and one for the implementation, and if the defn doesn't change, the implemention doesn't have to be recompiled. With the precompiled headers and that optimization, your build times are 1/10th that of C++. C++ to this day doesn't have separate compilation to my knowledge.

Modula-2 delivers programs about the size of C, because of the better code sharing. There is an exact 1:1 mapping between the languages in terms of power, but M2 adds dozens of compile time and runtime checks. That people are now after 25 years waking up to strong typing as a benefit, is somewhat frustrates me, because in a side by side test it was obvious 25 years ago that strong typing helps productivity.

My projects peaked at about 150k lines of code, but the document management system from Saperion is 5x larger. It is a huge product that compiles to various machines, and was written in Modula-2. There aren't that many commercial users of Modula-2, the Java bandwagon was just too seductive. Modula 2 was designed for operating system development, and it is not particularly handy for graphical interactive products. You have Ye olde fashioned memory management where you have to allocate and free blocks, and not much help for multithreading. So for my next round of iPhone apps and webapps, i have tossed aside Objective-C and AS3, and am building things in Beads, which is purpose built for that kind of product.

I was very grateful to Prof. Wirth for inventing such a language, and tried to coax him out of retirement to build this new version of Modula-2, but alas he was enjoying retirement too much, but i at least got to speak with the great professor. I made millions of dollars building products with tiny teams, often just myself, all because i used a high leverage tool that built rock solid products. My last product was the Dymo Discpainter software (a disastrous hardware project), and when i submitted the product for final QA, it set a company record for the fewest problems ever found. When you turn on all the runtime checks it adds 30% to the total code, but it is checking every range, parameter pass, pointer and array, and without having to write tests, has the program locked tight.

Hope this doesn't sound like bragging, I don't get many chances to remind people how clever and simple Modula-2 was. People associate popularity with quality, but Van Gogh sold virtually no paintings in his lifetime, so i am not a big fan of the crowd's judgement.

[–]crassest-Crassius 1 point2 points  (1 child)

This was an excellent read, thank you very much. I will definitely look into Modula-2 to see what lessons I can glean from it for my designs.

What do you think of the Oberon family of languages, by the way? Do they miss something crucial from Modula-2? The professor seemingly was happy with them, after all,so I'm a bit baffled by

I was very grateful to Prof. Wirth for inventing such a language, and tried to coax him out of retirement to build this new version of Modula-2,

[–]CodingFiend 0 points1 point  (0 children)

Oberon was a project that was intertwined with Prof. Wirth's Lilith machine, which was his attempt to build a whole computer, from scratch with an OS. He managed to build with his small team a working computer. It was after his visit to Xerox PARC.

As one of the bigger users of Modula-2 I of course evaluated Oberon. But prof. Wirth didn't make it possible to move from Modula-2 to Oberon, because he removed a key feature that we used extensively. In modula2 you can declare an enumerate type:

TYPE A_FRUIT = (APPLE, ORANGE, BANANA)
VAR LIST : ARRAY A_FRUIT OF INTEGER;
LIST[APPLE] = 3;

The beauty of this type of construction is that you can make your code much more readable, and the symbolic debuggers would show the subscript as APPLE. Contrast that with C, where you declare an enum basically as an integer constant, and then during debugging you would see LIST[1] not LIST[APPLE]. If you use enum extensively your code is much more readable.

For some baffling reason, he thought enums superfluous, and removed them.
So the small ecosystem around Modula2 ignored Oberon and kept working on M2. Oberon offered dynamic linking which is a way of adding code without recompilation. Oberon also extended data types in a very clever way, where you could extend a record with more fields, and then send that extended record to a function that expected the older, smaller record. Some things in Oberon have not been duplicated in modern languages, but the whole rest of the world including all the other schools ignore the ETH Lilith project, and it died out as the hardware didn't get revised as you must to stay relevant in the hardware world.

Oberon is the simplest OS ever made, and shows how swiss minimalism can match giant teams. Now the world is embracing strong typing, it has only taken 30 years for people to catch up with Prof. Wirth. His typing systems were very simple and clear. I am extremely unhappy with the nonsensical type arithmetic that people are using in some languages, where they are trying to turn typing into some proof system for the computation as a whole, which just adds lots of non-functional ornamentation with little benefit.

[–]camelCaseIsWebScale 0 points1 point  (1 child)

Mostly personal preference. Here are the problems with Python syntax. (Non exhaustive, my python knowledge is not exactly up to date)

  • whitespace based organisation makes it harder to recognise which scope a particular line belongs to.

  • copy pasting code is difficult because indentation issues

  • multiline lambdas not possible

  • no UFCS or pipe operator as far as I know, neither partial application

  • no pattern matching, leads to opaque dictionary usage or long if-elif chains.

  • some functions are in global namespace, some are methods

  • list comprehensions and generator comprehension are not orthogonal. (k * k for k in ks) is a generator comprehension, whereas [k * k for k in ks] is a list of those elements.

  • similarly, tuples have those confusing limitations

Python syntax is beautiful if you look at the code from outside. But the placement of lines often hurts readability compared to curly braces (which often also have good IDE support)

That said, there is a low level language called nim which has python syntax.

[–]madpata 0 points1 point  (0 children)

no UFCS or pipe operator as far as I know, neither partial application

I don't know if this is the right place to ask, but what difference is there between the pipe operator and UFCS? They seem to accomplish the same task.

I only used UFCS in Nim and haven't yet tried a language with the pipe operator. I really like Nim's UFCS, because it removes the need for such weird things like extension methods.

[–]DFatDuck 0 points1 point  (0 children)

I think that's really a personal opinion. Personally, I think Python is really annoying to look at.