6 ms·
I Probably Hate Writing Code in Your Favorite Language
- echelon 2y ago> 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.
- JohnFen 2y agoJust to prove the thesis of the title, I really hate writing code in Rust.
- vips7L 2y agoYou could not pay me to write Rust for a living.
- JohnFen 2y agoI learned Rust to the point of competency (but I'm certainly not at the point of proficiency) because it seems likely that knowing it will be helpful in terms of career development. But I have decided that I hate it enough that I wouldn't accept a job that required me to do much with it. I would be unhappy in such a position. It's an unusual stance for me to take -- I am proficient in a number of languages that I'm not that keen on, but can tolerate them for a paycheck. For whatever reason, Rust is an exception. I'm not sure why.
- vips7L 2y agoPersonally I don't think it will be helpful for career development. I'm never going to work in a space where Rust will be useful and it would probably be a mistake to choose it. But I'm just a Java dev /shrug.
- JohnFen 2y agoI consider it important to my career to be sure my skillset doesn't get stale[1]. I don't bother to learn everything that comes down the pike (who could?), but I do keep an eye on things and if it looks like something might end up being in demand, I'll learn it. I don't always forecast correctly, of course. But I'm a programming polyglot. Learning new languages is pretty easy (if you already know the paradigm of the language, then it's just a matter of syntax), so why not? [1] It's important to me mostly because learning a new language or other skill often gives me a new understanding or insight into programming overall. Also, having a wide skillset makes me qualified for a wider selection of jobs, making it more likely that I can find one that excites me in some way.
- daghamm 2y agoYet most of those are written in Go. In fact, the majority of the devops tools themselves (podman, k8s, etc) seem to be written in Go. Why do you think that is?
- Jtsummers 2y ago> Yet most of those are written in Go. In fact, the majority of the devops tools themselves (podman, k8s, etc) seem to be written in Go. > Why do you think that is? Because time travel, as far as we can tell, is not possible. At least in the case of Kubernetes, Rust 1.0 wasn't even around until the year after it was first released (Kubernetes 2014, Rust 1.0 2015). It also came out of Google and Go was one of its blessed languages at the time (and today). Given Rust 1.0 wasn't out yet, I'd be surprised if it got more than five seconds of consideration by the team developing Kubernetes, if it was even on their radar at the time they started development.
- behnamoh 2y agoIMO it's because boring, predictable, un-exciting tech often gets the job done, while shiny, exciting, enjoyable tech gets the job done less.
- Jtsummers 2y agoIt's fair to have an opinion, and that may be why Kubernetes hasn't been rewritten in Rust, but I answered the question of why it wasn't written in Rust. It wasn't an option at the time (again, time travel is not possible).
- thowruasdf 2y agoThis is a myth pushed by the "Choose Boring Technology" cult [1] and proven false by Google [2]. [1]: https://boringtechnology.club/ https://boringtechnology.club/ [2]: https://www.ardanlabs.com/news/2024/rust-at-google https://www.ardanlabs.com/news/2024/rust-at-google
- gregors 2y agoK8s was absolutely built using exciting tech....Golang was hot off the presses. The brand new hotness. Google's internal Borg was C++, so the boring choice was C++ which wasn't chosen. Also they were google employees, which also adds a bit of bias in selection I would imagine.
- jmclnx 2y agoI 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.
- ocular-rockular 2y agoWhat languages are they? As an academic, I am curious because I have languages that I hate that blissfully unaware academics use...
- jmclnx 2y agoOne is COBOL, worked on that in the 80s. The other is c, which I went to in the 90s, that seemed to have started getting hate from everyone these days :) I prefer the K&R dialect is the version I started with.
- JohnMakin 2y ago> The other is c, I struggle to take anyone very seriously that expresses a profound negative opinion about C - it is still so ubiquitous and odds are overwhelming that the person expressing this uses somewhere in their stack many libraries written in C anyway. I'd wager this is coming from the Rust ecosystem rising in prominence the last 10 years and Rust adherents being really passionate about that (cool! I take no opinion either way, please don't savagely downvote me). I find all such debates tiresome, I am much more interested in the why of doing something than the "how." A programming language is a tool to me, nothing more. If the tool sucks I will choose a different one and probably feel zero emotions about it, but acknowledge not everyone is this way.
- mnk47 2y ago>I struggle to take anyone very seriously that expresses a profound negative opinion about C - it is still so ubiquitous and odds are overwhelming that the person expressing this uses somewhere in their stack many libraries written in C anyway. I like C, and I do think the hate mostly comes from the loud zealots in the Rust crowd, but this doesn't make sense to me. I hate car-centric planning, the fact that it's ubiquitous and that I drive around my city doesn't really affect the validity of my opinion.
- whalesalad 2y agoThis 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
- IshKebab 2y agoWell the syntax certainly fights you the whole way...
- whalesalad 2y agoHow?
- IshKebab 2y agoThe entire language is statement based, not expression based. Lambda functions are limited to a single expression. Weird special snowflake syntax for if expressions and array comprehension. Etc.
- jasonjmcghee 2y agoI would argue the functional approach is (copying your data structures): def winning_team(game_log: GameLog) -> Team: return max( get_teams(game_log), key=lambda t: get_points(game_log, t) )
- whalesalad 2y agoI think this is a very unproductive and pedantic take of functional programming. Inside the function, all things being equal, the implementation isn’t important. The important thing is that it’s isolated, self contained and does not perform I/O
- zck 2y ago
- spicyusername 2y agoI 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...?
- DarkNova6 2y agoIt strikes me that some people think in data, others in processes. Personally, I need transparency and understand everything step by step. But there are those that threat a function/process like a blackbox and just build pipes based on some defined axiomes. The latter also seems to do quite well in math.
- utensil4778 2y agoI like OOP precisely because you can just treat any object like a black box. You don't need to fully understand what the object does at all times. The way my brain works is by turning all problems into spatial problems. Programs take the form of a large graph with a function or other operation at each node. Generally, I'm modeling data flow through the graph. I can keep a fair amount of detail associated with any node, but it takes effort. There's a lot of information floating around. OOP just kind of naturally falls out of this kind of thinking. By collecting parts of the program into discrete objects that do their own thing, large parts of the graph can be collapsed into a single node. Data flows into an object, data flows out. No need to spend the mental effort of knowing what happens inside the box. I can just simply trust that I wrote an object to do what it says it does. Of course this approach often fails and I have to be much more thorough. If I can focus on a small section of the program, the graph becomes almost an arbitrary syntax tree. The past couple of weeks I've been way in the weeds with a microcontroller. At some point I've started modeling parts of the program in terms of assembly instructions and CPU implementation details.
- 2y ago
- behnamoh 2y agoif {"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"}
- bazoom42 2y agoTwo 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.
- deleted 2y ago[deleted]
- yr_robot_master 2y ago> 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.
- trealira 2y agoThis compiles in C++: int foo(const int &x) { int &y { const_cast<int &>(x) }; y += 1; return y; } It may invoke undefined behavior if the original int was declared const, but this still compiles with no warnings on GCC with -Wall -Wextra. It may be really bad style, but not mutating const references is not enforced by the compiler. Hence you aren't guaranteed that your const references actually stay unmodified if you pass them to a function.
- suby 2y agoI 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.
- desumeku 2y agoWhen the URL is "lambdaland.org", I'm hardly sure this article even needs to be written.