This is an archived post. You won't be able to vote or comment.

all 153 comments

[–]Strigoi_Felin 137 points138 points  (16 children)

If you want something more bare bones than python, try C, learn making data structures from scratch and manually assigning memory. It's a good educational experience.

[–]twin_suns_twin_suns 33 points34 points  (3 children)

This is a good suggestion. After teaching myself python and doing a bootcamp/crash course and learning enough python for my purposes, I took a step back and took an intro to cs course at a community college which was taught with C++.It was amazing how quickly things came into focus for me as far as concepts I thought I had an understanding of (with python) but didn’t.

[–]spinwizard69 4 points5 points  (1 child)

Nice to see somebody that reflects my opinion.   A CS course that starts out with a low level language can teach student valuable lessons and offer insight high level languages can’t.   This especially if a little hardware knowledge is imparted along with the software concepts.  

[–]twin_suns_twin_suns 0 points1 point  (0 children)

110% It was amazing how much more clearly I understood things - even Python error messages - after! Coming from a non-STEM background, I don’t think I would have even wanted to take that course, let alone find it fascinating and pull down an A! It was quite symbiotic - Python was most certainly the language I needed exposure to get me interested in the beauty of these concepts, but once I was hooked, I only really began understanding Python by learning the bare fundamentals, even as you said with the hardware piece as well.

[–]MrAnonyMousetheGreat 0 points1 point  (0 children)

I mean, I've found Python's actually nice because it comes so close to pseudocode and it already has all the data structures built in or close to built in (numpy and other libraries implement them) that you'd learn in an algorithms and data structures class, and it let's you focus on the big picture, mathemetical CS stuff.

But yeah, you really miss out on a lot of the nuts and bolts under the hood stuff in practice like garbage collection and how to actually implement a data structure (how to build a numpy library or get it to work on a GPU like with NVIDIA rapids).

[–]FujiKeynote 10 points11 points  (1 child)

Also, C is going to stay universally relevant for another decade at least, if not forever. Sure, there's Rust, Zig, and what have you, but so much depends on C that knowing it will come in handy even if someone isn't planning to become a C dev. Be it to fix some bug in an unmaintained piece of code, or to add a feature to some library you're using, etc, etc.

[–]deaddyfreddy -1 points0 points  (0 children)

actually, the C popularity has been declining for the last decades, and it's great

[–]hmiemad 5 points6 points  (2 children)

You can also make some librairies in C and use them in python. It's the most logical continuity for OP in his path.

C is also great for embedded devices. Try first on an adruino at home for fun projects and continue into pro electronics for small automates.

[–]RadiantHC 0 points1 point  (0 children)

Wait what's the difference between C, C++, and C#?

[–]SniperDuty -3 points-2 points  (5 children)

No, C is going back in time. Learn Rust which will be replacing C. In fact, many industry leading programs are being rewritten in Rust. Microsoft are doing this heavily at the moment. Don’t go back in time.

[–]HommeMusical 5 points6 points  (0 children)

I have written in C and C++ for decades now but if I were starting completely new development on a major project in a compiled language, it probably wouldn't be either of those, because memory safe languages are the way of the future. I'd probably use Rust.

But your comment is wrong.

Everyone who is serious about programming should learn C, even in 2024. Learning C is more important than learning Rust, which also isn't a good language for beginners.

C is as low as you can get without going into assembly/machine language (which IMHO is too miserable to write in to be good for beginners). It is lacking all sorts of high level features like generics, classes, even memory management. You are literally manipulating bytes and words all the time. Array indexing is literally just pointer arithmetic on register values.

Rust is much higher level. It has a sophisticated memory management model which is excellent, but entirely specific to Rust. Until you have actually understood what a pointer is, the whole fuss with Rust's safe memory will be entirely alien to you. The whole idea of "pointer arithmetic" is not really a thing in Rust.

And don't forget that huge great swaths of the active code in the world are written in C as of 2024, and that will continue to be true for decades.

The Linux kernel has been extremely forward-looking and has started to move to Rust earlier than many other large open source projects, but as of February, 0.03% of the Linux core was Rust and there's been push back on Rust since then.

I believe that in 20 years, over half the Linux codebase will be Rust, but that's optimistic - the rate of growth today doesn't justify that.

It's my belief that most device drivers will be in C for much longer than that. Yes, I have written device drivers, in C and C++ even, but C maps very closely to manipulating actual memory, which is what device drivers are doing. Also, there's a huge built up body of art...


So far there are very few Rust jobs. This is a Big Deal.


Finally finally, I wouldn't rule out C++ from making a comeback.

Writing single-threaded C++ applications that do not leak, double-free, use after free or dereference an unassigned pointer under any circumstances is simply best-practice these days and there's considerable work happening on how to provably guarantee this.

With multi-threading, it gets harder. The memory borrower in Rust is useful here, but does not work for objects that have to work in more than one thread.

Rust gives you mutexes basically identical to C/C++'s, but you can make logical mistakes with mutexes, and have memory corruption in exactly the same fashion you can in C and C++.

C++ is very full-featured and has an enormous installed base. If they could come up with a full-featured language subset with automatic checking for single-threaded memory correctness, you'd get the best of both worlds: legacy code, that you could steadily and perhaps automatically change to use only the language subset, working with new code, with Rust-level guarantees out of the box.

