Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

341–350 of 718 posts

Re: I'm switching to Python and actually liking it

#341

Earlier quoted context omitted.

Apparently the author used to be a Java person. I have this feeling - or prejudice - that people still in the Java World are a bit out of tune with the tech industry, working on huge legacy projects on big retail or US banking. These people tend to be conservative and resistant to change, so maybe that's where these types of articles are coming from.

Java shops are certainly where I've witnessed the most disdain for Python. IME the strongest feelings tend to come from people who didn't actually have any significant experience with Python, and perhaps don't even have much practical experience with any language that isn't Java. So they tended to consider it to be objectively inferior purely because it's interpreted and dynamically typed. At a previous job I did man…

> Java, for its part, can also accumulate a lot of dynamic language-style performance losses to pointer chasing and run-time type lookups (and GC churn) if you're not careful about how you use generics.

The worst thing about Java is the average quality of Java programmer.The same could probably be said about Python. However I think that there are fewer Python programmers trying to write AbstractFactoryFactory than in Java. Java has a terrible culture of overly verbose, deep inheritance trees that make debugging and development worse, with worse performance.

Re: I'm switching to Python and actually liking it

#342

Out of curiosity, why would I use Dataclass vs a Pydantic Basemodel. If we did not have a PyDantic dependency I could imagine wanting to use Dataclass. But if I have it, why not use everywhere?

Unnecessary baggage if you don't need validation or serialisation.

My rule of thumb is to use Pydantic if I need serialisation, otherwise I default to dataclasses.

Re: I'm switching to Python and actually liking it

#343

Earlier quoted context omitted.

Probably the system of giving special meaning to what are otherwise ordinary identifiers. __ isn't a reserved keyword in Python or anything. But there's a set of conventions you're supposed to follow when naming methods and attributes, and they're visibly artificial. It would be cleaner to make the features that are a special part of the language definition also a special part of the language syntax instead of runnin…

I'm not sure how "operator+" is supposed to be appreciably different from "__add__".

They have different locality of behavior, for one.

Re: I'm switching to Python and actually liking it

#344

Earlier quoted context omitted.

The v2 to v3 transition threw a lot of people.

Can we please stop reiterating the same old stories? That was years ago. Most Python devs these days never wrote a single line of Python 2. I learned it 16 years ago and, while frameworks like Django were still in the middle of the transition back then, I pretty much started learning & writing Python 3 right away.

This might be true but I still find myself typing:

print "xyz"

now and then. It's not a big deal, but it reminds me of struggling with pip->pip3 and many other things for a long time years ago.

Re: I'm switching to Python and actually liking it

#345
post #73

Earlier quoted context omitted.

Python's success is entirely due to entry-level programming courses. They all switched to Python, because you have to explain less. I don't think I heard about web servers in Python before 2012. I suppose a 2005 computer wouldn't be able to serve a Python backend smoothly. PHP's popularity isn't really from 2005-2006. It was popular at the end of the 90s, and it looks like JS as much as it looks like a potato.

With python you can just go: 'print "hello, world!"' and that's a full-ass program You run it by saying `python hello.py`. Compare that to the amount of crap you need(ed) with 2005 Java just to have something running. The shittiness of ActivePython and generally getting python to run on Windows were a bit of a hurdle, but still it was easier than the competition

Sure, but you could've done the same thing with perl in the 80's and 90's.

Re: I'm switching to Python and actually liking it

#346

Earlier quoted context omitted.

I always forget this syntax exists. When was this introduced?

The Walrus operator! Introduced in Python 3.8 according to the PEP 572. Really nice to combine 1) checking if something exists and 2) act on it

You forgot to end with "goo goo g'joob" or the less correct Simon and Garfunkel version "coo coo ca choo".

Re: I'm switching to Python and actually liking it

#347
post #287

> I would like to have a tool that generates the project structure for me, but I haven’t found one that fits me yet. I recommend cookiecutter for this. I have a few templates I've built with that which I use frequently: python-lib: https://github.com/simonw/python-lib click-app: https://github.com/simonw/click-app datasette-plugin: https://github.com/simonw/datasette-plugin llm-plugin: https://github.com/simonw/llm-p…

My take on this (using Ruby) is https://github.com/coezbek/baker

It doesn't copy template repos, but rather creates a list of imperative steps to perform. Steps can be both manual (obtain an API key and store it here) and automatic (run 'uv init'). Markdown syntax, ruby string interpolation and bash.

It came from a deep hate for yml based configs.

Re: I'm switching to Python and actually liking it

#348

Earlier quoted context omitted.

Apparently the author used to be a Java person. I have this feeling - or prejudice - that people still in the Java World are a bit out of tune with the tech industry, working on huge legacy projects on big retail or US banking. These people tend to be conservative and resistant to change, so maybe that's where these types of articles are coming from.

I have a related feeling or prejudice that people not in the Java World view their corner as "the tech industry" without realizing that they are living in a village compared to the giant metropolis that is the Java World. Java programmers may not blog as much, and Java doesn't show up on Hacker News as much, but not being Extremely Online does not mean that it isn't extremely widely used by real people whose experien…

The reason that people still code in Java (or derivative) is because legacy code that they are working on is in Java, and nobody has either the skill or time to go through and translate it. Which means that the jobs where its used are basically just big enterprise, low tech software that just been around for a while.

The Log4shell incident is the perfect demonstrator of what kind of people are in Java world.

Re: I'm switching to Python and actually liking it

#349

Earlier quoted context omitted.

The v2 to v3 transition threw a lot of people.

Can we please stop reiterating the same old stories? That was years ago. Most Python devs these days never wrote a single line of Python 2. I learned it 16 years ago and, while frameworks like Django were still in the middle of the transition back then, I pretty much started learning & writing Python 3 right away.

Hah that brings back memories of me smugly insisting to my freshman roommate that using Python 3 tutorials to learn programming was a complete waste of his time and he should be using 2.7 for life like the rest of us l33t hax0rs.

Tbf at that point Django was still pretty shaky with 3 and basically none of the 3rd party Django libraries supported it at all, plus I was using Google AppEngine which at the time was tightly coupled to the 2.7 runtime. But really I was just parroting the Slashdot hivemind which was 100% convinced the transition was the new Perl 6 and would kill Python, and that Python.org was dishonestly teaching newbies who didn't know better a dead language and worthless skill when they changed the default.

Fortunately for him he ignored me and most of the big Django libraries were ported like a year later at which point I had to switch anyway to get updates. Fully agreed that in 2025 it's pretty much irrelevant, and honestly despite some legitimate pain the transition was much more successful than the cynics assumed it would be at the time.

Re: I'm switching to Python and actually liking it

#350

When did Python go out of fashion? This is the second article I've seen talking about it as if it's some kind abomination. I get that it's not the shiny new thing, but I don't understand people hating on it. Is this just junior devs who never learned it, or is there some new language out that I missed? (And please don't tell me Javascript....)

Python is probably too awesome and versatile to go out of fashion, but as a long time user.. the ecosystem is frustrating. Dependencies and packaging have been, and still are a nightmare after thousands of years. Problems are fixable sure but the thing is that they never end. After you get plenty of practice fixing all the related problems, you'll have to keep fixing them for yourself, your less savvy teammates, and in third-party code pretty much forever. This is worth it in exchange for "import antigravity" for the first 100 years, but it's frustrating eventually.

Everyone will mention uv/pyenv/poetry/conda/virtualenvs, so fine, let's pretend it's not a problem that you tried each of those in desperation and they are all household names. Suppose the packaging wars actually ended and everyone uses what you use without you needing to tell them, and suppose further that every pypa problem isn't blaming debian maintainers for obvious regressions. Pypi will still yank[0] packages at the source to perhaps randomly break deterministic behaviour, smashing anything in the blast radius rather than only clients using a --strict flag or something. You can pin your own dependencies but who knows what they will pin (nothing, or the wrong stuff, or the wrong way probably!) or what they will yank. Now for repeatability you need to host a mirror for everything you use- which is fine for corporate but a nonstarter for the novice and annoying for FOSS projects.

If you have zero dependencies or a slowly changing environment that is receiving constant care and feeding, you'll probably never notice how bad things are. If you put down most projects for a month though and pick them back up, perhaps with a different environment, machine, or slightly different python version it's broken, bitrotted, and needs serious attention to be rehabilitated.

People might argue.. that's just software dev. Nope. I say it with lots of love and gratitude for the efforts of the community.. but most langs/ecosystems would never tolerate this level of instability. One has to eventually just admit that working, portable, and actually repeatable environments with python basically just require docker. Can we talk about how "--break-system-packages" is hilarious? After you retreat to docker you can type this a few times a day, push the container up, pull it down months/years later, and then realize that literally the only way to get a stable working environment is to request a broken one. QED

[0]: https://docs.pypi.org/project-management/yanking/

Post reply on HN