4 ms·
> This is the beauty and power of C, everything is a piece of memory and nothing is guaranteed, and no we will not hold your hand or stop you doing something st
by sgift 13y ago
> This is the beauty and power of C, everything is a piece of memory and nothing is guaranteed, and no we will not hold your hand or stop you doing something stupid. Someone else has a valid use case for that, even if they don't know it yet.
Just replace C with assembler and we know why we should all go back to it. Or rather not ..? Guarantees provide reliable environments. Reliablity is really helpful.
My nitpick aside ... I still want to (finally, really) learn C some time. Yeah, I can read it more or less, but that's not the same. Maybe on my next vacation.
- goldenkey 13y agoI really don't think you have a space to speak here if you don't know C. C is a behemoth, sure but there's no surprises. And assembler is platform specific, so you can't really make the 'bandwagon'/'slippery slope' logical fallacy. Stay in Python/Ruby/TLC world, and leave us hard-core coders alone. We'll continue making the performant libs that your dynamic language runtime requires. Thanks.
- deleted 13y ago[deleted]
- sgift 13y agoMuch real world C code is platform specific too. As written: I can read C (more or less) and I can recognize things like code that will only work on your nice little endian platform and will explode in your face on big endian. Code like that is written all the time in C - especially by programmers that "continue making the performant libs" or whatever you think you do. So, the abstraction over assembler is often far smaller than you make it out to be. But that is a completely different point, which has nothing to do with my last post.
- goldenkey 13y agosgift, dealing with big vs small endian is a ways away from dealing with different opcodes and instruction sets like SSE and whatnot. It's not far smaller. It's huge. You aren't speaking from experience. As someone who used to do reverse engineering and knows assembly first-hand, I'm not going to argue with you about the different between writing code in assembly versus C. You're incorrect to say that ASM and C are so close. There's a reason why certain routines are implemented in CPU architecture specific asm, and that's for speed. Because C is still too high up to make many optimizations. The lack of fine-grained-ness is definitely there, in regard to the processor instructions used.
- Crito 13y agoGoing back to assembly has it's place, sometimes you want to do some gnarly/neat stuff with the call stack which is straightforward in assembly but which C doesn't lend itself to. Other times, you don't need to do that, and C has you covered. Yet other times, you really don't need to do anything that C enables and python will have you covered instead... it all depends on what you are doing.
- goldenkey 13y agoInline assembly in C, but still you don't need to jump to pure assembly (ie FASM/MASM/TASM,etc.). OP is just mouthing off about how if you go one level deep, you might as well strip off all your floorboards. Thats a logical fallacy.
- mcv 13y agoC is basically readable, portable assembler. That's it. Don't treat it as a high level language; treat it as a nicer alternative to assembler. It definitely has its place, but it's not for everybody.
- Nursie 13y agoI never said we should all use C for everything, I certainly don't :) But it is what it is, a thing of great power and beauty but highly dangerous in the wrong hands.