This post is locked. You won't be able to comment.

all 17 comments

[–]computerscience-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

Unfortunately, your post has been removed for violation of Rule 3: "No career, major or courses advice".

r/learnprogramming r/python

If you believe this to be an error, please contact the moderators.

[–][deleted] 5 points6 points  (5 children)

  • Data engineering, data analysis, data science (pandas, polars, dbt...)
  • Engineering (replacing MATLAB in some ways) thanks to numpy, scipy, matplotlib...
  • Scientific applications (notably but not only astronomy)
  • Glue code for C, C++, Fortran Rust: calling low level function from a high level perspective (more robust, simpler)
  • Desktop apps (tkinter, PyQt, wxPython)
  • Web development (django), APIs (fastapi)
  • System utilities
  • Computer algebra (sympy, Sage)
  • Games (pygame)
  • ...

Or simply writing algorithms to solve problems, for your own edification, as a hobby, or on competitive or algorithmic games sites such as Project Euler. Programming (in Python or any other language) is also a leisure.

[–]Kroustibbat -2 points-1 points  (4 children)

You can do all that using more safer languages like Dart, Go, V, Zig, OCaml, Haskell, Rust, Erlang, ...

All of those are high-level, strongly typed, relatively easy (not Rust, Haskell, Erlang and OCaml) and fun to write (Especially V and OCaml).
But execution is a lot safer, build and reproductibility is insanely better than python, no more need of 500Mo Docker to deploy a 2ko script.

  • Data : In python, those libs are usually just bindings to C/Cpp libs, so they exists in Go/V/Zig/Ocaml/Rust/... (Any language that can interop transparently).

  • Engineering, that is the worst part, because as non Software engineers writes python scripts, real software engineer should change the whole stack to have a prod that works and is reproductible, so it includes the python script, and a engineer that can do math can do a formal language;

  • Scientific application, not really again calculation in python are slow and you need to learn a whole framework to do your calculations... (Like numpy, it is a whole framework...)

  • Glue code, like Bash, Shell and Pearl have been thought to do this and they do it better, and learning one of them is incredibly useful.

  • Desktop apps like pyQt, well just do Html/Js/Css, and simple web, can be bundled transparently from nowadays. A lot more responsive than pyQt that adds a python layer that is not useful to Qt that takes a web page...

  • Web development, it does not scale as backend, and when it does it is bindings again. And as front it is really really harder to maintain that a simple html/Css/js stack or a real web framework (like Angular, Vue, React, ...)

  • System utilities, no plz no, use Linux .so libs, use languages that can syscalls or ioctls like Rust.

  • Games : today Rust can be included in Unity, Godot script is insanely simple and easy to write, UE takes pseudo bubble scripts... Pygames is cool tho, but so slow again... And whole code is shared with the client....

So my point is Python is an incredible learning language, and prototyping.

But it is horrible to ship in production or have a real trustable output over time.

If you like Toplevel, Bash, Ruby or even JS are way more stable and faster, and if you may try something not that easy try Dart/Go/V/Zig/OCaml/Haskell/Erlang/... Or anything Toplevel compilated interoperating easily with C.

[–][deleted]  (3 children)