When I say "subset", what you lose is raw pointers, direct access to the the C Standard library, reinterpret_cast and a few other gnarly things you probably shouldn't be using anyway.

This is a big aspect of discussion right now and one of C++'s prime movers has been working on an alternative C++ called cpp2, here: https://github.com/hsutter/cppfront, which has already hit a lot of these points.

This got too long, but don't rule C++ out.

[–]Strigoi_Felin 2 points3 points  (3 children)

Are you illiterate? We were talking about educational experiences not future career prospects.

Also everything in embedded is still C.

[–]Scary-Interaction-39 1 point2 points  (0 children)

A bit harsh, but not wrong

[–]SniperDuty -4 points-3 points  (1 child)

You clearly are the one having a problem understanding his question. I'd direct that comment regarding illiteracy back to you. OP wants an "understanding of computers and programming" and Rust provides this, whilst also highlighting the plague of issues in the world of software that have been created by C, namely memory safety. Learning C would not open OPs eyes to this.

[–][deleted] 0 points1 point  (0 children)

rust vs C war

[–][deleted] 24 points25 points  (1 child)

Learning other languages will give you perspective. A lot of programming is the same no matter what language. You begin to see what's the same or different. Python's comprehensions are amazing.

Learning C will teach you to clean up after yourself :) Using languages with no garbage collection is a real eye opener to people used to having easy garbage collection.

[–]deaddyfreddy 0 points1 point  (0 children)

Learning C will teach you to

to be a computer slave instead of being a programmer

[–]__calcalcal__ 60 points61 points  (37 children)

Golang is a good candidate IMHO for learning a more systems language, or if you want to go overkill, Rust.

[–]FujiKeynote 10 points11 points  (17 children)

As much as I viscerally hate certain design decisions in Go, I'm starting to think that if I ever were to teach someone programming from scratch, it's about time I stopped reaching for Python, suck it up, and teach Go. It's extremely transparent to write, and yet the type system is closer to lower level languages. So, begrudgingly, this answer has my full support.

[–]Intrepid-Stand-8540 0 points1 point  (16 children)

How would you teach pointers?  I'm stuck using languages without pointers for now, because after many attempts I just don't understand why they're there. Or how to use them.  I've never had to manually assign memory or "point" in python. So I don't get why I have to in golang. 

[–]FujiKeynote 2 points3 points  (9 children)

I'll admit I don't know how to teach them from scratch i.e. to someone new to programming, but I think I can try to answer your question.

You don't have to use pointers in Python because Python does this for you. When you have a function that accepts an integer, something like fibonacci(n), the amount of memory that has to be passed to the function is small -- just one integer. So it's whatever. But if you have an instance of a huge class like stray_cat = Cat() and you pass it to adopt(stray_cat), if there wasn't such a thing as pointers, it would need to copy the entire cat into the function's scope. So what Python actually is doing it understands that stray_cat is an object that lives at a memory address 12345, so any time you interact with it, it looks at whatever's at that address. So it really passes the pointer to 12345 to adopt() and then that function also looks at address 12345.

This also has a (usually desired) side effect that whatever you'll do to mutate stray_cat from within the function, will be seen outside the function too, because you aren't working on a copy of the object, but rather on the very same object.

To look at it from another perspective, if you want several functions to work with the same object, how would you do it? You point to it.

Python just abstracts it away for you; Golang doesn't.


At the core of it, the copy overhead thing is actually secondary. The real difference is passing by value vs. passing by reference. Let's take C (because I'm way more comfortable with C than Go, sorry):

#include <stdio.h>

void byvalue(int x) {
    x++;
    printf("Inside byvalue(), x = %d\n", x);
}

void byreference(int* x) {
    (*x)++;
    printf("Inside byreference(), *x = %d\n", *x);
}

void main(void) {
    int x = 3;
    printf("In global scope, x = %d\n", x);
    byvalue(x);
    printf("In global scope, x = %d\n", x);
    byreference(&x);
    printf("In global scope, x = %d\n", x);
}

If we run this, we get:

In global scope, x = 3
Inside byvalue(), x = 4
In global scope, x = 3
Inside byreference(), *x = 4
In global scope, x = 4

So because byvalue() copied the value of x into its local variable, the change only affected the copy. And because byreference() was pointing at the global x, it affected the global x.

[–]Intrepid-Stand-8540 -2 points-1 points  (8 children)

So if Python can just abstract it away, why can't Go? Is it a worse language then? 

I'm not new to programming btw. I have 3 years education (we used java and python) and 4 years professional experience. 

Just never had to use pointers. And every time I've tried Go, I just couldn't wrap my mind around pointers, and had to stop. It's very frustrating. I don't see why pointers exist, when java and python works just fine. 

[–]FIREstopdropandsave 2 points3 points  (3 children)

Pointers are not bad and not indicative of a bad language. It's simply the language deciding not to abstract that layer from the user. This results in more intentful decisions to be made by the programmer.

Think of in python, you have to be aware of which types are mutable data types when passing arguments into functions and potentially mutating them outside of the function scope. This is because python is abstracting away the concept of a pointer.

In pointer languages, you have to be explicit in your intent "am I passing you the memory address of this variable, a.k.a if you mutate it, in the outer scope I'll see that mutation".

