July 1st, 2024

I Probably Hate Writing Code in Your Favorite Language

The author critiques popular programming languages like Python and Java, favoring Elixir and Haskell for immutability and functional programming benefits. They emphasize personal language preferences for hobby projects, not sparking conflict.

Read original articleLink Icon
I Probably Hate Writing Code in Your Favorite Language

The article discusses the author's frustrations with popular programming languages, highlighting issues with Python, Java, Go, and others. The author prefers languages like Elixir and Haskell due to their emphasis on immutability, enabling local reasoning and easier debugging. They express a preference for functional programming, citing benefits such as dynamic typing, structural typing, functional data structures, and powerful macros. The author enjoys programming in Racket, Haskell, Elixir, and Rust for their respective strengths in flexibility, type system, functional data structures, and metaprogramming capabilities. The article concludes by clarifying that the critique of languages is not meant to incite a flame war but rather to express personal preferences for more suitable languages for hobby projects.

Related

The Prototype's Language

The Prototype's Language

The evolution of programming languages in payments technology sector is discussed, highlighting the shift from COBOL to Java and now to Python for its speed and adaptability. Language choice impacts developers and work quality.

Elixir Gotchas

Elixir Gotchas

The article highlights common pitfalls in Elixir programming, including confusion between charlists and strings, differences in pattern matching, struct behavior, accessing struct fields, handling keyword lists, and unique data type comparisons.

Elixir for Python Developers

Elixir for Python Developers

This comparison delves into Python and Elixir, emphasizing syntax disparities and distinctive traits. Elixir prioritizes immutability and pattern matching, while Python focuses on object-oriented elements. Both share list comprehensions and parallel processing, yet Elixir's functional approach and pattern matching distinguish it. Elixir's Stream module supports lazy operations for big data, contrasting Python's I/O streams. Python developers can benefit from exploring Elixir.

Elixir for Humans Who Know Python

Elixir for Humans Who Know Python

The article explores transitioning from Python to Elixir, emphasizing Elixir's concurrency, Phoenix framework, LiveView feature, immutability, and pattern matching. It compares Elixir's functionalism and control flow to Python, showcasing Elixir's efficiency for web development.

Weekend projects: getting silly with C

Weekend projects: getting silly with C

The C programming language's simplicity and expressiveness, despite quirks, influence other languages. Unconventional code structures showcase creativity and flexibility, promoting unique coding practices. Subscription for related content is encouraged.

Link Icon 10 comments
By @spicyusername - 5 months
I see this persona a lot.

Functional programming just has something magical about it that really draws certain kinds of people in.

I wonder if it has to do with the fact that, when you play inside the boundaries of what a functional programming language can do, everything feels so neat. So tidy. Like a game. Or using lego bricks. It almost feels insane to do things any other way.

But then again, most problems live in the real world, where things are not neat, or tidy, or like a game. I wonder if this is why you tend not to see functional programming languages more broadly used...?

By @bazoom42 - 5 months
Two very different things:

The language I would like to write in.

The language in which I would like to debug and maintain code written by someone else.

By @suby - 5 months
I read a lot of articles like this, and it's usually mentioned that their preferred language is expressive. Here it's mentioned as a dig against the top 10 languages, basically saying that they lack expressivity

> make the language and syntax as simple as possible, and then even simpler at the expense of expressivity

I understand why people say this because you can write these small highly condensed statements which would take a lot of code otherwise to do. I think it's probably the wrong word though. These languages generally prevent you from manually managing memory, which ironically makes expressing some designs or patterns impractical. If you want to express say writing a performant garbage collected language or something, a language like c or c++ is ironically more expressive than these other higher level functional languages with a runtime gc.

By @echelon - 5 months
> Other languages I enjoy include Haskell, Elixir, and Rust. [...] Rust is great because it has a phenomenal type system with good type inference; it’s metaprogramming story could be improved though.

I agree with the author about Rust in that it has a beautiful and expressive type system. The fact that it can be used for systems programming, has a modern package system, and can be deployed as a single static binary are bonuses.

Rust is a perfect little Go/Java replacement for microservices and web servers.

By @whalesalad - 5 months
This is more of a style thing than anything else. Nothing stopping you from writing Python in an idempotent and functional style. I do it all the time.

    def winning_team(game_log: GameLog) -> Team:
        team_a, team_b = get_teams(game_log)
        points_a = get_points(game_log, team_a)
        points_b = get_points(game_log, team_b)
        
        return team_a if points_a > points_b else team_b
By @jmclnx - 5 months
I fully agree, you will hate my 2 favorite languages. One of them has received a lot hate over the many decades from almost every academic person. The other one has only started getting hate over the past 10 years.

FWIW, I do not like any OO languages at all.

By @behnamoh - 5 months

    if {"Bjarne Stroustrup: 

        There are only two kinds of languages:
        the ones people complain about and
        the ones nobody uses."} == True &
        {"Your favorite programming language is probably used a lot"} == True then:

        return {"Must hate and complain about your programming language"}
By @desumeku - 5 months
When the URL is "lambdaland.org", I'm hardly sure this article even needs to be written.
By @yr_robot_master - 5 months
> I could tell similar stories for other languages that I don’t like programming in. These languages include JavaScript, Go, Java, and C++.

...

> The thing I hate about all of the languages I listed is their emphasis on mutation. When I call a function and pass it a list or object or whatever, I have no guarantees about that thing’s value when the function returns.

This is not true for C++, where the 'const' keyword allows you to disallow mutation. Perhaps the author would complain that this behavior isn't the default, but the functionality exists.