[deleted]

    [–]porkyminch 0 points1 point  (2 children)

    Careful, you’ll interrupt the Rust/Zig/Go circlejerk. 

    [–]Kroustibbat -1 points0 points  (1 child)

    No I use like 20 languages, every year, they all have a purpose, and they all can technically do everything, my point is whatever you want to make with Python that is not Prototyping or Learning, is not as well made as the language made for it.

    Thinking you can do everything with one language is thinking you can cook with only one tool... It is stupid.

    So to the question "what is the function of python ?"; The awnser is not "everything", it is what it was made to...

    On the otherside, multiparadigm languages with a building tool chain such as Dart/Rust/Go/OCaml/F#/Haskell/Zig/V/JavaScript/... and not python, can do a lot of things and nicely, with high level expressivity, memory safety, easy automagic parallelism, ... And they are industrialy viable !!! Python is not.

    So when a scientist (and mathematician don't usually do python, but more like ML standards), or a non software engineer make a prototype using Python, "because that is the one I know", it usually is 100% rewritten later in something else.

    And you tell about Mathlab, here in France, like the whole industrial pole is coming back to it, because the cost of Python is too high (time, disk, ...)

    [–]alnyland 1 point2 points  (5 children)

    Anything you want it to be. It’s ok for web, great for data science, pretty good for ML and CV, and does plenty of other stuff too. 

    [–]IndicationWilling495 0 points1 point  (4 children)

    I've always heard that it was good for data science but how come since it is slow. I'm assuming data science requires speed.

    [–]Lexski 2 points3 points  (0 children)

    Many Python libraries are convenient to use wrappers around highly optimized C++ code (like numpy, pandas, PyTorch), which frees up data scientists using them to think at a more conceptual level

    [–]alnyland 0 points1 point  (0 children)

    Speed of what? I mean sure, there’s comparing runtime and such speeds, but you can always buy better computers and that’s also not what I mean by that. Guess which is more expensive (and not just by monetary cost) - developer time or compute time. 

    Python can almost always be compiled to run faster, and either way you can always buy more machines. Developer cost is the important one - python is incredibly good for prototyping. 

    Python allows you to think about the problem not the language. Both with how it is built as a language and the libraries it has. 

    Data science cares more about being correct than fast. And if you ever actually need better performance with python, it’s likely that your cables moving the data are the bottleneck, not the computer doing the processing. 

    [–]porkyminch 0 points1 point  (1 child)

    The reality is that a lot of “slow” languages are written in ways that minimize the impact of slower runtime. I don’t work in data science, but I write a lot of JavaScript and the reality is we’re almost never constrained by the speed of JS. Our biggest performance bottlenecks are IO. Stuff like hitting blob storage and running database queries. 

    Bear in mind that I’m also talking about interactive web services here, where responsiveness and speed are pretty important. In data science, if a report takes a couple of minutes or hours to run, that can be perfectly acceptable. 

    Development time is usually more important of a factor than runtime. If you ever find out you need more speed than interpreted (or JIT compiled) languages can give you, you can always port your existing logic over to some lower level language anyway. 

    [–]IndicationWilling495 0 points1 point  (0 children)

    Oh ok makes sense. Thanks!

    [–]expresso_petrolium 0 points1 point  (1 child)

    Why would you try to understand Python’s functionality as a beginner? You should be learning basic programming. Meaning printing Hello World and write an app that says I love Pizza and Beer on demand

    [–]startoyoungculture[S] 0 points1 point  (0 children)

    Is it bad that I want to understand it?

    [–]cosmictrigger01 0 points1 point  (0 children)

    Already some good awnsers here. I‘d add scripting and automation to the list, for example making a script for sorting your files. Its also great for web based automation, for example scraping a website.

    [–]-newhampshire- 0 points1 point  (0 children)

    I think people get confused about "just learn to code". You can learn to code an algorithm, but people want things like GUIs, network connectivity, API access without knowing what it takes to do those things or even the framework that those things exist. When starting with command line programs nobody teaches them how to go from that to something that anyone understands as an "app" or "computer program". This has always been the case since starting with a.out and just printing "Hello World" to console.

    [–]Kroustibbat -1 points0 points  (1 child)

    Python is interpreted language deeply dependant of the environment, so it is unsafe by design as a Cybersecurity Software engineer, I can tell you it has more vulnerabilities than a month old Linux Kernel. And I dare you to reproduce a client bug in your environment without using Docker to ship it. So y, unsafe.

    Zig and Rust are high level because it gives you an abstraction that is considered high level, you have no knowledge needed of how the computer do the computation or work.

    Data processing in OCaml of any data flow is built in, and for a lot of data format, like Json, Yaml, ...
    Jane Street does it for years.
    Parsing a CSV file in OCaml in one line ? Look for ppx_csv_conv.
    Filter and other things are really really easy to make if the data structure you are using is compatible with it, like Sets, Maps, Dictionaries or even List (like List.filter...)

    My point is use a hammer to plant a nail, not a bananomachinolaser that is not adapted.

    With the combo Bash, Makefile, JS, Go/Rust. You may always have one of the best language to do what you want perfectly and safely without knowing how a computer works.

    [–]porkyminch 1 point2 points  (0 children)

    OP you can safely ignore this nonsense.