cross-posted from: https://lemmy.world/post/19849935
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.
It’s also important to note that you might come out ahead in learning those abstract concepts using a harder language.
But my first language was Pascal. from a book stolen from my dad’s library. Then C++. I still wouldn’t call myself anything other than an amateur… I mean, my dad can do more with one line of C than most programmers can do in their entire career. (he really shouldn’t. but he does. Calls it “job security”.)
It’s also important to note that you might come out ahead in learning those abstract concepts using a harder language.
I agree that you will learn more abstract concepts with more low level languages, but they are often not necessary. See Scala, beautiful language, lot’s of fancy subtle computer science concepts, and a plummeting popularity since its main popularizer, Apache Spark, implemented a Python API.
Well. yes. it does strongly depend on what you intend to do with it.
Python is a great language that’s very broadly used; there’s a reason that Apache added the python API; after all. (and why Scala is plummeting.) I wouldn’t even say Pascal was all that useful, to me. I think I ‘learned it’ enough to get through the dumb book, and then went on to something else. C++ was more fun anyhow.
I was hacking scripts and web shit together in perl, python and php for many years before learning C, and just a couple months learning C/C++ made me understand so many more basic concepts than all previous years experiences combined.
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.
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.
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.
Development environment is a mess, but given its popularity, it’s not difficult to find an up to date tutorial. Then it is the easiest I think, you will be able to try programming basics and get a minimum viable product (small web app, small analytics…) easlier than with any other language.
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
This a much better done meme
The other one before makes zero sense
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.
This is why I decided to learn Nix. I built dev environment flakes that provision the devshell for any language I intend to use. I actually won’t even bother unless I can get something working reliably with Nix. ;)
For example, here’s a flake that I use for my Python dev environment to provide all needed wiring and setup for an interactive Python web scraper I built:
{
description = "Interactive Web Scraper";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs { system = system; };
in rec {
packages = {
pyinputplus = pkgs.python3Packages.buildPythonPackage rec {
pname = "pyinputplus";
version = "0.2.12";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-YOUR_SHA256_HASH_HERE";
};
};
pythonEnv =
pkgs.python3.withPackages (ps: with ps; [ webdriver-manager openpyxl pandas requests beautifulsoup4 websocket-client selenium packages.pyinputplus ]);
};
devShell = pkgs.mkShell {
buildInputs = [
pkgs.chromium
pkgs.undetected-chromedriver
packages.pythonEnv
];
shellHook = ''
export PATH=${pkgs.chromium}/bin:${pkgs.undetected-chromedriver}/bin:$PATH
'';
};
});
}
Reject modernity
Return to C