457
top 50 comments
sorted by: hot top controversial new old
[-] oce@jlai.lu 42 points 2 months ago* (last edited 2 months ago)

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.

[-] FuglyDuck@lemmy.world 36 points 2 months ago

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".)

[-] oce@jlai.lu 8 points 2 months ago

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.

[-] FuglyDuck@lemmy.world 6 points 2 months ago

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.

[-] asyncrosaurus@programming.dev 5 points 2 months ago* (last edited 2 months ago)

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.

[-] OpenStars@discuss.online 1 points 2 months ago

Try assembly then - it'll freaking blow your mind!:-)

[-] asyncrosaurus@programming.dev 1 points 2 months ago

I took a compiler course focused on optimization and porting. So I worked with x86 and ARM. There's very little reason in modern computing to write assembly by hand, but it's still useful to be able to read and understand.

[-] OpenStars@discuss.online 1 points 2 months ago

Having to work within such constraints, it really showed me difficulties that modern languages try to entirely abstract away from you. e.g. there are only so many "registers" that physically exist, before you have to start using much slower to access memory locations - a very far cry indeed from automated variable garbage collection!!

[-] AnAmericanPotato@programming.dev 26 points 2 months ago

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.

[-] tyler@programming.dev 20 points 2 months ago

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.

[-] oldfart@lemm.ee 4 points 2 months ago

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.

[-] tyler@programming.dev 3 points 2 months ago

Huh? I assume you mean RubyMine and I have no clue what dependency issues you could be dealing with unless you’re on windows (which python is even worse with). You have one package manager and one build tool on Ruby, compared to Python’s now 16 tools. Ruby is the gold star for package management which is why both Rust and Elixir copied enormous parts of it when creating their tools cargo and mix.

[-] oldfart@lemm.ee 2 points 2 months ago

https://www.redmine.org/ is a standard rails webapp. Nothing special. Straightforward to update, just a few commands, the only quirk is that at least one step always fails. Some obscure bug in a dependency, some problem with expected vs installed system libraries, or my favourite, a Segmentation Fault.

[-] tyler@programming.dev 1 points 2 months ago

Conflating a Ruby on Rails app to all of Ruby is just not really fair. It’s like comparing Lombok to Java. Lombok is a hot fucking mess and Java app with it is gonna have difficulty at later points.

Aside from that (I think rails is honestly terrible), just looking at the repo I can see that RedMine doesn’t use bundler, which is the singular standard in the Ruby community, so it’s like saying “a project I use uses Ant under the hood so Java is bad”. Like I said, there’s a reason that Rust and Elixir based their build tools off of Ruby’s.

load more comments (2 replies)
[-] calcopiritus@lemmy.world 5 points 2 months ago

That is because when you're a beginner, you read everywhere that you should be using anaconda and jupyter notebooks. I know because I did so. Neither of them lasted more than a week on my computer though.

[-] oce@jlai.lu 3 points 2 months ago* (last edited 2 months ago)

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.

[-] rikudou@lemmings.world 3 points 2 months ago

Nah, php over python any day. Equally easy to start, equally fucked up core, but the ecosystem around it is so much saner and easier. And I'd argue it's even easier for beginners.

Unless you need something that only has python bindings, I'd never choose python.

[-] funkless_eck@sh.itjust.works 3 points 2 months ago

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

[-] calcopiritus@lemmy.world 3 points 2 months ago* (last edited 2 months ago)

Anything that's not an integer or a range doesn't belong inside []. Much more readable to use zip, map, filter, etc. And more powerful.

EDIT: that was meant for indexing lists. Strings inside [] for indexing ducts are fine.

[-] kSPvhmTOlwvMd7Y7E@programming.dev 23 points 2 months ago

This a much better done meme

The other one before makes zero sense

[-] demesisx@infosec.pub 17 points 2 months ago

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
      '';
    };
  });
}

[-] MashedTech@lemmy.world 2 points 2 months ago

I've been intrigued by Nix for quite a while. I will learn it as well.

[-] demesisx@infosec.pub 12 points 2 months ago

It feels like magic. I think of it as the glue that makes almost all of my software work together seamlessly. I can’t wait to use it for one-click deployments of my software on a server or high-availability cluster.

[-] JATtho@lemmy.world 17 points 2 months ago* (last edited 2 months ago)

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.

