this post was submitted on 16 Jul 2023
474 points (100.0% liked)

Programmer Humor

854 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

No offence

top 50 comments
sorted by: hot top controversial new old
[–] Ret2libsanity@infosec.pub 54 points 1 year ago (3 children)

C is the sniper you don’t see

[–] Maultasche@feddit.de 9 points 1 year ago (1 children)

And just like in Metal Gear, he dies of old age if you wait a bit.

[–] unicorn@mander.xyz 19 points 1 year ago (5 children)

C is old, ubiquitous and still does not have a good replacement for its low-level cross-platform usecases, so I'll believe it when I see it 😄

[–] ursakhiin 8 points 1 year ago (5 children)

Rust is doing a very decent job of low-level cross platform. C just has a very long history.

[–] unicorn@mander.xyz 5 points 1 year ago

Its cross-platform support (not just for using but also for building it) is not there yet, and it is quite huge and unstandardized with only one full implementation. I'd agree the last part will change with age, but given the frequent large changes and feature additions I am afraid it will be harder and harder and it is simply too complex and fast-moving for many low-level applications. It is closer to C++ than C in my eyes. I'd be happy seeing it replace C++ though for its memory safety benefits!

load more comments (4 replies)
load more comments (4 replies)
[–] hglman@lemmy.ml 5 points 1 year ago

C is back at HQ with 2 Stars and enough political capital to serve till they die.

load more comments (1 replies)
[–] Tolookah@discuss.tchncs.de 30 points 1 year ago

C or c++ should be the one in the back, pointing at things...

[–] dontblink@feddit.it 29 points 1 year ago (8 children)

May i ask why everyone hates JavaScript so much? It's not ironic it's a real question, i can't really get it, is it just because it doesn't have types? Or there's more?

[–] oktupol@discuss.tchncs.de 31 points 1 year ago (3 children)

I believe the amount of hate and mockery Javascript receives is heavily skewed, simply because almost every programmer who is active today has at least some experience with the language, and with more users there are also more people capable of complaining about it.

I work with languages that are much worse than Javascript, yet they don't receive nearly as much hate because hardly anyone uses them.

One that comes into my mind is ABAP:

[–] fiah@discuss.tchncs.de 6 points 1 year ago

that's a crime against humanity

load more comments (1 replies)
[–] fiah@discuss.tchncs.de 13 points 1 year ago

it has a lot of cruft and gotchas and lacks a good standard library (which is why npm is a thing). That means there's a lot of bad javascript code out there and a lot of people who have had bad experiences with it. But, if you take care to not shoot yourself with the included footguns and you know your way around npm, it's a perfectly fine language for its purposes in front- and backend development IMO

[–] jjjalljs@ttrpg.network 11 points 1 year ago (2 children)

It has a lot of gotchas and an unstable ecosystem.

A lot of basic stuff is confusing of weird. How do you loop over an object? There's like five ways. How do you declare a function? There are two very different ways that behave differently, and the new one has like five variations in its syntax that can throw you.

Here's an example of something that continues to bother me:

const foo = "hello";
const bar = { foo: "world"}

What do you think bar looks like? If you thought it had a key of "hello" and a value of "world", that's sensible but wrong. It has a key of "foo". Object keys don't need to be quoted in JavaScript. If you want the key to be a variable you have to write it like { [foo] : "world" }. Which looks like a list.

There's a lot of this kind of stuff in the language. Small things that once you know you can work around, but are still weird, annoying, and prone to causing errors.

The standard library historically hasn't been very good. This has lead to many libraries being maintained by the community. But the community is fickle, and the quality of libraries is not guaranteed.

The standard library was bad at some basic operations, so underscore was created. But then someone made lodash, and most people (but not everyone!) moved to it. But then the standard library caught up some more, so maybe you don't need either? When you start working on a new-to-you project you don't know what you're going to get.

Dates were a mess so momentjs got big, but now that's deprecated. Move to datefns, which has a completely different interface.

Node releases a new major version every six months. Every six months! Python has been on major version 3 for years and has no plans for a version 4, for comparison. The constant version releases is a potential source for headaches.

In my experience many libraries are kind of fast and loose with major releases, too. It can be a pain to keep up, especially if you have peer deps.

The debugger is kind of bad. Sometimes it will pause but you typically can't like treat it like a repl. Python's, for comparison, blows it out of the water.

Many things are async in JavaScript. Sometimes you don't expect a particular call to be async or you forget, and you have a bad time. The async/await keywords were a godsend. The giant stack of "then...then...then..." was not fun. Combine with the weak debugger and you have an extra bad time. I bet there are a lot of console.log("code is here") debug calls out in the wild because of this.

For your actual front end view layer, react is the current hotness. But older projects are still out there with angular, backbone, probably some with just jQuery. React isn't terrible but how long is it going to be king? What breaking changes are they going to put out in the next version? The ecosystem is unstable.

