5 ms·
Time is finite. Learning C is not necessarily aligned with everyone's goals or path. For example, if I care more about building products than low level software
by ZephyrBlu 4y ago
Time is finite. Learning C is not necessarily aligned with everyone's goals or path. For example, if I care more about building products than low level software it's probably not worth learning C unless I happen to be interested in it.
- delusional 4y agoTo me that seem akin to saying "if you just care about running it's probably not worth learning to walk" It is always "worth it" to understand the machine you are manipulating, and no matter what you think about the C virtuel machine, the very real machine in front of me has been shaped by its relationship to C.
- ZephyrBlu 4y agoThe difference is that you could go your whole career without needing to touch C, whereas to run you must walk. > It is always "worth it" to understand the machine you are manipulating Why is it always worth it? If I want to be a product/creative developer how does learning C specifically help me?
- WalterBright 4y agoC confers an understanding of pointers that will cause reference types in other languages to make a lot more sense. It'll also give you a good feel for what kinds of operations are costly and what kinds are not. It's like knowing how your car works will make you a better driver. You'll be able to get more out of the car, it will last longer, and when it breaks you'll know if you can't move another inch or you'll know how to nurse it home.
- 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.
- xigoi 4y agoThere are languages that have pointers and don't require understanding a bunch of random arcane rules just to declare a variable.
- WalterBright 4y agoC's problems stem from its simplicity, not its complexity.
- xigoi 4y agoThey stem from both.
- scoutt 4y ago> Why is it always worth it? If I want to be a product/creative developer how does learning C specifically help me? I am going answer you with some questions! What is a product for you? Are a dishwater, a car, a keyboard, a smart LED lightbulb some kind of product a human can build? A product with some sort of microcontroller? How many products like that there are in your room, house and office right now? What about in the whole world for the past 20 years? In all of those products there is probably C running!
- ZephyrBlu 4y agoI thought it was obvious from context that I was talking about software products. This is what I mean by a product developer: https://blog.pragmaticengineer.com/the-product-minded-engineer/ https://blog.pragmaticengineer.com/the-product-minded-engine... I'm sure that type of developer exists for the kinds of products you are talking about, deep tech products, etc but that seems a lot less common.
- scoutt 4y agoBut those developers write software just like you! These products are also "software" to some degree! The link you've posted also applies to those who build smart lightbulbs. > seems a lot less common I guess the problem is that the world is bigger than you may think. I don't know what you build, but let's pretend it's some kind of web service. Consider how many brands of microcontroller-based products there are in the world, with their many variants. For the sake of the discussion consider just the "commercial" products you can purchase on Amazon. My guess is that they surpass the quantity of web projects out there. Add to the mix the custom/industrial devices, special tools and computers, etc. that many small companies are building right now (like the one I work for). Remember that someone is writing code for these products. Given the quantity of product, they can't be "a lot less common". To answer your question, and if you do web services, let's say you want to know how Redis works internally. You need C.
- ZephyrBlu 4y agoTo me this demonstrates why it's not always worth learning C. Like you said, the world is bigger than we think. There are areas of software where knowing C is not that helpful. Even in the web world, most devs are not going to be poking around in Redis internals. If you go higher up the stack to things like accessibility or CSS animations then knowing C is literally useless. Why do you feel like C is so fundamental that every developer must know it regardless of what they work on?
- nathants 4y agoc helps one understand the limits of what is possible. those limits change over time. without good intuition of those limits, you can’t see the whole solution space that you are creating within, and can’t reason about tradeoffs of different solutions. also c is fun!
- saberience 4y agoI mean, if that's going to be your justification for learning C, then shouldn't you be learning how to create 16 bit adders from flip-flops, learning about the importance of mux and demux chips, and then building an ALU and FPU in verilog and testing them in a simulator? I would argue that assembly language and hence C has been shaped that way it has because of the underlying structures of the processor and the way binary numbers are manipulated and stored. C and for that matter assembly, becomes quite trivial if you know enough to make your own simple CPU with decoder, instruction set, memory, ALU, FPU, etc.
- musicale 4y agoI tend to think (agree with you?) that understanding computer architecture will make you a better system designer and developer. That's probably why many CS programs (and systems concentrations in particular) require a computer architecture course. Verilog is of course C-like (much as VHDL is Ada-like.)
- MisterSandman 4y agoThis comment is far from reality. It's difficult to measure what a "good" programmer is, but regardless of decision I am confident that it will have no correlation with whether you learned Verilog or what a D Flip Flop is.
- musicale 4y agoMissing the forest for the trees. Computer architecture courses often expose you to things like: caches, memory and storage hierarchies, I/O, software/hardware interface, parallelism, Amdahl's law, pipelining, vector processing, prefetching, speculation, synchronization, clocking, interrupts, vector processing, data encoding, stream processing, virtual memory, general virtualization, isolation etc., etc.. If you care about execution time, responsiveness, efficiency, or reliability, these things matter. If you're doing systems programming, they are essential.
- delusional 4y ago
- _the_inflator 4y agoThis doesn't make sense in my point of view, since C is itself an abstraction. Why not do everything in assembler? Most of the early C compilers featured inline assembly. Do you learn how to fly when you book a flight? Do you learn how to build cars when you get your driving license? Do you learn how water is cleaned when you drink? There is infinite regress. In the end it is about trust and abstractions. Most algorithms have nothing to do with C. They are implemented in C. C is a great language, but as someone said here, there is only so much time.
- tmtvl 4y agoLearning to program in C taught me to appreciate how amazingly powerful modern computers are, even off-the-shelf commodity hardware. It helped me realise that if I code something and it isn't blindingly fast, I'm probably doing something wrong. And how many people who can't even be bothered to learn C will dive even deeper into assembly? And yes, I would think anyone who books flights/drives/drinks water for a living would be well served by learning something of the tools of their trade.
- delusional 4y agoWe are not booking flights or taking driving lessons. We are (hopefully) engineers and scientists. I find it perfectly acceptable that you chose to accept the abstraction of the machine. You may benefit from knowing electrical engineering, but I believe the benefit is slight. Knowing the history of the field is non negotiable however. You don't need to know how to heel-toe to drive to the market, but pretending that it's not a useful skill to master driving is ridiculous. Are you driving to the market, or are you a serious professional?