5 ms·
> C confers an understanding of pointers that will cause reference types in other languages to make a lot more sense I'm not sure what you mean by this. I know
by ZephyrBlu 4y ago
> C confers an understanding of pointers that will cause reference types in other languages to make a lot more sense
I'm not sure what you mean by this. I know what pointers are and I have not written C before. What understanding will C specifically give me which will help me understand reference types better?
> It'll also give you a good feel for what kinds of operations are costly and what kinds are not
Does this matter though? For most applications you don't need to understand what kind of operations are costly.
I am unusually curious so I'll probably learn about Assembly and low level operations out of curiosity at some point, but it's easy to imagine that I may not work on something where this would be useful knowledge or I would use this knowledge so rarely that the opportunity cost is not worth it.
For the vast majority of developers the opportunity cost for learning C seems quite high.
- WalterBright 4y ago> I know what pointers are and I have not written C before Actually working with them confers a lot more understanding of them. > For most applications you don't need to understand what kind of operations are costly. I've often been given the task to fix severe performance problems in other peoples' code who simply did not know what kinds of operations were costly. Having performant code is a significant competitive advantage. > For the vast majority of developers the opportunity cost for learning C seems quite high. Not if you understand pointers. That's what usually trips up people new to C. > it's easy to imagine that I may not work on something where this would be useful knowledge This may be hard to explain, but you don't know what you don't know. You won't be able to see an opportunity to exploit your knowledge gained from using C. To go back to the car analogy, most people drive a car with zero knowledge of how it works. This winds up being expensive for them, when it's time to deal with problems with the car. For example, the alternator shorted out in my car. I took it to the dealer for a repair, and they quoted me a fantastic sum including 2 hours of labor. I happen to know how the alternator works, and I've replaced alternators multiple times. I gave the service manager the step-by-step procedure to replace the alternator, and said it could be done in 15 minutes tops. The labor price quote dropped by more than half. It also turned out that they could get me a refurbished one for far less money, and since I understand what a refurbished alternator was, I was comfortable with installing a refurbished one. Anyone not knowing how cars work would have had no ability to bargain or understand the tradeoffs.
- ZephyrBlu 4y agoMany languages other than C have pointers though. It sounds like you are recommending understanding pointers moreso than learning C. > I've often been given the task to fix severe performance problems in other peoples' code who simply did not know what kinds of operations were costly What kind of application was this? I completely believe having this knowledge is valuable, but not for all developers. > This may be hard to explain, but you don't know what you don't know. You won't be able to see an opportunity to exploit your knowledge gained from using C This comes back to opportunity cost. You are stating this as though C is the only avenue to gain knowledge which can be exploited at a later date. For many developers there is probably other knowledge which is going to be far more useful and exploitable. Your story about the alternator feels like a good example of this. If I was in your shoes I would have paid the original sum and been happy. You've saved money, but you've also had to learn how an alternator works and replace them multiple times. I'm happy to pay a premium and use that time for other things.
- WalterBright 4y agoC is a small and straightforward language. It's easy to learn. It's the lingua franca of the programming languages (in that the foreign language interface of other languages is usually C). You're possibly expending more effort justifying not learning C than it would take to learn it :-) And once you learn it, as a professional programmer you'll garner a career's worth of benefit from it. Take the plunge. Learn how to swim, how to touch-type, how compound interest works, how to read a balance sheet, how to tie various knots, how to drive a stick shift, how to integrate and differentiate, how to unclog a drain, how to jump start a car, how to change a tire, how to write a program in C. As an old guy, I know these simple skills pay off in various and unexpected ways.
- Brian_K_White 4y agoThe alternator is a specific item example, a stand-in for a tax on everything in life 100 times a day every day. The arguments against learning fundamentals exist, but are weaker than the arguments for.