Programming languages, much like the jackass in the middle, are tools. Different tools are for different things. The right tool for the job can make your day. The wrong tool can make you question your entire career.
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
Funny how tools are useful. But a person who is a tool is not.
A tool of a person is a fool who is being used by someone else. They might not be useful to you, but to who ever makes the koolaid they're drinking, they're a very good tool.
Exactly. And what is the best tool? The best tool for the job
And what is the best tool?
AI! (This message brought to you by The Microsoft Marketing Dept.)
That's just not terribly meaningful, though. Was JavaScript the "best tool" for client-side logic from the death of Flash until the advent of TypeScript? No, it was the only tool.
You're halfway there.
Yes, it was the best tool, in context
In that context, what was better?
Sometimes I just want to use a particular tool, and care less what I'm making with it.
I rarely get this pleasure at work.
Almost any language is OK, but Rust is just so, so fucking ugly
Almost any language is ok but some ecosystems make me want to turn into a murder hobo (looking at you, JavaScript).
FORTRAN isn't a beauty either.
And Python is strange as hell with its mandatory tabs.
You can use spaces in Python.
Two, three or four spaces? If you answer wrong I'll never forgive you
Whatever your place defines as a standard. I’ve seen ugly code in C, JavaScript, Java, etc., that uses them all over the place because they’re not mandatory.
If you don’t have consistent indenting, your code looks like copy/paste from several sources; but if you do have consistent indenting, then the indenting of Python is a non-issue.
Per the Linux kernel coding style:
Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.
First off, I’d suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it’s a great symbolic gesture.
Indentation-driven control flow is one of the most cursed things ever invented, excluding things explicitly designed to inflict pain or death.
List comprehensions are much stranger than tabs vs spaces. There are very very very few languages that use them, and python’s is by far the worst out of the popular ones.
what? what part of rust is ugly?
Maybe they're confusing the literal name with the language? Idk.
I grew up on Perl and holy fuck... Rust is fine.
Enums and nested blocks. I understand the importance of Option and Result, but it's fucking infuriating when I have to check and destructure the result of every function call and either bubble the result up the stack from six levels of nested if let blocks or risk Cloudflaring my program by using .unwrap(). And while I like being able to extract a return value from an if...else expression, the structure gets really convoluted when multiple if and match blocks are nested (of course each one returning a value), and it gets completely fucked once closures are introduced.
I like Rust, but calling it pretty is delusional.
Sum types with associated values are worth it
have to check and destructure the result of every function call
Learn how to use enum error types, how error bubbling works, and how to convert between Options and Results.
It's Rust you are talking about, not Go.
I can actually see where this is coming from, as I found Rust hard to read when I started out. I do really like Rust for reference, but I do agree Rust is hard to read for someone that has not learned it.
For example:
return statements that are implicit just because the semicolon isn't there. Even better if they occur inside a if block or something like that. Very hard to understanding when you don't know the syntax rules.
Lambda functions, especially when using move semantics too. They are quite simple, but if you don't know the meaning, it's more arcane characters. Especially when this is used inside lots of chained methods, and maybe a multi-line function in the lambda.
A lot for the if let x =... type of stataments are tough the first time around. Same for match statements.
Defining types for use with function::() and such.
Lifetimes, especially when they are all named a, b, c etc. It quickly gets messy, especially when combined with generics or explicitly defined types.
Macros, though not entry level rust to begin with, they are really cumbersome to decode.
None of these are sins of Rust, but for new people they are a hill to climb, and often hard to just "get" based on previous programming experience and reading the code. Rust can be really hard to approach because of these things. This happens in other languages too, but I do feel Rust has a particularly large amount of new concepts or ways to do something. And this is on top of learning lifetimes and borrow semantics.
This is the most sober take in this thread. I was bothered by all these things you mentioned for the first two weeks of using the language. I begrudgingly accepted them for the following two months because I felt the benefits of the language were worth it. Now all of these things feel natural and I don't give them a second thought.
Go look at that Lisp kojumbo then tell me Rust is ugly.
(defmethod wake ((object magic-packet) address port)
(let* ((payload (encode-payload object))
(size (length payload))
(socket (usocket:socket-connect nil nil :protocol :datagram :element-type '(unsigned-byte 8))))
(setf (usocket:socket-option socket :broadcast) t)
(usocket:socket-send socket payload size :host address :port port)
(usocket:socket-close socket)))
Actually unreadable.
Maybe Emacs has fried my brain, but that is perfectly readable. Common Lisp has one of the most advanced object systems around, so yea you can write hard to read stuff if you want
One of the reasons i find it so hard to use non-Rust languages is how ugly they typically are by comparison. "fn" instead of "function" is such a great example of saving key presses where they're most needed. And you get very used to seeing compact abbreviations. Idk if that's what you're talking about though.
The programming language promotes a thinking model and the ecosystem defines a modus operandi.
Of course they matter.
The language is as important as architecture and stuff.
Pick the right language for the right task.
Performance? Don't use python.
Everything else? Use python because everyone does.
/s
I like using python just cuz I can quickly get it working. I wish I had the time to undust C and try getting that to do what I want but my work cares more about iteration and speed to implement than speed of the program itself.
This is pretty smart for the left guy. He's usually down at the level of "HTML is a programming language" or "What's a programming language?".
That said, the first one of those isn't mutually exclusive with what he says in the meme.
It mostly reflects my own story. From a beginner enthusiast of multiple "cool" languages (Scala was all the rage back then), through considering myself more "mature" and thinking about business priorities, ending at understanding that using a good programing language is a business priority.
If the team works with a language they enjoy, they will be happier (and more productive). Doesn't even matter if the code is written by humans or machines.
I'm only a hobbyist no skin in the game but as an engineer first programmer second I feel like how you design the architecture of your logic and how you choose to prioritize computational optimization or feature implementation have a much bigger impact than language. Obviously theres a time and place like using luajit instead of lua if you really need that speed boost, but in big complex programs I'm willing to bet lazy programmers skip optimization steps and copy paste thousands of lines to ship quickly regardless how performance optimized the underlying language is.
I make a module that does a specific thing for version 1, after initial bug patches and maybe a feature addition theres usually an epithany that the logic can be generalized into an api type registry structure that allows the code to be reused and configured as needed on per item basis. Along the way you do stuff like ask what the not expensive calls are, add accumulator timers to reduce unneeded CPU usage , ensure early returns are up top when it makes sense, choosing to render a cleverly crafted sprite instead of a full 3d entity.
A conditional if then logic loop Is a logic loop no matter what Turing complete language its written in. What really matters is how you use the loop not which syntax its written in.
Any function can be written in any Turing complete programming language. That doesn’t mean a sane person would use malboge or brainfuck for a production system. Language choice can have a huge impact on productivity and maintainability and time is money.