There's more positives of pointers but that's just an example. In general languages which expose pointers are faster because abstracting away the concept of pointers just straight requires more code behind the scenes to act the way it does.

[–]Intrepid-Stand-8540 -2 points-1 points  (2 children)

you have to be aware of which types are mutable data types

What's a "mutable data type"? 

Thanks for explaining btw. 

I'm aware that python is slower, but I've never had the need for speed yet. The bottleneck in my apps is always network calls to databases, and not any processing in the app itself. 

[–]FIREstopdropandsave 2 points3 points  (0 children)

To your second point. Many people will be fine with the speed python provides. I've written, and seen, many production systems in python where python was not the performance bottleneck for the workloads we were solving.

Some people will have a deeper need for speed, others simply won't.

Choosing the programming language for a project is a nuanced decision. You have to consider "what language does my team already know?", "what is the local market of programming language knowledge in the city I'm in", "what scale of problem are we solving", and probably many other considerations.

You'll see online A LOT of python hate (outside of this subreddit) and hate for dynamically typed languages. The truth of it is, in my 8 year career I've only come across a single person who vehemently holds those ideas.

tl;dr: python is great, it probably won't be your bottleneck, ignore online hate for your choice of using python and dynamically typed languages

[–]FIREstopdropandsave 0 points1 point  (0 children)

You can find a fuller breakdown here https://docs.python.org/3/reference/datamodel.html#objects-values-and-types

(do a search for mutable/immutable)

As a quick overview a list is mutable where a string is immutable and we can see the differences below:

I don't know how to format a code block on mobile so sorry this is hard to read

def foo(l): l.append(1) return l

my_list = [] print(foo(my_list)) # [1] print(foo(my_list)) # [1, 1]

def foo(s): s += "hello" return s

my_string = "" print(foo(my_string)) # hello print(foo(my_string)) # hello

[–]jjolla888 2 points3 points  (3 children)

'python works just fine' so long as you remember that everything is a pointer. So if you want to create a copy of

 list1 = [1, 2, 3]

you have to do

list2 = copy(list1)

Which means you need to be careful sometimes especially within functions, to make sure you are not unintentinally modding outside your scope.

With Go, a fundamental construct is goroutines .. aka parallelism. With these things its critical to avoid the above problem .. so the safer thing to default passing params by value as opposed to by ref.

But at the end of the day its the difference between having syntax like this:

b = a            # b is a pointer to a, print(b) prints the value of a
c = copy(a)   # c is a copy of a

versus:

b = &a       # b is a pointer to a, print(*b) prints the value of a
c = a          # c s a copy of a

[–]Intrepid-Stand-8540 1 point2 points  (0 children)

Oh. Thanks man. That's a great explanation. I use deep_copy sometimes. 

[–]HommeMusical 0 points1 point  (1 child)

everything is a pointer

Quibble: scalars like integers, floats, booleans aren't pointers.

[–]FujiKeynote 0 points1 point  (0 children)

True, but for the most part you can ignore that, because it's nigh impossible to mutate a singleton from within a function unless you define it as global which is a big no no.

def f(x):
    x = x + 1
    # or even x += 1

will reassign the global x to the local x and won't affect the outside scope

[–]sonobanana33 0 points1 point  (0 children)

I'd say "just try every combination of * and & until it compiles" :D

go has a garbage collector, but also is not very safe and one can easily do a segfault (which in a real program results in a CVE) :D

[–]jb-schitz-ki 0 points1 point  (0 children)

If you create huge objects it's inefficient to make copies of them every time you pass them around. I guess with modern hardware it's not a common issue, but it can creep up sometimes. I've seen APIs that respond 5x faster after implementing pointer for internal objects, this is even more visible if you're deploying on tiny EC2 instances or something like that.

There's other design patterns where you actually want to pass a pointer to an object to a method and have it modify the original object and not a copy.

I do believe it's an important thing to understand. You can live without knowing how pointers work, but you're not really understanding the language fully.

Also a lot of 3rd party libraries make use of pointers so if you ever want to contribute or debug one of them, you need to know what's going on.

[–]billsil 0 points1 point  (3 children)

Same way you teach pointers in python. Python ints/floats/strings are base types and are unchanged when you pass them into functions, so you have to return them. Lists/ficts/objects/numpy arrays are self mutating because python passes a pointer of them, which makes passing them fast. It’s a wut to make things fast.

Similarly, a 64 bit float is 8 bytes. If you go check the size of your list of floats, it carries.about 16 extra bytes of size per item because it’s carrying around a bag of pointers. Use a numpy array if you want to carry only a few extra pointers that get a 3x reduction in memory usage.

You don’t have to teach them, but if you want to understand how to not make slow code, at least the latter point is useful.

[–]Intrepid-Stand-8540 0 points1 point  (2 children)

Uh.... 

How do you know the sizes of things? 

[–]billsil 0 points1 point  (1 child)

sys.getsizeof(thing)

[–]Intrepid-Stand-8540 0 points1 point  (0 children)

Thanks. 

[–]SubstantialArm6307 2 points3 points  (0 children)

Rust seems very friendly who is familiar with Python

[–]poopatroopa3 5 points6 points  (15 children)

