Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

681–690 of 718 posts

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

#681
post #274

Earlier quoted context omitted.

Algorithms are a lot easier to understand when they are written in Python. I'm actually right now documenting medium size Java codebase by writing pseudocode, which looks like Python. Just by doing that, I've already discovered multiple bugs, which I didn't catch by looking at the Java code.

Try Kotlin then. I wouldn't call it a new language, for me it's just a syntactic sugar over Java, but for any problem you would google "how to do X in Java", not "how to do X in Kotlin". But there you can do way simpler syntax, like: 0..100 meters with -45..45 deg within 3 seconds Because "0..100 meters ..." is equivalent to "(0..100).meters(...)" (0..100) is a built-in IntRange type, that you can extend: data class…

I've played with it for a bit but it doesn't excite me enough to spend time learning it properly. I also don't care about Python beyond using it for learning algorithms and maybe some smaller Pyside UIs. However, together with Mojo it might become more interesting again.

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

#682
post #65

Python has done an impressive job over the years of making steady robust improvements. The typing and tooling has just gotten better and better. There are still plenty of problems though, imho async is still a much bigger pain than it should be (compared to other runtimes with a very nice experience like go or elixir, even dotnet has been less pain in my experience). Overall I like python, but it mainly boils down to…

I don't know what I am doing wrong but nothing written in Python has ever worked for me. I download the .py repo from from github or wherever and try to run it - errors. I try to install missing libraries pip this and that - errors. I battle fixing endless error with dependencies and when the .py finally runs - errors - wrong version of whatever library or wrong patch of this or that or the "production ready" .py doe…

You cant really make a judgement on python from this, as your story just screams user error. I have never encountered anything of what you say, and I have been programming in Python from before I had any clue what I did.

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

#683
post #65

Earlier quoted context omitted.

I don't know what I am doing wrong but nothing written in Python has ever worked for me. I download the .py repo from from github or wherever and try to run it - errors. I try to install missing libraries pip this and that - errors. I battle fixing endless error with dependencies and when the .py finally runs - errors - wrong version of whatever library or wrong patch of this or that or the "production ready" .py doe…

This is exactly my experience too. I avoid python software like the plague, because even when it does work, I can not rely on it continuing to work when python gets updated on my system.

Ofcourse you can if you just learn to use it properly.

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

#684
post #479

For me, python is the closest thing to writing pseudocode that functions. Every time I have the instinct to gloss over a thing when writing it down (because it feels obvious in my head), it turns out that python has an intuitive abstraction for it. Coming from a mathy background I found it incredibly satisfying, although I’ve come around to other languages since.

As a mathy person myself, I find the OOP leaning difficult to think about. Better equational reasoning, better lambdas, fewer side effects to worry about, avoiding mutation so that I can define something and still know what it is later during runtime, those are what help me think clearly. To me OOP is about the furthest paradigm from math that I’ve used.

Its quite easy to avoid OOP though.

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

#685
post #595
post #509

Earlier quoted context omitted.

Ruby's syntax is much nicer. I just can't stand the idea of using whitespace for scope delimiting.

I wish python had support for optional braces. Maybe time I copy some snippet or integrate some other project into mine and have to worry if someone using 2 spaces, 4 spaces or tabs.

If you are worrying about that you should try to Ruff or an equivalent.

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

#686

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.

Python is a language that the standard lib is big enough that you don't need dependencies

I need JSON with comments and trailing commas

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

#687
post #436

Earlier quoted context omitted.

> but my understanding is that it was too little too late. Too little too late to be the #1 language of choice for serious server-side software that it is today? The weird thing about Java is that people naturally compare its popularity today to its dominance in the early '00s, which was an aberration. The ecosystem has long since returned to its fragmented self, and while Java is not nearly as dominant as it was dur…

> Too little too late to be the #1 language of choice for serious server-side software that it is today? I was replying to > Python's success is entirely due to entry-level programming courses. They all switched to Python, not to mention that there are an awful lot of qualifiers in your statement. There are certainly plenty of Java jobs to be had but all the usual suspects like PYPL, TIOBE, SO (disregarding the old a…

Python may be somewhat more popular [1] in terms of number of people using it (partly because a lot of Python programming isn't about shipping software and many Python users aren't professional programmers), but JS, Python, and Java, the three most popular programming languages today, are each dominant in specific domains, and none of them has a huge market share in the areas where the others dominate. There isn't a lot (relatively) of client GUI software written in Python or Java, there isn't a lot (relatively) of data analysis in Java or JS, and there isn't a lot (relatively) of serious servers in Python or JS.

[1]: https://www.devjobsscanner.com/blog/top-8-most-demanded-prog...

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

#688
post #585

Earlier quoted context omitted.

I would love to hear about the security issue if you're able to talk about it

I don't remember the exact details, but it basically involved something along the lines of: 1) Loop through a list of permissions in a for list 2) After the loop block, check if the user had a certain permission. The line of code performing the check was improperly indented and should have failed, but instead succeeded because the last permission from the previous loop was still in scope. Fortunately there was no rea…

Oof that's a near miss. That's the sort of hard-to-find issue that keeps me up at night. Although maybe these days some ai tool would be able to pick them up

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

#689
post #250
post #47

Earlier quoted context omitted.

For the last 20 years that has been the mantra. Some X "solves" all the problems. Except it doesn't. It just creates another X that is popular for a while, and doesn't somehow retroactively "fix" all the chaotic projects that are a nightmare to install and upgrade. Yes, I understand people like Python. Yes, I understand the LLM bros love it. But in a real production environment, for real applications, you still want…

>Except it doesn't. That is only true if you never reexamine the universality of your statement. I promise that it is possible to "solve" the mess that was Python's ecosystem, that uv has largely done so, and that your preconceptions are holding you back from taking advantage of it.

Here's the thing: there has never been a lack of people who have declared this problem as solved in the 20 or so years since Python started Poking its way into my professional life. (And for about 12-13 years before that I could gladly ignore it since nobody did much of anything in it). People have said this since the days of the Blackberry.

Multiple times people have explained why they think whatever they are madly in love with now is the definitive solution. And none of those times, over those couple of decades did it turn out to be true.

I understand that you are enthusiastic about things. I get it. But perhaps you might understand that some people actually need to see things stick before they declare a winner? I'm not big on wishful thinking.

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

#690
post #47

Earlier quoted context omitted.

For the last 20 years that has been the mantra. Some X "solves" all the problems. Except it doesn't. It just creates another X that is popular for a while, and doesn't somehow retroactively "fix" all the chaotic projects that are a nightmare to install and upgrade. Yes, I understand people like Python. Yes, I understand the LLM bros love it. But in a real production environment, for real applications, you still want…

I've ignored the trends and just used the bog standard requirements.txt with pip and a virtualenv and have had no problems in the past 10+ years. Either way, you always want to catch production deploys if something breaks.

"production deploys" sounds like something that is in a datacenter.
Post reply on HN