this post was submitted on 28 Nov 2024
466 points (88.6% liked)

Programmer Humor

32739 readers
631 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] masterspace@lemmy.ca 112 points 4 weeks ago (15 children)

Lmao, bruh. How do people keep praising a language where messing up a space breaks everything and there is no real type system?

[–] jedibob5@lemmy.world 75 points 4 weeks ago (3 children)

The whitespace doesn't bother me. Any IDE worth a damn will manage that for you. As for the type system, yeah, I strongly prefer static typing, but for simpler projects I can see the convenience of it.

My real issue with Python comes with managing a development environment when multiple developers are working on it. Dependency management in Python is a headache, and while in theory, virtual envs should help with synchronizing environments from machine to machine, I still find it endlessly fiddly with a bunch of things that can go wrong that are hard to diagnose.

Python is great for small scripts, proofs-of-concept, and such, but I wouldn't write anything more heavy-duty than that in it.

[–] eager_eagle@lemmy.world 19 points 4 weeks ago (5 children)

You can totally write heavy duty things if you know what you're doing: use type hints, static checkers, tests, etc. It just takes a bit more effort and care.

[–] ByteJunk@lemmy.world 17 points 4 weeks ago (2 children)

But why would I use something that takes more effort and care?

I'm sure you're right and it's possible, but if I don't have to fix another python project at work I'll be in heaven.

[–] grue@lemmy.world 18 points 4 weeks ago (1 children)

Because "more effort and care" in Python is still way less of a pain in the ass than the minimum enforced boilerplate necessary in most other languages.

[–] ChairmanMeow@programming.dev 7 points 3 weeks ago (3 children)

I mean, is it? I personally haven't found Python using much less boilerplate. It's possible, but you end up with something inflexible that's hard to maintain.

load more comments (3 replies)
load more comments (1 replies)
load more comments (4 replies)
[–] masterspace@lemmy.ca 9 points 4 weeks ago* (last edited 4 weeks ago)

Yeah, working on python projects professionally is always a nightmare of configuring env variables and trying to get your system to perfectly match the reference dev system. I find Node.js projects to often be the simplest and most pain free to setup, but even compiled languages like C# and Java are often easier to get up and going than python.

[–] morrowind@lemmy.ml 9 points 4 weeks ago (1 children)

Any IDE worth a damn will manage that for you.

Yeah in like 10% of cases. I'm copying something from a pdf my prof gave. The only ones able fix spacing now are me and God

load more comments (1 replies)
[–] riskable@programming.dev 20 points 4 weeks ago* (last edited 4 weeks ago) (6 children)

Haha: "A space breaks everything." Fuck YES! Are you kidding me‽ It's one of the best features!

Why? Because it's so easy to see. In other languages you've got semicolons which are surprisingly difficult to notice when they're missing. Depending on the situation (or if you're just new to programming) you could spend a great deal of time troubleshooting your code only to find out that you're missing a semicolon. It's frustrating and it makes you feel stupid which is never a good thing for people who are new programming.

Types are in a different category altogether with seemingly infinite reasons why you'd want a feature-rich, low-level type system and also why you'd want to avoid that.

IMHO, the point of Python is to be a simple language that's quick to write yet also very powerful and speedy when you need it to be (by taking advantage of modules written in C or better, Rust). If it had a complex type system I think it would significantly lower the value of the language. Just like how when I see an entire code repo using Pydantic and type hints everywhere it makes the code unnecessarily complex (just use type hints where it matters 🙄).

I'm not saying using type hints on everything is a terrible thing... I just think it makes the code harder to read which, IMHO defeats the point of using Python and adds a TON of complexity to the language.

The promise of type hints is that they'll enable the interpreter to significantly speed up certain things and reduce memory utilization by orders of magnitude at some point in the future. When that happens I'll definitely be reevaluating the situation but right now there doesn't seem to be much point.

For reference, I've been coding in Python for about 18 years now and I've only ever encountered a bug (in production) that would've been prevented by type hints once. It was a long time ago, before I knew better and didn't write unit tests.

These days when I'm working on code that requires type hints (by policy; not actual necessity) it feels like doing situps. Like, do I really need to add a string type hint to a function called, parse_log()? LOL!

[–] masterspace@lemmy.ca 27 points 4 weeks ago* (last edited 4 weeks ago) (5 children)