Also redux kind of sucks. Not a fan of global variables. I think the community has moved on from redux though? Again, the ecosystem is unstable.

In my experience there are many developers who only know JavaScript, and they want to use it for everything. It is the dungeons and dragons of languages. Much like how it is frustrating when your friends want to run a cyberpunk murder mystery in Dungeons and Dragons, it can be frustrating when your team wants to write everything, even your backend, in JavaScript.

We had browser tests at one job. They're a very synchronous thing. Open the browser, load the page, enter name and password, wait for login. We had all of this written in python working fine, but people wanted to switch to a JavaScript toolset. Sorry, I mean they wanted to switch to JavaScript but there were three different browser testing tools the different teams wanted to use. Because the javascript ecosystem is like that. After a more candid talk with one of the guys I knew personally, he admitted it wasn't because JavaScript was the best tool but rather he didn't want to use python.

I can't authoritatively say this is typical, but in my experience I've had a lot of resistance from JavaScript devs using other languages. Again, I think it's like DND. DND is a unnecessarily complicated game full of exceptions and gotchas. If that's what you learn first, you probably think everything is like that, and why would you want to go through that again? But of the popular languages/games, javascript/DND are exceptional for their weirdness.

In fact, thinking about it for more than a minute, my current team lead is a JavaScript main and he's great. Super willing to learn other languages and has never been pushy. So it's definitely not everyone.

The stack traces tend to be kind of bad. In production shit is probably minified so you might get "error on line 1, column 4737373". In other contexts you may get a few hundred lines of node_modules to sift through before finding your actual code.

At least jest and (react) testing library aren't bad. Mocha + chai were annoying. Enzyme is not great. Again, things change rapidly. You might join a company and find they're still using mocha and enzyme, and switching never gets prioritized. If JavaScript made things better without breaking changes or swapping to an entirely new toolset it wouldn't be a serious problem, but the standard mode seems to be "fuck it let's make an entirely new tool".

The lack of type hints isn't great. You can use typescript but that's a whole new set of stuff you have to set up. Python also doesn't have types but they managed to add them as an option without making us switch to like TypeThon. But that's not the JavaScript way. If you're not making a breaking change are you really doing JavaScript?

I could go on, but my cat is getting up to some bullshit and I need to see what he's screaming about. Probably not JavaScript.

tldr:

  • standard library kind of bad
  • ecosystem unstable and of variable quality
  • unpleasant personal experiences with JavaScript developers wanting to use it for everything
load more comments (2 replies)
[–] masterspace@lemmy.ca 11 points 1 year ago* (last edited 1 year ago) (6 children)

It's wild that Python is getting a shoutout over javascript despite being an even bigger loosely typed mess.

I think it's partially because Python has a reputation as being a serious language for serious people because it's popular amongst data scientists and academics, whereas Javascript is still seen as being popular amongst script kiddies and people building crappy websites for $100 / pop.

That being said, most of the time i hear javascript jokes at work they're pretty tongue in cheek /ironic / the dev isn't really hating on it. I have heard a dev or two make those javascript jokes with a more serious critical tone, and everyone tends to ignore them and not engage because they're pretty clearly just haters who have a general tendency to dislike popular things.

[–] RagingNerdoholic@lemmy.ca 3 points 1 year ago

Python programmers, brace yourself for this...

Oh wait.

load more comments (5 replies)
[–] SolarMech@slrpnk.net 10 points 1 year ago

It has a rocky start, and a lot of cruft from that era sticked around.

There are also a lot of horrible legacy projects from the pre-ES5 era which are a pain to work with. Often older projects were coded either before people knew how to do javascript right, or before the devs who wrote it knew how to write javascript right.

[–] ursakhiin 7 points 1 year ago

I'm a backend engineer. My biggest issue with JavaScript is environments that use it in the backend.

JavaScript is designed to run in a way that continue to try to do things even when it's running in to errors. But it does that because I'm a front end that's what you want. In the front end, working but ugly is better than not working at all. In the backend that can be catastrophic, though.

[–] monk@lemmy.unboiled.info 5 points 1 year ago (1 children)

Let me suggest a simple exercise for you.

  1. Print "Hello world!" to stdout in Javascript.
  2. Show me the standard that guarantees that everything you've used exists and works as intended.

I'll wait.

[–] masterspace@lemmy.ca 4 points 1 year ago (1 children)

Show me the standard that guarantees that everything you’ve used exists and works as intended. I’ll wait.

I think you fail to understand the very basics of web development if you're operating on the assumption that everything you need is always reachable.

load more comments (1 replies)
load more comments (1 replies)
[–] lowleveldata@programming.dev 28 points 1 year ago (5 children)

ah yes programming languages are jokes themselves, and not the programmers using the wrong tools for the wrong job

[–] Kryomaani@sopuli.xyz 6 points 1 year ago (2 children)