[-] Sylvartas@lemmy.world 5 points 2 months ago

audible C++ programmer disgust

[-] rain_worl@lemmy.world 3 points 2 months ago* (last edited 2 months ago)

js is similar, though it does not include python's precalculated numbers
calculates integers from -5 to 256, see:

> a = 100
> b = 100
> c = 1000
> d = 1000
> a is b
True
> c is d
False
[-] lkdm@programming.dev 15 points 2 months ago

I find Python easy to just code a prototype with. But I find Rust easier to get right.

[-] elliot_crane@lemmy.world 7 points 2 months ago

This is basically what I’ve been telling people for years. Prototype in Python to get the concepts down, then when you’re serious about the project, write it in a serious language.

[-] Swedneck@discuss.tchncs.de 1 points 2 weeks ago* (last edited 2 weeks ago)

python is IMO the closest thing we have to a platonic ideal scripting language: it's pseudocode that actually runs and you can just slap together libraries with minimal mental effort until it works.
Great for gently getting into programming so you quickly see results without having to learn arcane incantations, and for writing small tool programs; not so great for writing a kernel in.

load more comments (1 replies)
[-] gerryflap@feddit.nl 15 points 2 months ago

Good meme. However I do think that most people starting out will not really have to deal with any of those issues in the first few years apart from maybe the pip/venv/poetry/etc choice. But whatever they'll pick it'll probably work well enough for whatever they're doing. When I started out I didn't use any external libraries apart from pygame (which probably came pre-installed). I programmed in the IDLE editor that came with Python. I have no idea how I functioned that way, but I learnt a lot and hat plenty of fun.

[-] embed_me@programming.dev 11 points 2 months ago

What about the issue where people try to install new version of python sometimes try to uninstall the "old" pre-installed version on a linux system and thus borking the whole s

Definitely not me, anymore

[-] gerryflap@feddit.nl 8 points 2 months ago

I may or may not have done this haha. I'm a threat to any working piece of software, just enough knowledge to be able to break shit and too little knowledge to avoid breaking shit. I think after all these years I've mostly learnt my lesson though. The package manager is the boss, and if I don't like it I have to work around it without upsetting the package manager

load more comments (1 replies)
[-] mlg@lemmy.world 14 points 2 months ago

Reject modernity

Return to C

[-] Olgratin_Magmatoe@lemmy.world 6 points 2 months ago

Reject tradition

Embrace scratch

[-] dch82@lemmy.zip 3 points 2 months ago

You're the "chaotic evil" guy aren't you

[-] Olgratin_Magmatoe@lemmy.world 1 points 2 months ago* (last edited 2 months ago)

When everything's a logic block, nothing will be

[-] dch82@lemmy.zip 4 points 2 months ago

Reject modernity

Return to z80 Assembly

load more comments (1 replies)
[-] iAvicenna@lemmy.world 1 points 2 months ago
[-] GTG3000@programming.dev 9 points 2 months ago

Man, the variable scoping thing is insidious. It will never not be weird to me that ifs and loops don't actually create a new scope.

And then you try to do a closure and it tells you you didn't import anything yet.

[-] OpenStars@discuss.online 7 points 2 months ago

Sooo... switch to Perl then? 😜

[-] MashedTech@lemmy.world 9 points 2 months ago

Of course! Why didn't I think about that? Maybe I could also switch some other parts of the code to Lisp?

[-] OpenStars@discuss.online 8 points 2 months ago

S-s-s

S-s-s

S-s-s

S-s-s-sure!

[-] Kazumara@discuss.tchncs.de 7 points 2 months ago

Maybe some Lua, as a treat?

[-] kSPvhmTOlwvMd7Y7E@programming.dev 6 points 2 months ago

I feel offended by you somehow equalizing perl and lisp

[-] tiredofsametab@fedia.io 2 points 2 months ago

I still sometimes bang out small perl scripts for things that are too annoying/complex for command prompt and shell scripts but not worth writing something in, say, Go. I never learned python which is probably why I never use that.

load more comments (3 replies)

Python 3.13 is adding support for removing GIL, via PEP 703

load more comments
view more: next ›
this post was submitted on 16 Sep 2024
457 points (97.3% liked)

Programmer Humor

19623 readers
1 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS