Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

591–600 of 718 posts

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

#591

Earlier quoted context omitted.

> Millions of people put it into Docker, or they just deal with it and you see the results with tons of Stackoverflow questions Arrogantly wrong. I've coded in Python for almost 20 years. Many of those years I've had it as my primary language at work. 2024 was the first year I actually needed a virtualenv. Before that, I'd happily use pip to install whatever I want, and never had a version conflict that caused proble…

Some packages are written by researchers in fields that aren’t engineering. Sometimes you go all the way and reach for a VM.

I'm not denying that some need a VM or virtualenv. They exist for a reason.

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

#592
post #429

Earlier quoted context omitted.

You don't generally want API keys accidentally recorded into someone's bash history.

What exactly is your threat model, where the attacker can read ~/.bash_history but can't execute (or capture output from) /usr/bin/env?

How about not accidentally showing tokens and credentials when live screen sharing?

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

#593

Earlier quoted context omitted.

> Millions of people put it into Docker, or they just deal with it and you see the results with tons of Stackoverflow questions Arrogantly wrong. I've coded in Python for almost 20 years. Many of those years I've had it as my primary language at work. 2024 was the first year I actually needed a virtualenv. Before that, I'd happily use pip to install whatever I want, and never had a version conflict that caused proble…

I was talking about pip, not venv. I don't use venv either, not because I think it's a bad idea but because I can't be bothered. Stuff does end up conflicting unless I use Docker (lol) or uv.

As another commenter alluded: It's clear your knowledge of the topic at hand is poor.

It's wise to keep silent in such cases.

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

#594
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.

Well it’s not about math. Stick to lines of code, functions and modules for that. Use it for abstract data types, frameworks and modeling.

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

#595
post #509
post #46

I'm glad someone else discovered they can like python. I got forced to learn it for a project where I was proposing Ruby and the customer insisted on Python. This was years ago when Ruby was much slower. I was annoyed but I got used to it and here I am enjoying it many years later. I take issue with the description and use of make though! :-D What is the point of it if you're not going to use dependencies? One might…

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.

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

#596

Earlier quoted context omitted.

Java unequivocally won the war, though.

Having used both, I still can't understand why.

M$ was too late to open source it and too late to embrace Linux. On desktop side .NET was only for windows back then and xamarin immature. On server side in java land you had framework war so you had many choices and libraries to choose from - companies didn't want to fully embrace M$ ecosystem (windows sql server, windows deployment etc). Then Android came and adopted Java and M$ lost mobile ecosystem war.

I can see similar way why Swift eventually can loose market share - too late to open source and too late to embrace cross-platform.

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

#598
post #76

> 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…

“import json” is the kind of thing which requires picking and installing libraries in batteries-not-included languages, and it’s just one of many modules which are in the standard library. That’s not a compelling basis for large projects but over the years I’ve shipped a ton of useful production code which never needed more than the stdlib and thus spent no time at all thinking about deployment or security patching.…

I'm not arguing on venv to isolate installs, I'm saying that relying on Python coming from UNIX-like OSes is close to impossible for, at least web related projects. I.e. Ansible does a lot [in terms of what code it generates] to keep itself compatible with whatever Python3 versions it may find on systems ( remote hosts )

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

#600

Earlier quoted context omitted.

Using it as a replacement for Bash. No environment required, Perl is already installed on every computer on earth. Perl is generally quicker to write for string-oriented workflows - which is what Bash is. Regex is quick and easy. Perl falls apart when you need structure and even small projects. For short scripts meant to do what you would use Bash for, it's a godsend. Safer, more portable, less friction.

Perl does not fall apart when you need structure, it's OO. In fact it's better structured than Python (hello, PyPI? It's CPAN calling, we wanted to let you know hierarchical packages are a thing). If you mean "forcing people to program in an opinionated manner", it doesn't do that by default, but that's what linters and formatters are for (like the ones Python programmers use)

Perl has OO but I don't like it much.
Post reply on HN