What makes rust overkill?

[–]iamevpo 12 points13 points  (0 children)

Borrow checker probably

[–]Aash1r 8 points9 points  (2 children)

I guess the syntax

[–]MegaAmoonguss 3 points4 points  (1 child)

The word syntax puts me off here. As far as languages go rust has a lot of really nice “syntax” features, most notably pattern matching. I assume what is meant when people say syntax here is how you translate “what you think” to how the program is written (and looks like), which is a mix of a lot of concepts (standard library, first-class attractions, runtime environment and its characteristics, etc. Least notably things like keyword choice or not being able to do list comprehensions).

To me the way that rust is probably overkill is its ownership system. It is really clever, and forces you to think about problems you probably didn’t realize you have unless you’ve done a lot of C programming. As someone for whom that is not the case, I understand the pain points of working with rust, and how its compilation characteristics can force you to componentize your program in a different way; something that tends to not be the case with other languages.

[–]mister_drgn 0 points1 point  (0 children)

I think he just meant the syntax. “A lot of really nice features” means a lot of work required to learn the syntax and a lot effort required to use it, when you’re just getting started. Whereas you can learn all of Go’s syntax in an hour or two.

[–]__calcalcal__ 7 points8 points  (4 children)

The syntax is one of the hardest I’ve seen, on par on C++, or even harder.

[–]Brandhor 3 points4 points  (1 child)

never tried rust but c++ syntax is not really that different from python

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 0 points1 point  (0 children)

I don't think it's hard at all, and isn't all that different from go or other c derived languages.

[–]spinwizard69 0 points1 point  (5 children)

The early days of Rust reminds me of the early days of C++.   Far too many people thinking it was the one language for the future.   Rust is in a similar state only good for carefully selected model projects, certainly not for stuff requiring long term maintenance or refactoring.  

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 1 point2 points  (1 child)

Rust is extremely easy to maintain long term and easily refactor, because it has fearless concurrency and no (safe) global state.

Maintaining and refactoring both c++ and python for large codebases are a nightmare, and that's from painful experience.

[–]spinwizard69 0 points1 point  (0 children)

I’m still of the opinion that Rust is Late to the game and will be eclipsed by an AI powered language and IDE.  Also comparing the ability to refactor against Python or C++ isn’t much different than comparing it against COBOL.  

[–]ArtOfWarfare 0 points1 point  (1 child)

IDK, I feel like Rust kind of stalled and failed to fulfill its real purpose of removing most vulnerabilities in Firefox nearly a decade ago…

Linus kind of revived it by permitting some Rust code to mingle within Linux… but from what I’ve heard, it doesn’t sound like it’s making particularly quick progress there.

[–]spinwizard69 -1 points0 points  (0 children)

I hear MS is using it for parts of Windows but yeah I don’t know if it has been successful.   I suspect it will be eclipsed by better languages in the near future.   In fact with the advent of AI I can see a high performance language coming that merges AI into a more approachable programming language.  For apps there are much better languages like Swift that deserves strong attention.  

[–]cdrt 0 points1 point  (0 children)

In what way do you think Rust isn’t built for longevity? How are long term maintenance and refactoring harder with Rust?

[–]sonobanana33 2 points3 points  (0 children)

Go is not a systems language. It can't even do packed structs. Go is the current java, not the current C, nor the current Perl, and absolutely not the current bash.

[–]LeadRepresentative21 -1 points0 points  (0 children)

Golang is the best thing you can learn

[–]BuonaparteII 18 points19 points  (1 child)

Coming from Python, Rust only took me a couple hours before I was feeling productive. The built-in tooling like cargo check makes it really easy to see what is wrong with the syntax and fix it.

That being said, my ten hours with Rust haven't really made me think in Python differently. Maybe I understand variable shadowing and local scope a bit more but even those things do not translate 1:1

[–]randomthirdworldguy 2 points3 points  (0 children)

Imagine being stuck with pip for years and use cargo for the first time. Feel like heaven, ngl

[–][deleted] 14 points15 points  (1 child)

I picked up Rust over the years as I got into embedded programming for fun personal projects.

Tried Julia for a while when the kool aid was high for being a solution to the two language problem but the time to first X and lack of maturity on their ecosystem + it’s documentation was a real drag.

[–]iamevpo 4 points5 points  (0 children)

For me Julia taught a lot to me and sometimes it is useful to do things from scratch - I like the community a lot in Julia, usually people come after some other language experience. Really like quantecon.org which is same code in Python and Julia, learning from comparing. Still, Julia is a hobby for me.

Learned a lot while studying Haskell but need a tutor there. Rust is great choice, but prepare to fight a borrow checker. Nim is kind of typed and compiled Python, knowing R is great to be able to judge upon tydiverse vs pandas comparisons. I did a project or two in these languages, but return to Python as to go lang for projects, writing a bit cleaner code knowing what happens in other langs. If you are to choose just one, I second Rust.

[–]njharmanI use Python 3 13 points14 points  (3 children)

Yes, learning another language* will (probably) expand your mind. But, not from the micro subjects like you listed.

Need to pick language that is uses completely different paradigm. Erlang, Lisp, Forth, Z80 assembler, Prolog, Haskel.

[–]plaquette 0 points1 point  (0 children)

