5 ms·
* Lots of programmers you can hire today (contrast to D, ML, Haskell ) * Excellent introductory texts (Kernighan & Ritchie) * Backed by giants like Microsof
by tezza 14y ago
* Lots of programmers you can hire today (contrast to D, ML, Haskell )
* Excellent introductory texts (Kernighan & Ritchie)
* Backed by giants like Microsoft, IBM
* Everything else always has some mechanism to link against it
* Thorough API documentation (if quite large) MSDN, man 3 sprintf
- unwind 14y agoI wouldn't quite agree that Microsoft are a good example of "backers" of C. Unless, of course, you consider backing for C++ to be enough. Microsoft's compiler doesn't support C99, and likely won't do so any time soon (http://connect.microsoft.com/VisualStudio/feedback/details/526116/c99-support http://connect.microsoft.com/VisualStudio/feedback/details/5...).
- tezza 14y agoI don't mind the way MS does C . Whacking variable declarations at the top of the scope becomes second nature quickly. I came from assembly language, where the process is very similar and not too demanding
- apaprocki 14y agoMicrosoft not supporting C99 is a huge issue because the world of open-source C projects that are supported on both Unix flavors and Windows can not integrate C99 features into their core because Windows support means building with MSVC. It might not be a big deal for one individual project, but you're literally talking about the entire world of open-source C projects being restricted by their decision.
- draven 14y agoIn this case (open source projects using C99) they can use mingw.
- bitwize 14y agoAn ironclad rule of platform-specific development: You use the compiler that everyone else is using. On Windows, that means Visual Studio.
- JohannL 14y agoI'm really happy for platform-specific development, and I'm gonna let it finish, but cross-platform development is the most cross-platform development of all time.. of all time!
- dkhenry 14y agoI think its a lot harder to find good C coders then you might think. For example 80% of people who claim to know C that interview with my company fail a test on reading a CSV file.
- kiiski 14y agoBut many of those 80% probably just haven't needed to use C, or read a CSV file, in a while. If someone randomly asked me to do that in Lisp, when I've been coding in Python for a year, it would take me a while to remember how to do it. But after working with Lisp for a week, I could do it easily again.
- dkhenry 14y agoWhat if I promised you gainful employment and gave you as much time as you wanted to prepare ? Yeah most people think "I know C its just like C++/Java". A good 75% of the people who fail don't even invoke malloc once.
- zevyoura 14y agoIt's one thing if you tell them before hand "C, C, it's all about C here!" But every interview I've had has been pretty flexible in letting me choose what language to use.
- Jach 14y agoYou don't even need a week if you have access to the internet, which as a dev you will. (Or with just Clojure's repl-docs you could probably come up with `(with-open [rdr (reader file-name)] (doseq [line (line-seq rdr)] (let [parsed (.split line ",")] ...)))` fairly quickly, and even if you forgot the specific reader syntax remembering the more memory-intensive `slurp` for a year seems doable and ought to be acceptable in an interview.) If you hadn't been doing Python for a year would you still remember the existence of the CSV module you can import, and then use dir() and help() on if you forgot the exact syntax? The particular example of reading a csv file is just a bad one to compare C and any dynamic language with, because in C file IO is a pain in the neck with a lot of pitfalls whereas dynamic languages make it lovely and you only have to remember a small amount. I guess it's a decent test to see if one's potential C coder has memorized all the details about C's file IO, maybe the company does a lot of that since they create libraries for others or something. (Did you allocate enough memory on the stack/heap? Are you reading byte-by-byte looking for a newline or in chunks before looking? Are you checking if you need to re-alloc? Do you support "\n", "\r", and "\r\n"? Are you checking for E_NO_MEMORY and E_BAD_SOURCE? Are you using sprintf safely? Are you checking for end-of-file correctly? Are you tokenizing the line properly? Are you faster than Python? Etc.) If the interview is just looking for coders who can "fopen, fread with malloc, and fclose, it's okay if details are forgotten", then it's just a weeder question rather than a skill test and there are better weeder questions. Personally I have a handful of C programs on hand that I know are correct and that do various IO stuff, I tend to just copy from those on the rare occasion I need to use C to do manual file IO or memmapping (we all remember the subtleties of that right?) because of the reasonably high probability I'll forget one of the many details if I do it from scratch. I much prefer using already existing libraries to read and parse for me; there's too much reinventing-the-dysfunctional-wheel culture in C.
- gnuvince 14y agoNot sure I'd still qualify K&R as an excellent introduction to C in this day and age; the book lacks focus on safety, which is so important today. It's fine for learning the language, but a language is more than its features.