this post was submitted on 27 Jun 2023
10 points (100.0% liked)
Programming
13368 readers
2 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 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Tbh, A-B-problems are something super common if you work 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 reason 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.