4 ms·
interesting read. one of the later comments is a bit off the mark though: " As a direct result of leaving out all the safety checks that other languages includ
by jheriko 13y ago
interesting read. one of the later comments is a bit off the mark though:
" As a direct result of leaving out all the safety checks that other languages include, C code can run faster"
C is fast not just because of missing safety checks but because more generally you don't pay for features you don't use. Things like function calls and reading data are not complicated by run-time type logic for instance - this is very important, its why you can write an Objective-C class which has the same content as a bunch of C functions and the C functions will be (sometimes very significantly) faster.
This is one example, but many language features in high level languages suffer from similar performance problems - by being super generic and ultra late binding they can never perform as fast as a clean implementation which knows everything at compile time.
If you want dynamic late binding type functionality in C you have to do it yourself...
- gmac 13y agoThe really nice thing about Objective-C, of course, is that you can just dip in and out of plain C as the mood takes you (e.g. where speed matters, or perhaps where you're just doing numerical stuff and C is less verbose). I've come to C via Objective-C, and (like many other commenters here) have found it incredibly satisfying.