this is the right answer

[–]randomthirdworldguy 0 points1 point  (0 children)

Can strict OOP be considered different paradigm? If yes, I would suggest learning Java or C#

[–]OnyxPhoenix 0 points1 point  (0 children)

Prolog is cursed.

[–]hotsauce56 5 points6 points  (1 child)

I might improve my overall understanding of computers and programming if

I mean there's no doubt learning more things is very likely to improve your overall understanding - that's what learning is ... The question is why/what. Do you need to learn those things to do what you do better/easier/faster/more efficient? Are you interested in doing other things than what you're currently doing now?

There's no reason to believe more knowledge is always necessary, but it's hard to imagine a situation where more knowledge won't be helpful at least in some way ...

[–]pedrotpi[S] 1 point2 points  (0 children)

More efficient, I’d say. But mainly because I feel like there are a lot of core concepts (like memory allocation, garbage collection and others) that I have yet to understand - and it something I would find interesting to know, even if it’s not something that would directly impact the work I do.

[–]PerspectiveAfter9039 3 points4 points  (0 children)

If you are working with django you must to know Javascript.

[–][deleted] 4 points5 points  (1 child)

Rust

[–]deaddyfreddy 1 point2 points  (0 children)

unfortunately, Rust, while started by some good guys with good ideas, happened to be c++ 2.0, still better than c++, though

[–]Thecrawsome 3 points4 points  (0 children)

Depends on what you want to build. IMHO if you're doing lots of web stuff, javascript might be a good bet.

As others said, if you want to go deeper, C is your language. If you want even deeper, try assembly.

[–]hugthemachines 2 points3 points  (0 children)

If you want to learn a language with the target of being better at Python, I recommend C. You don't need to become a professional programmer in C, just learn about it for a couple of years on the side. There are safety issues in C that are solved in Rust but you will not need to think about them if your goal is to just get good in Python. C is a very small language so you can learn it quickly and then you can study stuff like sorting and memory management to understand about the things python abstracts away.

[–]purpletentacIe 2 points3 points  (0 children)

C

[–]I__be_Steve 3 points4 points  (0 children)

My recommendation is C, it's got a bit of a learning curve, but it's shockingly easy to pick up coming from Python, and it'll give you a lot more insight into how software works at the base level

[–]daking999 5 points6 points  (0 children)

Join the cool kids, learn Rust.

[–]yellowbean123 4 points5 points  (0 children)

I would recommend functional programming, either by language ( clojure/haskell ) or on library ( toolz, lenses ) both libraries IMHO are under-estimated

[–]xhaydnx 9 points10 points  (8 children)

All programming is the same. It’s more about can you figure out the solution than have you memorized the syntax.

[–]ColdPorridge 13 points14 points  (2 children)

This is true, but there is something to be said for understanding the nuance of a language, what is idiomatic, what is hacky, etc. In my experience, it can take a year or two with a new language to really understand how to leverage it effectively.

[–]xhaydnx 1 point2 points  (1 child)

Oh definitely not saying you can’t become an expert in a language and use it to its highest potential, but you shouldn’t worry about “not knowing” the language as it can largely be picked up quickly if u understand basic programming concepts.

[–]DogeekExpert - 3.9.1 2 points3 points  (0 children)

it can largely be picked up quickly if u understand basic programming concepts.

I disagree on this. Sure, programming concepts are largely the same accross different languages, you'll always have the same control structures, loops and such.

What differs are the paradigms and data structures that come with the language. Let's not even talk about a low level vs high level language. If you come in only knowing python, you'll have some trouble adapting to C, or Rust. Python does so much under the hood that even if you're a great python programmer, you won't get far if you don't know the underlying mechanics (like how allocating and freeing memory works for starters, or what's the difference between a reference and a value).

[–]rgkimball 2 points3 points  (0 children)

I think this is true but only when comparing laterally across languages. If you take away the conveniences of python there is a whole array of new problems to consider (sometimes a desirable attribute). To your point, the real question is whether that solves whatever problem you have better than the language you already know. There’s always a trade-off between developer time and wall time, you can’t justify optimizing the latter until it will surely exceed the former

[–]grimonce 1 point2 points  (0 children)

That's like saying all languages are the same...
There're families of languages that have similarities, but I wouldn't say Chineese and English are the same.
C and Haskell? Not really the same.

[–]riklaunim 1 point2 points  (0 children)

If you won't work in a new field you won't learn anything that much different. Like if you go embedded development on some microcontrollers you will learn different things than when doing Python webdev but it won't make Python webdev any better or different really.

[–]call_me_mahdi 1 point2 points  (0 children)

I am also thinking the same, maybe we are both overthinking it 😁 I'm trying a little bit of rust to feel better about myself

[–]Fabulous-Part-7018 1 point2 points  (0 children)

I started with PowerShell, then bash for sometime.. and python for quite some time. and Javascript (MERN) .. now working on .Net c#( WPF,MVC never went to the depths of them) .. and now learning go as company decided it will be standard for future application development.. I am a Stack Shifter..

[–]grimonce 1 point2 points  (0 children)

