You are viewing a single thread.
View all comments
-10 points
*

Python is basically (IMO) C/C++ made easy.

Billions of libraries, works on even obscure hardware, simple syntax, no compiling(it’s behinde the scene and just like always works) or linking etc. etc. etc.

Edit: this implies that C/C++ is the best language ever of course. Let the flame wars begin!

permalink
report
reply
16 points

I very much disagree. In Python almost everything is abstracted away from you and it’s dynamically and weakly typed. It’s also interpreted.

Compare that to C which is literally one step above assembly, strongly and statically typed, as well as compiled.

They’ve got completely different use cases and have almost no overlap imo.

permalink
report
parent
reply
5 points

And yet I wouldn’t touch C nowadays if I can avoid it anyhow. Zig (simple low level) and Rust (where e.g. C++ would be used, and for large higher level projects, as it really composes nicely) are IMHO the way modern systems programming is done

permalink
report
parent
reply
2 points

That’s fine, but there are still plenty of use cases where you’d have to use C instead of anything else. I agree though, Rust is a better language than the monstrosity that is C++.

Starting a new personal project is different from what the industry requires. If you’re working on integrated systems, guess which language you’ll likely have to work with?

It’s kind of like Typescript vs Javascript. There’s zero reason to start a new project with Javascript, but there’s still plenty of projects out there that use it.

permalink
report
parent
reply
4 points

Agree except Python is strongly typed.

permalink
report
parent
reply
0 points

In what way? Python has type hinting, but it’s purely for linting and is not enforced at runtime. Python has always had dynamic duck typing.

@theherk @programming

permalink
report
parent
reply
9 points

Wow I pretty much disagree with everything you said haha. E.g. packaging/venv in python is absolute hell compared to something like cargo/crates in Rust. Try to manage a large project in python and you’ll likely revise your answer (if you actually know all the nice alternatives out there…)

permalink
report
parent
reply
3 points

In my experience managing a large project comes down to having a consistent process/standards and enough experienced engineers in that language. Remove that and every single language leads to abominations.

permalink
report
parent
reply
2 points

I agree, that having a consistent process and good engineers is definitely most important, but a language itself definitely can guide you in the right direction. I think ironically Rust and C++ are good vice versa examples (unrelated to their target area, which happens to be the same (systems programming)), C++ has zillion ways to program in, finding the right and best way is definitely no easy task and requires massive experience in all kinds of paradigms, while Rust generally promotes you to do things in one/the “right” (IMHO) way, otherwise the borrow-checker annoys you all the time.

permalink
report
parent
reply
0 points

Yeah but a “good language” isn’t some obscure, “better on the paper” language or some popular one, but one that has a large community, and not only in amateur circles.

That’s why C/C++ is so hated but also so much used. Python is way easier but has the userbase and the libraries. If you don’t need the speed, or memory management, you can do about anything with python.

Maybe Rust will take the place one day, or typescript, or kotlin, or JavaScript, or “insert new killer language” …

Python is used by the research community, and by a whole slew of companies since a long time. You have a problem? You’ll find the solution quickly.

Dealing with large projects? Go with C/C++ then ;-) I mean it’s all about architecture.

permalink
report
parent
reply
3 points
*

And yet another time I disagree with pretty much all you’ve said.

you can do about anything with python.

And this thinking is why we have sloppy running UI with 10000 times the power of devices compared to say 20 years ago (where UI was not sloppy…).

Why sacrifice performance, language ergonomics(!) and write something in python for production? I get why (AI) researchers are using it because it’s easy to quickly hack stuff together, and prototype stuff.

But as soon as it’s something larger with a bigger team you want to have static typing. because working in a team is pain in the ass with a untyped languages á la javascript or python. Also think about something like IDE tooling, it’s so much more comfortable to use rust-analyzer (which I think really is generally the best LSP by now), compared to all the python tooling I tried (and that was a lot…).

Dealing with large projects? Go with C/C++ then ;-) I mean it’s all about architecture.

Sorry, but you sound a little bit unexperienced, I really would suggest learning a few more programming languages, it’s not “all” about architecture. The languages/paradigms kind of suggest how you should layout your architecture, e.g. OOP by using classes (unfortunately often promoting the IMHO anti-pattern inheritance) , or functional by composing everything together without side-effects in functions.

C++ is absolutely the last language I would choose nowadays, it’s an absolute techdebt mess, promoting all kinds of anti patterns IMHO (I’ve got roughly 10+ years of experience in it, for context). You really have to have a real good discipline and idea how to write programs to make a reasonable choice in architecture. And if you do it’s ugly as hell anyways (using iterators for example is pain in the ass although you should do that). I just default to Rust, it’s so much more comfortable than C++ in pretty much every aspect, way better designed language…

Really learning new languages also helps thinking about architectures/laying out your code in other languages, and generally helps improving your technical skill.

permalink
report
parent
reply
6 points

Interpreted language != Compiled language

permalink
report
parent
reply
1 point

Sure, but it does get compiler behind the scenes to pyx files.

permalink
report
parent
reply
3 points

Cython is a better equilavent as it does compile to C while enabling Python syntax. No one is arguing C or C++ is the best language. I’d even argue a perfect language does not exist. Simple syntax could be argued on a line to line basis, but forced indents is uncomfortable for some, and Julia could be argued to be better in that area. I’m one to hope Julia can take off.

permalink
report
parent
reply
2 points

Yeah Julia seems to be just python but better (no GIL if I have understood things correctly).

permalink
report
parent
reply
1 point

And lack of forced indentations. Forced indentations gets on my nerves even if I already gotten used to it. These day, all I use Python is small code snip test, and it’s perfect for that as it strips out braces and other things which allows me to focus on a small code. I did used Python for slightly bigger things than that, but only to assist me with other coding languages, and I mainly used it for aiding into G’MIC scripting (Domain-Specific Language that is absolutely wonderful for raster graphics image processing).

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

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



Community stats

  • 3.2K

    Monthly active users

  • 1.8K

    Posts

  • 30K

    Comments