6 ms·
I think one reason C (and to a lesser extent Go) is so popular is that it is small and easy for programmers to hold in their heads.
by _wldu 5y ago
I think one reason C (and to a lesser extent Go) is so popular is that it is small and easy for programmers to hold in their heads.
- p_l 5y agoA big reason for C popularity was that for many, it came free with OS, especially in university. In environment with less "language X is shipped by default", it had much less impact except for crossing over of developers who did work with it on other platforms (which is how Turbo Pascal/Delphi kept on significant marketshare in PC space for a long time).
- zozbot234 5y agoYup, gwbasic and qbasic shipped by default on most PC's, and this didn't exactly hurt their popularity. Similarly, one reason JS is so incredibly popular today is that you can start hacking stuff in it with just notepad and a web browser.
- adamc 5y agoIt also became popular because in the 1980s it was a way of wringing decent performance out of x86 machines (then becoming popular) without having to write everything in assembler.
- pjmlp 5y agoThat is what most think. Naturally they ignore the size of ISO C and its implementation specific nuances, the set of extensions each compiler provides, every system that matters also brings POSIX for the ride and it isn't fully portable with plenty of room for interpretations, the amount of build systems to rely on, the tooling to actually write safe code,... But hey, the K&R C book is small.
- foobarian 5y agoIt's all fun and games in C until you need a hashmap...
- Spivak 5y agoI mean it's not that dire. I've found uthash and glib's HashTable to be fine to work with.
- foobarian 5y agoI've been copying the same hashtable.[ch] file to all my new projects since the 90s. :-) I suppose it could be viewed as a strength of C that it lives below that level of abstraction and prescribe too much of the standard library.
- arthurcolle 5y agoIt's not really heavy wizardry to write one that suits your needs. EDIT: or just use redis lol
- speed_spread 5y agoI shiver at the thought of maintaining a bespoke C HashMap
- Karrot_Kream 5y agoMaintain what though? Hashmaps don't need to be secure, and as long as you have a hash function and an array, that's all you need.
- mbrodersen 5y agoI wrote a commercial 3D game engine from scratch in C starting with just a bare bone OS on a console. It was a lot of fun actually. Not hard.