This discussion revolves around the evolution of programming languages, particularly focusing on Ruby and Python, and the trade-offs between flexibility, features, and ease of use.
Language Flexibility and Metaprogramming
A core theme is the desire for languages that allow programmers to modify or extend their own syntax and structure, often referred to as metaprogramming. This flexibility is contrasted with more rigid languages.
- "During my first Introduction to Programming course at university, I was taught Java. One thing that I found very troubling is that it wasn't easy, or possible in many cases, to change the programming language. Sure, you can write new functions or methods or classes, but I can't change the keyword for an if-statement. I also remember the TA saying 'why would you want that?' I caught myself thinking 'if we can program a computer, then why can't we program a language?'" (melvinroest)
- "Is a typical response of someone without the background and without the imagination. It may well be, that doing Java-only for too long robs one of both. An alternative response could have been: 'What a fascinating idea! How would you apply that? / What would you do with that?'" (zelphirkalt)
- "However, I'm not a Ruby programmer, all I know is that Ruby has some things that are identical to Smalltalk. But my question to the author would be: if you long for things like keyword arguments, type hints and namespaces why don't you program it in the Ruby language yourself? Or is that really hard, like most other languages?" (melvinroest)
- "There is metaprogramming support in Java, but it's not as inviting and friendly as hygienic macros or Ruby patching. The obvious example is reflection, with which you can do a lot of bizarre things, some of which are useful sometimes." (cess11)
- "I'm guilty of a lot of metaprogramming, hope you forgive me, I am over 40. I think it can be an undervalued super power of the language: something isn't working or you need deeper insight, just break into the innards of any library you're using and insert logging and/or your own code." (jemmyw)
The Challenge of Ecosystem and Tooling
While language flexibility is appealing, the practical adoption and usability of such languages are heavily influenced by their surrounding ecosystem and tooling.
- "The language is the easy part. Getting tool support for your language change is the hard part. Getting the library ecosystem to adopt it is even harder." (lmm)
- "I think that's why extremely flexible languages have seen limited adoption - if your language is more of a language construction kit where everyone can implement their own functionality, everyone has to implement their own tool support (or, more likely, live without any) and there's a limit to how far you can go with that. The best languages find the sweet spot where they give you enough flexibility to implement most reasonable programs, but are still constrained enough that tools can understand and work with all possible code." (lmm)
- "LSP (Language Server Protocol) was the final nail in the coffin of Emacs for me. VSCode was 'good enough' for pretty much every language with LSP at that point, I did't even bother with Jetbrains ides outside of work after that." (theshrike79)
The Value of Stability vs. Evolution
There's a recurring debate about whether languages should prioritize stability and a consistent core, or evolve and adopt new features, even if it increases complexity.
- "Too much change isn't good though. There's value in consistent basics. I've seen people doing things like:\n\n
\n #define BEGIN {\n #define END }\n
\n\nbecause they liked Pascal, and that way lies madness." (dale_glass) - "I still like Ruby. 15+ years in, I find myself in the camp of not wanting it to change. 25 year old me would have been totally jazzed about the addition of namespaces in Ruby 3.5/4.0. 40 year old me wants namespaces to get off my Ruby lawn." (dudeinjapan)
- "What looks like stagnation to Steen is actually [1] Matz’s remarkable foresight that provided stability and developer happiness. Steen’s not wrong that Python evolved and Ruby moved slower, but he’s wrong to call Ruby stagnant or irrelevant." (schappim)
- "My reaction to that part of the post was, “Well, it seems like Python needed to evolve while Ruby was better-designed from the beginning. That’s a failing of Python, not of Ruby.” Language stability is a good thing, which is why I prefer Clojure myself." (drob518)
Typings Systems: Necessity or Overkill?
The addition of type hints and static typing to dynamic languages like Python is a significant point of discussion, with opinions split on whether it enhances or detracts from the language's original appeal.
- "Ruby fully typed would be awesome imo, but I know that goes against a lot of the fundamentals in the language. I just like the syntax and expressiveness of it, but coming from typescript, its just such a bad DX having to work in a large Ruby codebase." (khoury)
- "I'm really charmed by ML style languages nowadays. I think python has built a lot of kludges to compensate for the fact that functions, assignments, loops, and conditionals are not expressions. You get comprehensions, lambdas, conditional expressions, the walrus operator... most statements have an expression equivalent now." (sushibowl)
- "I feel similar about 'weight' in Python. Some people can really overdo it with the type annotations, wanting to annotate every little variable inside any procedure, even if as a human it is quite easy to infer its type and for the type checker the type is already clear. It adds so much clutter and at the end of the day I think: 'Why aren't you just writing Java instead?' and that's probably where that notion originates from." (zelphirkalt)
- "I am not an experienced programmer, but I liked python because of the dynamic typing, but tbh no type hints are a nightmare (as I used to use python). These days I gravitate towards using type hints unless I am using an ipynb because it looks clean, but it can be a little much, it can look quite ugly. Not every usecase needs type hints is what I've learned." (kirurik)
- "I was forced to use Ruby and fell in love with it. It didn't matter what I used as my editor was Sublime. But when VSCode came and language features became democratized, I never touched a type-less language again. Why should someone opt for a language with absolutely no features where one can have autocompletion, typechecking, deep data type exploration, jumping to definitions and implementations? I really think it's a bad choice of Ruby not to care for types." (pmkary)
- "Statically typed languages have always been better. Free IDEs such as Eclipse have been available for a long time. Good JVM languages such as Scala have been available for a long time." (zarzavat)
- "Static type signatures are inevitable. You can see this by how the Ruby documentation has to make up silly adhoc notation like '→ array_of_strings', '→ matchdata or nil' etc." (frou_dh)
- "I love python's typing module. I think it is the single best thing about python and I wouldn't touch python with a pole if it didn't have that module." (nurettin)
- "This article really highlights for me though, how python has very much changed from the language it was even 5 years ago. Initially, the celebrated feature of python was that it allowed easy and fast development for newcomers. There was a joke a long the lines, 'I learned python, it was a great weekend'. As much as I like python's type system (and wouldn't want to see them ever go way!), part of me wonders if moving into a world where hello-world can look like this, is a world where python is no longer the 'lean in a weekend' language:" (benrutter)
- "Typescript is a workaround. It exists because web apps got more complex and browsers only support JavaScript. So developers need to stick to JavaScript, but they need typing, therefore TypeScript has been implemented... The biggest problem we have in software development is not that a language isn’t elegant, or you can’t write some some in 3 instead of 15 lines… the biggest problem is complexity." (ckdot)
The "Joy" and Ergonomics of Ruby
Despite its perceived shortcomings, particularly regarding performance and typing, many users express a deep affection for Ruby's developer experience and expressiveness.
- "The ergonomics of ruby still have me very much liking the language as it fits how I think, but there are a lot of good developments in the usual neighbors, and I see myself picking up both Python and JS ever more for small projects." (manuelfcreis)
- "I love ruby's simplicity when it comes to rapidly prototyping something, and find the wails about production type errors puzzling." (codeduck)
- "I was a full-time Rubyist for a long time... Ruby makes things fun for the programmer. That's the point. It's beautiful to work with, even if it doesn't do all the things that all the coding books and blogs insist I should be ashamed to not have in my language." (PaulRobinson)
- "I think I don't care anymore. I'm just going to accept it for what it is, and lean into. Life's too short for 'shoulds' - I'm just going to like what I like. And I like Ruby." (PaulRobinson)
- "I was deep into rails early in my career. Then I moved on, especially liking typescript. I thought I wouldn't go back. But you don't always get the choice, a great job came up and it was a rails app. I found joy in it again - and I'm still there nearly 10 years on. Ruby feels like how OOP should be, it's so very easy to implement patterns that other languages make verbose and horrible." (jemmyw)
- "Ruby’s priorities (ergonomics, DSLs, stability) are different[2] from Python’s (standardisation, academia/data). It’s a matter of taste and domain, not superiority." (schappim)
- "Ruby has a unified interface for select/map/reduce over all containers. They do lazy calculations if specified. You can chain expressions simply by appending them at the end without scrolling to the back of the expression. That is objectively better than lisp and python." (nurettin)
- "Ruby is a joy to program in. But Python is a workhorse. Ruby is Miata MX-5. Python is Toyota Corolla." (postexitus)
Syntactic Preferences and Readability
Discussions also touch on specific syntactic choices, such as Ruby's use of end
keywords versus Python's whitespace significance, and the impact on code readability.
- "It's the never ending 'end's that bother me about Ruby. ... Clear away all those ends and the program logic pops out. Much fresher!" (wewewedxfgdf)
- "I mean, that's a horrific piece of Ruby that doesn't do much, and you've not indented it properly. Of course you can get all this down to a single line with ; demarcation. And your .each could use { ... } syntax, just like C or Java or... you know, everything else. But sure, whitespace is better, or whatever it is you prefer." (PaulRobinson)
- "I'd love Python if it weren't for whitespace. I wanna cut/paste code into a REPL, and Python makes that difficult." (devoutsalsa)
The "Java-er Mindset" in Python
A notable observation is the influx of developers from Java into Python, who then attempt to apply Java's stricter principles, particularly regarding type annotations, to Python, often to the chagrin of long-time Python users.
- "Many people learn it at university, by using Java, and now think everything must work like Java. I mean, Java is honest about types, but it can also be annoying. Has gotten better though. But that message has not arrived yet at what I call the 'Java-er mindset' when it comes to writing type annotations." (zelphirkalt)
- "Now it seems many Java-ers have come to Python, but without changing their mindset. Collectively they make it harder to enjoy using Python, because at workspaces they will mandate the most extreme views towards type annotations, turning Python into a Java dialect in some regards. But without the speed of Java." (zelphirkalt)