I don't mean this insultingly because lots of programming jobs don't require this and for the ones that do we still tend to all start here, but in all honesty this sounds like it's coming from someone who's never worked on a large project maintained by multiple people over time.

First of all, the hysteria over semicolons is ridiculous when JavaScript, Typescript, C#, Java, Go, Swift, etc. etc. wil all automatically highlight missing semicolons, if not automatically insert them for you when paired with an IDE and standard linter. On top of that, JavaScript and Typescript do not require semicolons at all, but they are still used alongside braces, because they make your code more scannable, readable, and moveable.

Secondly, without type safety your code is no longer predictable or maintainable. If you're working to quickly sketch out some new fangled logic for a research paper it's one thing, if you need to write test code so that your codebase can be tested an infinite number of times by other coders and whatever CI/ CD pipelines to make sure that nothing's broken, then all of the sudden you start seeing the value in strict typing.

Honestly, complaining about type safety adding "extra code" is a complaint that almost every coder has when they start out, before you eventually realize that all that "extra code" isn't just boiler plate for no reason but is adding specificity, predictability, reusability, and maintainability to your code base.

When defining types looked like this it was one thing:

String name = new String("Charles Xavier");

But when it looks like this, there's no reason not to use strong typing:

const name = "Charles Xavier";

[–] kameecoding@lemmy.world 24 points 4 weeks ago (1 children)

Anyone who thinks a strong type system is a drawback has never worked on any real project where you actually have to collaborate with others.

load more comments (1 replies)
[–] Ephera@lemmy.ml 8 points 4 weeks ago (2 children)

Yeah, the alternative to static typing is to write tons of unit tests, which definitely adds a lot more code to your codebase.

load more comments (2 replies)
load more comments (3 replies)
load more comments (5 replies)
load more comments (13 replies)
[–] kittenzrulz123@lemmy.blahaj.zone 75 points 4 weeks ago (11 children)
[–] DannyMac@lemm.ee 42 points 4 weeks ago (2 children)

Jesus Christ! No thanks! I can't imagine improperly placing cabinet knobs on closet doors like that

[–] KamikazeRusher@lemm.ee 16 points 4 weeks ago

I already hate that style of door but the knobs make it even worse

load more comments (1 replies)
[–] Prunebutt@slrpnk.net 16 points 4 weeks ago (1 children)

Is the archinstall script not working?

load more comments (1 replies)
[–] QuazarOmega@lemy.lol 10 points 4 weeks ago

Pink Fedora logo is class

load more comments (8 replies)
[–] jia_tan@lemmy.blahaj.zone 42 points 4 weeks ago
[–] fauxerious@lemmy.world 38 points 4 weeks ago (5 children)
load more comments (5 replies)
[–] bappity@lemmy.world 35 points 4 weeks ago (2 children)
load more comments (2 replies)
[–] fl42v@lemmy.ml 34 points 4 weeks ago (4 children)

I've learned python after CPP... And I can't #even remember all the cases when I thought "damn, I wish I could've just used pointers"

[–] tiefling@lemmy.blahaj.zone 16 points 3 weeks ago (1 children)

I've been in industry for a decade, big tech for over 6 years. And I STILL fucking hate Python. I can write in it, but everything about it just feels wrong

load more comments (1 replies)
[–] paris@lemmy.blahaj.zone 12 points 3 weeks ago

Might I introduce you to the wonderful language known as Nim? Python-like syntax, compiles to C, C++, and even JS, has mature libraries and good tooling, and some memory safety features built in! And yes, you can use pointers!

[–] Treczoks@lemmy.world 8 points 3 weeks ago

Even our C++ guys won't touch my C code with all the pointer tricks and unions used for hidden castings. Whimps!

But python has worse problems than lacking pointer. Have you ever copied a piece of code from an external source into a python source? It really can f-ck up everything if one has tabs and the other has spaces.

load more comments (1 replies)
[–] independantiste@sh.itjust.works 19 points 4 weeks ago (10 children)

Every time I use python it makes me want to throw my computer through my window. Doesn't happen with other languages. Pip fucking sucks it seems like every time I want to install dependencies for a project there is one that throws a compilation error when installing it. Like, why does it not try to download the version of the package that works with my version of python?? It doesn't even tell me why it failed!!!

[–] Swedneck@discuss.tchncs.de 8 points 4 weeks ago

i still do not fathom what on earth you people are doing to get these issues.
The worst annoyances i've had with python is just running the correct commands to install stuff, which is no different from working with git.