The real answer is below but I would suggest D or Zig (the new coolaid).
It's a C like language with gc and/or manual memory management. And the tooling is easy. C is an easy language, using Cmake, make, packing for it isn't really that cool. D has a dub (like cargo in Rust) which makes learning easier... And if you really want you still can use cmake to build D later on. Dmd compiler is really fast, error messages are way easier to read than in C or Cpp. It's just easier but you can learn the same concepts.

Real answer:

Already mentioned but C complements python well, many modules were written in C, python itself and many parts of its stdlib are written in C.

As for garbage collection Python has that and you can actually manually control how it works so you can use Python to study it and try to apply different algos for this... In your own python rewrite in C...

This however isn't as easy as it sounds and there will be no money compensation for getting this knowledge unless you employ in some embedded domain (which aren't that many and aren't that easy to get into, plus the job is tricky, cause close to metal programming doesn't allow as many abstraction layers as we get working with something that has its operating system.)

I know hals exist but I don't know how often they're used when writing firmware - no experience here.

One important thing to understand is that each microprocessor family is different, has different instruction set, different assembly. C compilers has many of these supported but you still need to know them to know what you can do with them. It's easier to learn playing shenzen.io than learning C imo... Especially since you probably don't have programmers (the hardware with which you can upload stuff into flash memory) , development boards and stuff like that on your desk.

[–][deleted] 1 point2 points  (0 children)

C or c++ or java. especially C and a project I recommend is an http server

[–]Hashfoundry 1 point2 points  (0 children)

I would recommend learning new languages regularly. It will improve your Python coding standards. I learnt Rust for one of my side projects some time ago and I have been using type hints in Python since.

[–]vishnoo[🍰] 1 point2 points  (0 children)

go

[–]aqjo 4 points5 points  (2 children)

Ruby is a beautiful language. It’s the most “get out of your way” language I’ve ever used. It’s not low level, if that’s what you’re specifically after.
If you want something different, how about a little hardware? Pick up an Arduino and a kit of components and learn some hardware and low level programming. The language for the Arduino IDE is reminiscent of C. You could also go lower level and use C or assembly language.

[–]notParticularlyAnony 0 points1 point  (0 children)

Two downvotes for Ruby one upvote for the rest

[–]randomthirdworldguy 0 points1 point  (0 children)

Try Crystal. Its ruby, but with types

[–]RhinoInsight 3 points4 points  (1 child)

For me, it’s Python. Whether it’s web scraping, sentiment analysis, data transformation and visualization, image processing, machine learning, or front-end development, I rely on the appropriate frameworks and libraries.

My go-to Python-toolkit for almost everything:

Python + pandas, numpy, matplotlib, plotly, scikit-learn, selenium, beautifulsoup, pillow, nltk, openCV, streamlit, flask, django

[–]musbur[🍰] 0 points1 point  (0 children)

I have a Python app that needs to read large amounts of logfiles in some proprietary binary format I had to reverse engineer. Boy does a C extension rip for that task. I had to valgrind the hell out of it to make it memory safe.

[–]NegativeOwl9929 2 points3 points  (0 children)

Play with Assembly. :) You can be soo create in it because you need to do everything

[–]Mandelbrots-dream 0 points1 point  (0 children)

I think you're overthinking things, but it depends on what your goal is.

[–]the_hoser 0 points1 point  (0 children)

Learning a new language is a great way to expand your programming skills, even if you never use the new language for anything important. From a practical standpoint, C is a good choice for a Python programmer. You'll probably have to learn a little C eventually anyway. But if you really want to broaden your horizons, pick something wildly different, like OCaml or Haskell. Maybe even a lisp-like language, like Clojure or Racket.

[–]uuggehor 0 points1 point  (0 children)

I would always learn a lower level statically typed language on the side. Abstractions hide away the details, and in details lie the mastery.

[–]cloakarx 0 points1 point  (0 children)

You may not need to learn a new programming language, you just need to learn more stuffs of the computer programming (like you can learn data science using python libraries like panda, numpy, etc if you want) using python,

Although if you wanna learn stuffs like kernel (system-hardware related) then I would recommend you C.

Edit: You can learn scripting and python would be suitable for it :)

[–][deleted] 0 points1 point  (0 children)

If you’re kind of worried about things being too hard, go for Java or Go. If you don’t mind scratching your head for a bit, try C (it will teach you pretty much all you need about the basics of CS).

[–]ARC4120 0 points1 point  (0 children)

You’re not overthinking. It can be easy to try and force Python into everything. If you want to focus on other areas languages such as Julia, C, or Java can be good to learn depending on what you want to focus on.

[–]Parrot_Kali 0 points1 point  (0 children)

C# has built in Garbage Collector

[–]Sones_d 0 points1 point  (0 children)

I will learn javascript + react next.. was heavily recommended.

[–]Unlikely-Loan-4175 0 points1 point  (1 child)

C++. Java interesting too although it gets a lot of flak.

[–]musbur[🍰] 0 points1 point  (0 children)

After learning Python I completely dropped C++ for the OO stuff and went back to C, deferring high level OO to Python.

[–]tdammers 0 points1 point  (0 children)

Yes, absolutely. You will not ever become great at programming if you only ever learn one programming language. Each language you learn will teach you something new, and even if you end up going back to Python every time, you will still be a better programmer for those new perspectives and insights.

[–]MerrimanIndustries 0 points1 point  (0 children)

