this post was submitted on 27 Jun 2023
10 points (100.0% liked)
Programming
13376 readers
1 users here now
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Why do you want to learn C?
This here might be an A B problem, so I'd like to check what is your goal, before recommending how to get into C. For most use cases there are much better options around nowadays.
Many of the use cases you needed C for in past decades now have better alternatives.
This is a primo StackOverflow style answer.
Tbh, A-B-problems are something super common in IT. So much time is wasted by going down the wrong road because someone comes to you with the apparent solution that they thought of, instead of just posing the problem they want a solution to.
In case of this post, there are quite a few reasons why the OP wants to learn C after learning a bit of Python, and some of them have C as the correct solution, some don't.
For example:
Especially the "C is faster" argument is often a trap for new programmers, since C is only faster if you really know what you are doing. C can also be much slower if e.g. you mess up memory management. Or, more common, C is not at all, because the rookie programmer gets stuck at arcane error messages that they can't fix.
In most cases the pure execution speed is not what is limiting the performance, but instead the algorithms and data structures used. For example, if you loop through a large array to find an entry it doesn't matter that the looping is 4x the speed, when you could also just use a hashmap/hashset, which will be orders of magnitude faster.