4 ms·
Why do you think C is such a maintenance issue?
by jawngee 18y ago
Why do you think C is such a maintenance issue?
- jshen 18y agoI like it's well accepted that garbage collection is a huge boon for productivity and stability
- jawngee 18y agoC has a variety of garbage collectors, here's one: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ http://www.hpl.hp.com/personal/Hans_Boehm/gc/ I wonder if it's really more of an intimidation factor than anything (and I'm not saying this to be a jerk, I am truly curious why people have the perception that C is such a nightmare to maintain).
- jshen 18y agoAre you suggesting that you can be as productive in C as I can be in ruby? If not then you answered your own question. Second, are those garbage collectors widely used in C code and if not why?
- gnaritas 18y agoAgain, you're looking at best case. Talk to us when GC is mandatory, not optional, because until then, we'll still have to work with C code that can't be trusted because it may not use a GC. To folks who want higher level languages, CG is not an optional feature, it's a core part of the language.
- gnaritas 18y agoBecause it is. It's much easier to blow your foot off in C than in Python or Ruby. I think it's pretty well accepted that scripting languages are far more maintainable than C. Sure you can write maintainable C, but that's best case, I think it's more revealing to look at the worse case.
- jawngee 18y agoYeah but C's worse case is still better than most of Perl's, PHP's, etc. best cases. Just as an example. I don't disagree, btw, that dynamic languages are easier, but I'm really wondering if C's maintenance is really more of a perception than a reality.
- gnaritas 18y agoThat's just an absurd statement. C's worse case is obfuscated garbage http://en.wikipedia.org/wiki/International_Obfuscated_C_Code_Contest http://en.wikipedia.org/wiki/International_Obfuscated_C_Code... that just about no one could read or maintain and you think that's better that Python, PHP, Pearl, or Ruby's best case? Or is it more likely that like most C folk, you're just stuck on execution speed as the only measure of a language or you don't know what maintainability actually means? C's being hard to maintain is not a perception, it's a reality. If C were easy to maintain there wouldn't have been room for scripting languages to exist, everyone would have just kept using C. C is extremely low level and extremely powerful, making it hard to work in and very dangerous. Yes you can do anything with a for loop, but I'd much rather use higher level abstractions like higher order functions, first class functions, objects, continuations, and exceptions and not be able to directly play with memory or pointers because I don't give a crap about the machine, I give a crap about abstracting and solving my problem with the least amount of necessary boilerplate or repetitive code. Look, make it simple, assume for the sake of argument that Python and C have exactly equal execution speed under all circumstances, given that axiom, why would anyone choose C over Python? Which language do you think most people would choose?
- barryfandango 18y agoYou reveal the primary flaw in your thinking with the phrase "C folk." Languages are not enemy camps. Just learn them both and use the appropriate tool in the appropriate situation - python for glue, prototyping, business systems, web programming, etc. C for operating systems, networking layers, database engines, etc. Try not to attach your ego to either one.