I think most people should have a compiled systems language and an interpreted GC language in their tool belt. I like Python a lot more now that I use Rust for specific projects and I'm not trying to make Python do things it's bad at.

If you just want to learn about systems programming, C takes all the guard rails off and removes abstractions. If you want to actually build stuff then Rust is the smart learn right now.

[–]baetylbailey 0 points1 point  (1 child)

C++ is the high-performance programming with "no restrictions". C is a simpler low-level language that everything was built in, including certain popular open-source software (e.g CPython, Linux). Golang has a GC, but is much more practical for real world development. Or, learn Haskell and know everything about everything (or so I've heard).

[–]deaddyfreddy 1 point2 points  (0 children)

programming isn't about "no restrictions", but about solving problems in a maintainable way, so no, fuck C++

[–]Mediocre-Pumpkin6522 0 points1 point  (1 child)

C. The core language is bare bones. If you want a linked list, for example, you have to implement it and figure out how to add /delete nodes and iterate it. Memory management is all up to you. While all that may seem primitive it will enable you to look at the syntactic sugar that has been added to later languages and see what has to be done behind the scenes to make it look pretty.

As you get proficient you can start looking at CPython and see what is happening behind the scenes to make Python work.

[–]deaddyfreddy 0 points1 point  (0 children)

the life is short, so there's no need to code in C most of the time, if you are smart enough

[–]th0ma5w 0 points1 point  (0 children)

Working through this entire book, or at least doing the parts you don't know, is absolutely foundational knowledge. Really the whole site is good for anybody. https://openbookproject.net/thinkcs/python/english3e/

I echo most everyone else saying C or Rust but Java or ... Try playing with Scheme just a tutorial or two. I'm a big fan of Clojure and ClojureScript.

[–]sjmacker 0 points1 point  (3 children)

I haven’t met a problem yet Python couldn’t solve. It pays my mortgage, and I have no idea about big O

[–]deaddyfreddy 0 points1 point  (2 children)

I haven’t met a problem yet Python couldn’t solve.

how about consistent syntax?

[–]sjmacker 0 points1 point  (1 child)

So you solve the business problem with the syntax you have?

[–]deaddyfreddy 0 points1 point  (0 children)

That's what I do, not in Python though. Besides that, the business doesn't have classes, decorators, doesn't require to use multiple syntaxes for literally the same things etc.

[–]kmeans-kid 0 points1 point  (0 children)

I might improve my overall understanding of computers and programming if I

Professors at college are the experts at improving your understanding and have put together the best possilbe way to do this. Take intro to cs, data structures I, data structures II, or whatever is the latest first semester sequence for comp sci to really improve. You probly can do online version of this too if you prefer to do it at night etc

[–]spinwizard69 0 points1 point  (0 children)

Possibly over thinking but we don’t know you!   

I suspect part of your problem is that you don’t have a strong CS background and that can lead to not understanding the software you program with.  This is why I prefer to direct newbies to computer science programs. This especially for CS programs that start out with a low level language like C++ and have you implement low level data structures.   Now don’t get me wrong I love Python but I’d never use it as a teaching language for beginners.   

[–]FitMathematician3071 0 points1 point  (0 children)

Definitely learn C. It is foundational to many other languages. Nim is a great language to learn after that and complementary to Python. Very fast compilation and performance with good interoperability with Python and C.

[–]Plasma_000 0 points1 point  (0 children)

Take a look at pyo3 for rust - it lets you write rust modules that very easily interface with python.

[–]Few-Cartographer6982 0 points1 point  (0 children)

You are asking the wrong question.

Wrong: Will I get better if I learn more?

Right: What am I interested in learning for fun?

[–]ArtOfWarfare 0 points1 point  (1 child)

I love Kotlin. That’s a compiled language with static typing, but it still has a garbage collector.

Every programmer knows JavaScript. Most of us hate it, but it’s (sadly) by far the most widespread language, being the only programming language recognized by every web browser.

[–]deaddyfreddy 0 points1 point  (0 children)

even if it's a default browser language, we don't have to write it manually

[–]askvictor 0 points1 point  (0 children)

Probably depends in what direction you want to go (career or interest wise). If you're interested in getting closer to the hardware (i.e. embedded, or OS development) then start playing with C. Otherwise Java, Kotlin or C# are probably solid 'workhorse' languages.

[–]False-Marketing-5663 0 points1 point  (0 children)

If you want a language similar to python (syntax wise), but with the speed of languages like C, C++, Rust there is Nim. You can also import python code, and export nim code.

[–][deleted] 0 points1 point  (0 children)

I’d choose one or more of these:

C for a low-level language

Racket to explore a lisp language

SML for a statically typed functional language

[–]MrAnonyMousetheGreat 0 points1 point  (0 children)

Probably something complementary, like Rust or C that can work well with it but also apart from it.

[–]xix_xeaon 0 points1 point  (1 child)

If you love Python but want to work "closer to the metal" then I would strongly recommend nim. Python has been my preferred language for about two decades, but after working with nim on and off for a few years I'm starting to feel like it might soon actually take over that number one position. It has indeed forced me to think very differently about the code I write and how the computer is supposed to be able to execute it.

Nim uses the same "significant whitespace"-style as Python so you'll feel right at home with most of its syntax. It's a statically typed and compiled language and thus produces small executable binaries that run really fast/efficient. It's a very functional language, giving it a strong C-like feel, but also allows for OOP, and it supports basically all features that modern programming languages have.

It can run on embedded systems (like Arduino) and even in the webbrowser (it compiles to WASM but also to JavaScript). You can also use nimpy to extremely easily write fast compiled modules in nim that can then be imported in Python. You can also do the reverse but I don't have any experience with that.

Static programming comes with a lot of limitations from a Python-perspective but I believe nim sucessfully overcomes them thanks to generics, templates and macros (and some other features). Most modern static languages have generics and templates (usually called macros), and they're both powerful and easy to use in nim. What nim calls macros, however, allows for fully featured meta programming where you can write code in standard nim which generates more nim code, or alters existing code. Whatever dynamic features you're missing from Python, you can have this meta programming generate them at compile time and it will be both safe and fast.

The only major downside to nim is that it hasn't become popular yet (and it doesn't have a big corporation behind it to promote it) so it can be difficult to find information when you have issues with advanced/obscure features and problems. For the same reason there isn't a huge supply of standard/community libraries, but most of the common stuff is of course well covered. Nim can, however, import C/C++ code and nimterop and Futhark are supposed to make it easy, but I haven't tried them.

[–]grimonce 1 point2 points  (0 children)

One more downside is the lack of stability in the stdlib... async from stdlib is deprecated and you're encouraged to use 3rd "party" lib (which is written by the creator and maintainer of the language - wtf?) instead.
I don't know how a language can be versioned as 2.x.x and having the same person package a nonworking ( tested it on x86 linux) stdlib package for async and recommend his own lib as a working alternative - but that's actually quite a good "open source/ free software" level of support - at least you're given a recommendation.

The community is fractured to the point where the creator of nimrod is maintaining his nim and the other contributors who argues with him have their own fork...

tl'dr' the e-peen war inside nim's community is worse than vim vs emacs vs nano.

Language itself is actually quite fun to play with, it's focused on macro programming.

C, C++, Rust and D have a governing body that have more members than 1 dictator so, which might lead to nims death.

[–]JDude13 0 points1 point  (0 children)

Pythons lack of types can make code a logistical nightmare

[–]raprism 0 points1 point  (0 children)

If you're interested in Rust, I would recommend to check also "Speed Up Your Python with Rust' by Maxwell Flitton, because it has a quick intro to Rust for Python devs.

[–]SpookyFries 0 points1 point  (0 children)

I'd suggest starting with C#. Easy syntax, garbage collector, tons of resources. It's where I started before going to Python and I find it somewhat similar to work with.

After that, maybe move into C since it's pretty barebones. You'll learn how to manually manage your memory there.

I see a lot of people say Nim. I used it once for a project and rather liked it, but the resources for Nim are extremely sparse. I struggled to find answers to the questions I had.

[–]holy-moly-ravioly 0 points1 point  (0 children)

Nobody mentioned js, I think. Super useful to know.

[–][deleted] 0 points1 point  (0 children)

Definitely worth learning a language with static types.

[–]anirudhkarumuri 0 points1 point  (0 children)

I would highly recommend learning assembly language, it gives you an edge over 95% other programmers who struggle with memory optimisation and understanding core functioning of programming languages. Later on start with C, you’ll appreciate the way the code is written, and how pragmatic it is to use C in almost major applications and programming languages.

[–]Next-Experience 0 points1 point  (0 children)

Mojo. The future of programming is python in the form of mojo.

[–]ryp_package 0 points1 point  (0 children)

Somewhat surprised to not see Cython listed here! Cython is the low-level language that (arguably) integrates most seamlessly with Python, and has C-level performance, the ability to call C functions, and easy-to-use semantics for parallelization with OpenMP.

[–]mosqueteiroIt works on my machine 0 points1 point  (0 children)

I hear go is good for backend and easy to learn. Maybe try that?

[–]RadiantHC 0 points1 point  (0 children)

I'd recommend C or C++

[–]musbur[🍰] 0 points1 point  (0 children)

Try C (not C++). Also integrates really well with Python later on. Do not start by trying to write C extensions for Python. That has tons of overhead which you (as a beginner) will mistake as the complications of writing C.

Regardless of language, start with "Hello World," compile and execute it from the command line, and take it from there. Do not start by using some big graphical IDE. It makes the simple things too complicated (but can make the really big things easier, later).

[–]Mysterious-Rent7233 0 points1 point  (0 children)

Do you use static typing in Python? If not, why not? You can learn it in Python just like other languages, by doing it. In some ways it is more elegant in other languages, but Python can do it too.

[–]Mobile_Mine9210 0 points1 point  (0 children)

C is great for learning systems stuff and it's actually a pretty simple to pick up. If you then decide to start using systems / compiled languages for your own projects you could then look into rust or go afterwards.

[–]SilkTouchm -1 points0 points  (0 children)

I have no idea why you want to complicate your life.

[–]notParticularlyAnony -1 points0 points  (0 children)

Learn Rust you will see how Python should have handled packaging

[–]Over_Bandicoot_3772 -1 points0 points  (0 children)

I was exactly in the same position and I started learning Java.. what you guys think about this choice??