74
you are viewing a single comment's thread
view the rest of the comments
[-] ultimate_worrier@lemmy.dbzer0.com 6 points 2 months ago

Because most people are lazy hacks.

[-] xep@discuss.online 9 points 2 months ago

What is so lazy about Python?

[-] masterspace@lemmy.ca 4 points 2 months ago* (last edited 2 months ago)

Lazy is an overly harsh and judgemental way to put it (virtually all programmers start with some high level simplified language), but the sentiment arises because it's syntax is designed to be easy for people writing code, but at the cost of people maintaining code.

The whitespace delimiters, the lack of type system, the lack of semi-colons ... They're all things that people who haven't programmed before think make programming easier. In reality they all make in the wild production programs waaay harder to maintain.

There's a reason that JavaScript has been surpassed by TypeScript for professional developers, and it did so remarkably quickly. All that 'extra' information that seems pointless for a new dev to express, in reality constrains your program, makes it more readable and understandable, reduces the amount of tests you have to write, and makes it easier for someone else to come in and make a change to it and be confident they haven't broken anything.

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

Python's type system is dramatically better than Javascript's though. Try doing things like '' + True and Javascript will do incredibly stupid things. Python will just give you a type error. Also, look at things like == vs === in Javascript as well. That's the biggest reason why Typescript replaced it overnight. Python has found a better balance between productivity and error safety.

In my opinion, the biggest shortcoming of Python's dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn't have semantic errors (a lot more than, say, Java). It has gotten better with the introduction of type hints, those I don't have much experience with them, so I can't say how much.

[-] Feyd@programming.dev 2 points 2 months ago

In my opinion, the biggest shortcoming of Python’s dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn’t have semantic errors

That is a large shortcoming.

[-] namingthingsiseasy@programming.dev 2 points 2 months ago

Sure, but as with all things, it can depend on a lot of factors. All code needs some degree of testing, though one could certainly argue that Python needs more than Java and Java needs more than Rust/Haskell/etc. So you could argue that the productivity gain of using Python is offset by the productivity loss of extra testing. It's still hard to say which one wins out in the end.

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

People underestimate the cost of testing.

  1. It has to actually happen to be effective and is something that can be dropped under time pressure where something built into the language cannot.
  2. Test code is also code that is not guaranteed to be correct, and also incurs it's own maintenance tolls

Removing the need for entire classes of tests cases is a huge win

[-] furrowsofar@beehaw.org 3 points 2 months ago

You can write Python code about 5x faster then C. Add libraries even faster.

[-] FizzyOrange@programming.dev 5 points 2 months ago

I mean... C is a low bar. You can write Typescript, Rust and Go code 5x faster than C too.

[-] furrowsofar@beehaw.org 2 points 2 months ago

Go might be a close 2nd language wise but not the others. All of the above have a pretty narrow application range too. Even with a good lamguage, you would have to have the libraries too and pypi is pretty big.

[-] FizzyOrange@programming.dev 2 points 2 months ago

All three of those languages have library ecosystems at least as good as Python's. Typescript is just as easy to learn and as fast to write as Python. I don't see why you'd think Python is faster. If I add up all the time I've lost to Python's terrible tooling it's quite a lot slower!

Rust is definitely harder to learn - I'll give you that. But once you have learnt it it's just as fast as Typescript and Python. Especially if your "fast to write" metric measures to when you program is correct.

[-] ultimate_worrier@lemmy.dbzer0.com 1 points 2 months ago* (last edited 2 months ago)

Dynamic type systems are meant for beginner/toy languages. Hacks that don't care about understanding their own code tend to use Python. Their code is often riddled with bugs that they are none-the-wiser about.

If you write your code in Python, you might as well admit that you don't care to understand what your code is actually doing.

[-] Solemarc@lemmy.world 4 points 2 months ago

Nah, I recently had to create a program that turned a bunch of extracted CSV files into an XML file for government reporting. I also had to parse some provided government XML files to add things into my output.

This was going to be run by non-technical people on any OS so I went for python because "install python, download this file and click on it" was easy. Python has a big standard library so I could do everything I needed in it. I was considering using Go but asking people to open the terminal and build something was probably a bridge too far.

[-] syklemil@discuss.tchncs.de 11 points 2 months ago

Distribution usually isn't considered a strong point for Python, though.

For other languages that build a static executable, the more expected method of distribution would be some automated workflow that builds artifacts for various os/architecture-triplets, that you can then just download off the project page.

[-] namingthingsiseasy@programming.dev 2 points 2 months ago

Distribution usually isn’t considered a strong point for Python, though.

It depends. If it's a simple script with no external dependencies, then it's very easy to distribute. But if your application has external dependencies and you are trying to install it on your host (and you aren't using docker or similar technologies), then yes, it's harder than just shipping an executable or .jar file. The fact that Python's standard library is so comprehensive helps a lot in this regard, but it only works up to a certain point.

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

It depends. If it’s a simple script with no external dependencies, then it’s very easy to distribute

it really isn't. Try distributing anything that needs openssl under the hood (which is part of Python's stdlib). I spent years deploying Python and Ruby tools next to each other to other devs machines. Python is incredibly hard to distribute, even to the same OS across a company. I really think that most people that think "Python is easy" actually haven't ever tried using other languages and seen how easy it is there. Even Java jars are easier to deploy than Python, both if you're making an executable and if you're just having the user build or run the code directly. The only thing that is even close in difficulty from all the top languages for deployment is C/C++. Everything else is vastly easier. Part of that comes from Python's ridiculous tooling (15+ different tools at this point https://chriswarrick.com/blog/2023/01/15/how-to-improve-python-packaging/) and part of it comes from the fact that Python chooses to bundle old or out of date versions of libraries causing conflicts in newer systems, like OpenSSL.

[-] chrischryse@lemmy.world 1 points 2 months ago

I use it as a beginner cuz it’s easy to use but guess I’m lazy since I didn’t start on a language that’s more in depth

[-] ultimate_worrier@lemmy.dbzer0.com 1 points 2 months ago

As a beginner, you'll eventually run into enough issues with your code that you will start to ask "is there a better way?" My answer will be: yes. Strongly typed languages are FAR superior because they force you to make your code robust and eliminate most runtime errors by default. You'll eventually come around (unless you're in a company with a hack culture or are surrounded by hacks that don't know any better).

this post was submitted on 02 Oct 2025
74 points (100.0% liked)

Programming

23830 readers
138 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS