Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

381–390 of 718 posts

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

#381
I keep meaning to write something like this but exploring the “how simple can you make it” angle - a lot of my world is kube (which is great in the right scenario) but could you shave complexity out of a stack designed for solo dev rapid iteration:

e.g. rather than:

  > It’s important not to do any heavy data processing steps in the project-ui … we keep the browser application light while delegating the heavy lifting and business logic to the server
Chomp the complexity, serve HTML from the backend directly

  > ty
Im curious where ty goes but for a min-complexity stack i couldnt spend complexity tokens on pre release tools

  > pydantic … dataclasses
One or the t’other, plus i’ll forever confuse myself: is it post_init (dataclasses) or is it post_model_init (pydantic) - i had to check!

  > docker
if we already have uv, could we get away without docker? uv sync can give an experience almost akin to static compiled binaries with the right setup. Its not going to handle volumes etc so if you're using docker features, this concept isnt going to fly. If you're not wedded to docker though, can you get away with just uv in dev and prod? in an enterprise prob not, i wouldn't expect to be able to download deps in prod. For flying solo though…

  > compose
You’ve a frontend, a backend and presumably a database. Could you get away with just uv to manage your backend and a local sqlite db?

So a broadly feature comparable stack for rapid iteration with less complexity but still all the bells and whistles so you dont need to cook everything yourself, might look like:

  - uv
  - fastapi + jinja + htmx + surreal + picocss
  - sqlite
You could probably sketch a path to hyper scale if you ever needed it:

  - v1 = the above stack
  - v2 = swap sqlite for postgres, now you unlocked multiple writers and horizontal scaling, maybe py-pglite for test envs so you can defer test-containers adoption for one more scaling iteration. WAL streaming would add some complexity to this step but worth it
  - v3 = introduce containers, a container registry and test-containers. I dont think you really unlock much in this step for all that additional complexity though…
  - v4 = rke2 single node cluster, no load balancer needed yet
  - v5 = scale to triple node, we need a load balancer too
  - v6 = add agent nodes to the rke cluster
  - v7 = can you optimise costs, maybe rewrite unchanging parts in a more resource efficient stack
  …

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

#382

Maybe I'm the only one that finds Python simultaneously verbose and lacking? Either you need 500 dependencies to do something in a simple way, or you need dozens (if not hundreds) of lines to do trivial things. I avoid writing Python because there's so much bullshit to add. Much prefer Perl, I can actually get things done quickly. Python feels like programming for the sake of programming.

Could you share an example, where Perl is quicker to use and more powerful?

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

#383

Maybe I'm the only one that finds Python simultaneously verbose and lacking? Either you need 500 dependencies to do something in a simple way, or you need dozens (if not hundreds) of lines to do trivial things. I avoid writing Python because there's so much bullshit to add. Much prefer Perl, I can actually get things done quickly. Python feels like programming for the sake of programming.

YMMV, but in my experience, Python's top use cases tend to require fewer dependencies, not more. Many trivial tasks are already built into the language. Not saying Python is perfect, but it's definitely well-oriented in that regard. I'm curious in what kinds of use cases have you found the opposite to be true?

I think the classic Python vs. Perl question ultimately comes down to using what you feel most comfortable with. People are different, and that's totally fine.

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

#384

Earlier quoted context omitted.

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.

> nobody has either the skill or time to go through and translate it.

To what? Java is still a very efficient, productive language. Updating a legacy codebase to use newer Java features would probably be good, but migrating to another language is unlikely to significantly move the needle in terms of runtime performance or developer velocity.

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

#385

Earlier quoted context omitted.

If the TIOBE index is an even remotely useful indicator, Python's an even bigger giant metropolis.

Yes, but the difference here is that Python is talked about all the time, so the online tech world knows that Python is huge. The comment I was replying to seems to believe Java is a tiny backwater, which is anything but true.

I read it less as "Java is tiny" and more as "Java developers can be peculiarly insular and conservative, by the standards of other communities."

Considering that as recently as 4 years ago I was working on a project where we still had a hard requirement to support running in Java 7, and this kind of thing was not considered unusual, I can't really disagree too strongly with that. Yes, that was still inside of Java 7's extended support period, so there was really nothing unusual or surprising about this, from a Java developer perspective. But that's kind of the point.

It's also not really a bad thing, considering what kinds of things run on Java. Mainframe developers have a similar thing going on, for a similar and similarly good reason.

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

#386

I keep meaning to write something like this but exploring the “how simple can you make it” angle - a lot of my world is kube (which is great in the right scenario) but could you shave complexity out of a stack designed for solo dev rapid iteration: e.g. rather than: > It’s important not to do any heavy data processing steps in the project-ui … we keep the browser application light while delegating the heavy lifting a…

if you want to serve HTML from the backend, why not use FastHTML then ;-)

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

#387

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?

Why would I use a Pydantic model when `TypeAdapter(MyDataclass)` exists?

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

#388

Earlier quoted context omitted.

I don’t think anyone is criticizing its utility, just that the syntax of 2-5(?) underscores in a row isn’t something that is DX friendly.

The syntax is exactly two, not 2-5.

I think the point was: who can know by looking at it.

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

#389

> Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros That's kind of very optimistic evaluation - literally anything beyond "import json" will likely lead you into the abyss of virtual envs. Running something created with say Python 3.13.x on Ubuntu 22.04 or even 24.04 (LTSs) / Rocky 9 and the whole can of worms opened. things like vir…

You should always use virtual envs. They're a single directory, how are they an abyss? Pip now complains if you try to install a package system wide.

> You should always use virtual envs.

If you're not using dependencies, and are writing 3.x code, there's very little justification.

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

#390

Earlier quoted context omitted.

It's like the bright orange garments that hunters wear, the ugliness is sort of the point. It says "this is a different sort of thing."

> It's like the bright orange garments that hunters wear, the ugliness is sort of the point. Ugliness is not the point of hi-vis vests lol, the point is to not get shot by other hunters.

[deleted]
Post reply on HN