load more comments (9 replies)
[–] kameecoding@lemmy.world 19 points 4 weeks ago (5 children)

Java is in a completely different leagues to the rest of these.

Whatever you think Java sucks at, the other languages mentioned here suffer from much worse.

[–] a_baby_duck@lemmy.world 18 points 4 weeks ago

A language is only as enjoyable as the hellish legacy projects that you'll actually spend your time maintaining.

[–] knexcar@lemmy.world 10 points 4 weeks ago (1 children)

That’s why the Java programmer looks happier in the “after” pic. Not as much as Python but it’s still there.

[–] mosiacmango@lemm.ee 10 points 4 weeks ago (1 children)

The jpeg is strong, but if you look closely she is covered with scabs and sores.

load more comments (1 replies)
load more comments (3 replies)
[–] racketlauncher831@lemmy.ml 18 points 4 weeks ago (1 children)

Let me guess. Are the Java and Python programmers happy after because they leave up their technical debt for someone else to resolve? 🤭

load more comments (1 replies)
[–] boredsquirrel@slrpnk.net 18 points 4 weeks ago (1 children)

Cobol

💰💰💰💰💰

[–] lud@lemm.ee 8 points 4 weeks ago
[–] ChickenLadyLovesLife@lemmy.world 16 points 3 weeks ago (4 children)

Y'all need Qt Creator: C++ for under the hood and Javascript for the UI. Virtually nonexistent base of coders who can do both competently and if you're not careful you end up moving to Finland because of it.

load more comments (4 replies)
[–] SpaceNoodle@lemmy.world 11 points 4 weeks ago

You can't see the C one because it went by too quickly.

[–] Eiri@lemmy.ca 11 points 4 weeks ago (1 children)

Python managed to turn me away before I wrote a single line of code.

Running an already functional project took me nearly two hours and three separate tutorials.

[–] yetAnotherUser@discuss.tchncs.de 17 points 4 weeks ago (1 children)

What's so difficult?

import project as p

p.run()
[–] Eiri@lemmy.ca 13 points 4 weeks ago (4 children)

Hmm, I follow the package's readme and only get invalid command errors.

Gotta install the pip dependencies.

Oh but first you need to create a venv or everything will be global. Why isn't that local by default like with npm? Hell if I know!

Ah but before that I need to install the RIGHT version of Python. The one I already have likely won't do. And that takes AGES.

Oh but even then still just tells me the command is invalid. Ah, great, I live CLIs. Now I've gotta figure out PATH variables again and add python there. Also pip maybe?

Now I can follow the readme's instructions! Assuming I remember to manually open the venv first.

But it only gives me errors about missing pieces. Ugh. But I thought I installed the pip dependencies!

Oh, but turns out there's something about a text file full of another different set of dependencies that I need to explicitly mention via CLI or they won't be installed. And the readme didn't mention that, because that's apparently "obvious". No it's not; I'm just a front-end developer trying to run the darn thing.

Okay. Now it runs. Finally. But there's a weird error. There might be something wrong with my .env file. Maybe if I add a print statement to debug... Why isn't it showing up?

Oooh, I need to fully rebuild if I want it to show up, and the hot reload functionality that you can pass a command line argument for doesn't work... Cool cool cool cool.

load more comments (4 replies)
[–] JackbyDev@programming.dev 10 points 3 weeks ago (1 children)

If Python has no haters I'm dead.

[–] Yawweee877h444@lemmy.world 8 points 3 weeks ago (1 children)

I fucking hate python. Fuck your stupid tabs/spaces bullshit.

load more comments (1 replies)
[–] LambdaRX@sh.itjust.works 10 points 4 weeks ago
[–] tunetardis@lemmy.ca 9 points 4 weeks ago (2 children)

I can't speak for others, but the python3 transition wiped the smile off my face for awhile there.

[–] riskable@programming.dev 13 points 4 weeks ago (1 children)

Why? The most annoying thing that I remember about it was popular modules that hadn't been ported yet. In essence, a temporary problem; growing pains.

The Unicode/string/bytes changes were welcome (to me). But that might just be because I had actually encountered situations where I had to deal with seemingly endless complexity and ambiguity related to Unicode stuff and encodings. Python 3 made everything much more logical 🤷

load more comments (1 replies)
load more comments (1 replies)
[–] gofsckyourself@lemmy.world 7 points 3 weeks ago (6 children)
load more comments (6 replies)
load more comments
view more: next ›