While true, there are some languages that are the wrong tool for every job. JS is one of them. I've dreamt of a future where web frontends switched to something sane but instead we got stuff like typescript which is like trying to erect steel beams in quicksand. For web frontends I can understand that historical reasons have lead to this but whoever came up with node thinking JS would be a great backend language has a lot of explaining to do.

[–] lorgo_numputz 4 points 1 year ago

I've commented to my cow-orkers that "Typescript is the bag they put over Javascript's face so you don't have to look at it anymore."

[–] ParsnipWitch@feddit.de 3 points 1 year ago (8 children)

I am also interested if anyone can tell me the exact time in our history when JavaScript turned from "Don't you ever use that anywhere on your websites!" into "It's basically every website".

load more comments (8 replies)
load more comments (4 replies)
[–] Kolanaki@yiffit.net 26 points 1 year ago

"You guys are stupid. See, they're gonna be lookin' for army guys."

[–] nothacking@discuss.tchncs.de 20 points 1 year ago (3 children)

Is python really any better?

[–] ComradeKhoumrag@infosec.pub 12 points 1 year ago (1 children)

Python is as inefficient as js is ugly

[–] LeFantome@programming.dev 6 points 1 year ago

Well done.

That is like a colleague farewell card that says, “Four years already? It seems like only six months with all that we have accomplished.”

load more comments (2 replies)
[–] vrighter@discuss.tchncs.de 17 points 1 year ago (5 children)

python in the same league as cpp, rust and c# is the real joke

load more comments (5 replies)
[–] quadrotiles@reddthat.com 16 points 1 year ago (3 children)

Ok, admittedly I was using typescript but honestly, I really enjoyed using JavaScript. I kinda feel like people who shit on it have never used it much, or aren't very experienced, or it just wasn't to their taste and they're jumping on the hate train that the others like to conduct.

(I also understand this is a joke dw)

[–] gamer@lemm.ee 7 points 1 year ago (1 children)

I kinda feel like people who shit on it have never used it much, or aren’t very experienced

How much experience do you have? (and don't even think about lying; this is the internet)

[–] quadrotiles@reddthat.com 11 points 1 year ago (4 children)

Definitely 2023 years worth of experience. I taught Jesus himself JS. Which, fun fact, doesn't stand for JavaScript, but stands for JesusScript. I would never lie on the internet.

(4ish years lmao)

load more comments (4 replies)
[–] rob64@startrek.website 7 points 1 year ago* (last edited 1 year ago)

It's probably also related to when a person first encountered JS. If you learned it pre-2015—even if you're aware of the changes made in ES6—I can see how it would be hard not to view JS as cumbersome. I personally love to use it, but I can't imagine that would be true without let, const, classes, etc.

Edit also block scoping and arrow functions!

[–] PRIMALmarauder 7 points 1 year ago

My feelings toward JavaScript depend on the context in which I'm using it. I really like JavaScript in a React app or Next.js, but I don't care for it in Views and Razor page in .NET web applications, though it's getting better.

[–] rikudou@lemmings.world 14 points 1 year ago (2 children)

Yeah, gonna have to disagree. If I had to choose between JS and Python, I'd shoot myself in the head.

[–] Llewellyn@lemmy.ml 9 points 1 year ago

So you choose JS.

[–] Valmond@lemmy.ml 7 points 1 year ago (7 children)

Python is cool IMO, got loads of libraries and gets your little app up in notime.

Not for larger projects though.

JavaScript is like the unsafest language I have touched in the last 20 years, yikes!

Still would use it as a web front end instead of python ofc.

load more comments (7 replies)
[–] Rooki@lemmy.ml 12 points 1 year ago

Python is rather the clown. As it is more Scratch than a programming language

[–] WeDoTheWeirdStuff@kbin.social 9 points 1 year ago
[–] Zellith@lemmy.fmhy.ml 6 points 1 year ago (1 children)

Im just over here in the corner trying to learn Java.

peaks through the cheap stand-up office blinders from the C# "office" Can you help me debug something rq?

[–] AnonymousLlama@kbin.social 6 points 1 year ago (1 children)

Every few years I go back to giving JS a chance and every time I'm left frustrated. At least it's not as bad as it was a decade ago I guess

load more comments (1 replies)
[–] LeFantome@programming.dev 6 points 1 year ago (1 children)

PHP is the landmine they are about to step on.

[–] Redrum714@lemm.ee 4 points 1 year ago

Glad C++ will be the one step on it cause it deserves it. I’d take PHP over that shit any day

[–] rms1990@lemmy.ca 5 points 1 year ago

And I'm the smalltalk soldier in my rainbow uni 🌈

[–] akariii@lemmy.blahaj.zone 4 points 1 year ago

non taken (I dislike JavaScript)

[–] Bruce@lemmy.ml 3 points 1 year ago

powershell is litterally out of the picture.

load more comments
view more: next ›