this post was submitted on 16 Sep 2024
1 points (100.0% liked)

Programmer Humor

19630 readers
1217 users here now

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

founded 1 year ago
MODERATORS
 
top 27 comments
sorted by: hot top controversial new old
[–] JATtho@lemmy.world 1 points 2 months ago* (last edited 2 months ago)

Python is just a pile of dicts/hashtables under the hood. Even the basic int type is actually a dict of method names:

x = 1
print(dir(x))
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', ... ]

PS: I will never get away from the fact that user-space memory addresses are also basically keys into the page table, so it is hashtables all the way down - you cannot escape them.

[–] lkdm@programming.dev 1 points 2 months ago (1 children)

I find Python easy to just code a prototype with. But I find Rust easier to get right.

[–] elliot_crane@lemmy.world 0 points 2 months ago (1 children)

This is basically what I’ve been telling people for years. Prototype in Python to get the concepts down, then when you’re serious about the project, write it in a serious language.

[–] Swedneck@discuss.tchncs.de 1 points 1 week ago* (last edited 1 week ago)

python is IMO the closest thing we have to a platonic ideal scripting language: it's pseudocode that actually runs and you can just slap together libraries with minimal mental effort until it works.
Great for gently getting into programming so you quickly see results without having to learn arcane incantations, and for writing small tool programs; not so great for writing a kernel in.

Python 3.13 is adding support for removing GIL, via PEP 703

[–] oce@jlai.lu 1 points 2 months ago* (last edited 2 months ago) (2 children)

Some people think that because Python is the easiest language to learn, it's going to be easy to learn programming with Python. But learning programming is still very hard, so many abstract concepts to grasp. Python just makes it a tiny less hard, almost insignificantly now that we can use an LLM to learn the syntax faster than than ever.

[–] AnAmericanPotato@programming.dev 0 points 2 months ago (2 children)

In practice, Python is not easy to learn programming with. Not at all. I see beginners wrestling with Anaconda and Jupyter notebooks and I weep.

The fact that pip is intentionally broken on macOS and some modern Linux distros sure doesn't help. Everything about environment management is insane.

[–] tyler@programming.dev 1 points 2 months ago (1 children)

Comparing python env management to Ruby or rust or even Java for fucks sake just goes to show that nobody actually cares about how easy a language is to use, they just care about what is popular or what they think is popular.

[–] oldfart@lemm.ee 0 points 2 months ago (1 children)

Ruby, of all the examples you could come up with? My Redmine is updated only every few years because I rarely have a whole day to deal with the mess that is Ruby deps managent.

Java deals with this ellegantly.

[–] tyler@programming.dev 1 points 2 months ago

Huh? I assume you mean RubyMine and I have no clue what dependency issues you could be dealing with unless you’re on windows (which python is even worse with). You have one package manager and one build tool on Ruby, compared to Python’s now 16 tools. Ruby is the gold star for package management which is why both Rust and Elixir copied enormous parts of it when creating their tools cargo and mix.

[–] calcopiritus@lemmy.world 1 points 2 months ago

That is because when you're a beginner, you read everywhere that you should be using anaconda and jupyter notebooks. I know because I did so. Neither of them lasted more than a week on my computer though.

[–] funkless_eck@sh.itjust.works 0 points 2 months ago (1 children)

as a complete layman and hobbyist i also personally think that "more pythonic" coding can sometimes be more confusing.

I dont think any beginner reads "j for j for i in k" and instantly gets it.

maybe unpopular opinion idk

[–] calcopiritus@lemmy.world 1 points 2 months ago* (last edited 2 months ago)

Anything that's not an integer or a range doesn't belong inside []. Much more readable to use zip, map, filter, etc. And more powerful.

EDIT: that was meant for indexing lists. Strings inside [] for indexing ducts are fine.

[–] gerryflap@feddit.nl 1 points 2 months ago

Good meme. However I do think that most people starting out will not really have to deal with any of those issues in the first few years apart from maybe the pip/venv/poetry/etc choice. But whatever they'll pick it'll probably work well enough for whatever they're doing. When I started out I didn't use any external libraries apart from pygame (which probably came pre-installed). I programmed in the IDLE editor that came with Python. I have no idea how I functioned that way, but I learnt a lot and hat plenty of fun.

[–] mlg@lemmy.world 0 points 2 months ago (2 children)

Reject modernity

Return to C

[–] Olgratin_Magmatoe@lemmy.world 0 points 2 months ago (1 children)

Reject tradition

Embrace scratch

[–] rain_worl@lemmy.world 1 points 2 months ago (1 children)
[–] dch82@lemmy.zip 1 points 1 week ago (1 children)

Why don't you upvote your own comment?

[–] rain_worl@lemmy.world 0 points 1 week ago (1 children)

idk. still doing it though.

[–] dch82@lemmy.zip 2 points 1 week ago

Fair enough

[–] dch82@lemmy.zip 0 points 2 months ago (1 children)

Reject modernity

Return to z80 Assembly

[–] OpenStars@discuss.online 0 points 2 months ago (2 children)

Sooo... switch to Perl then? 😜

[–] MashedTech@lemmy.world 0 points 2 months ago (1 children)

Of course! Why didn't I think about that? Maybe I could also switch some other parts of the code to Lisp?

[–] OpenStars@discuss.online 1 points 2 months ago

S-s-s

S-s-s

S-s-s

S-s-s-sure!

[–] tiredofsametab@fedia.io 0 points 2 months ago (1 children)

I still sometimes bang out small perl scripts for things that are too annoying/complex for command prompt and shell scripts but not worth writing something in, say, Go. I never learned python which is probably why I never use that.

[–] OpenStars@discuss.online -1 points 2 months ago

People keep saying Python, despite how it (1) sucks, and (2) is super annoying to keep up to date, with package management and the like, unlike Perl that is more stable. Though Python is also easy to use and powerful and extensible.

But I think each language type is what it is and has its own set of tradeoffs and balances. Unix is hyper-stable and secure but limited, Perl is powerful but requires discipline to use to full effect, and these days most people don't bother to learn it. Python is... "common", is perhaps the best way to put it:-). C/C++ is even more powerful, the latter bloated, and blamed for most memory management issues (although really, how much of that is merely bad programming practice? Okay, so it allows such though).

And now Rust is the new hot thing.:-)