5 ms·
I've just finished my freshman Java class and was severely disillusioned at how far from 'programming' it felt. I picked up a copy of K&R and have been enjoyin
by tialys 18y ago
I've just finished my freshman Java class and was severely disillusioned at how far from 'programming' it felt. I picked up a copy of K&R and have been enjoying myself since. I actually feel bad for my fellow majors who think that Java/OOP is the only way that things can be done.
- jrockway 18y agoI actually feel bad for my fellow majors who think that Java/OOP is the only way that things can be done. I feel bad for people that think imperative-style programming is the only way things can be done. C is not the anti-Java. It's Java minus modern features and with more rope to hang yourself with. (Then again, someone actually told me that spending an entire day with Valgrind hunting down a memory leak was fun.) If you want power, non-Java-ness, and modern features, learn a language like Lisp, Haskell, OCaml, etc. And learn Perl for actually getting things done.
- d0mine 18y agoLearning: You've missed the point. Learning C is not about imperative-style programming. It is about seeing one abstraction level down relative to your favorite programming language. http://news.ycombinator.com/item?id=235727 http://news.ycombinator.com/item?id=235727 Using: And C is not inferior to Java. They serve different purposes. http://news.ycombinator.com/item?id=235766 http://news.ycombinator.com/item?id=235766
- ConradHex 18y agoParty pooper. There's nothing wrong with learning and using C. It may not be your favorite flavor, but it's a perfectly valid and reasonable choice.
- jrockway 18y agoIt may not be your favorite flavor, but it's a perfectly valid and reasonable choice. I didn't say not to use C; there is plenty of good software written in C. Like... everything :) But, I don't think it's very valuable to know. It doesn't put you in a good position to write correct, maintainable software. There are no tools for that, only for twiddling bits. Therefore, I think C should be relegated to interfacing with UNIX (which you Just Have To Do) and small number-crunching routines. In those cases, there's really nothing to screw up (UNIX interface -- allocate resources, mutate them, deallocate; number crunching, call a function with some arguments). For both of those uses, C has been very successful. Just don't write a big application with it, there are much better tools for that.
- cstejerean 18y ago> I don't think it's very valuable to know I'd actually claim that C is very valuable to know, and while I'm at it, so is assembly. Pretty much all high level languages are written in C (or in a language that is itself written in C). Anyone that doesn't understand enough about how a modern CPU operates and cannot implement a compiler/interpreter for a higher level language in C should not claim to be a hacker.
- tx 18y ago... meanwhile the entire Internet is powered by software written in C, including the very same browser you typed this message in. I've been hearing how obsolete C is ever since high school (1994) yet pieces of successful programs not written in C-family is an order of magnitude less common: everything form web-servers to browsers, OSes and office suites and imaging software - all C. Meanwhile I've never had to install JVM on any of my computers, somehow I never run across a single piece of useful software written in Java (with exception of evaluating Jython and toying with Eclipse&Netbeans at work). Perhaps it's running on my phone. If so, that's probably why the damn thing feels so anemic compared to Objective-C powered iPhone. I don't know how C programmers do it, but somehow they just get things done. Moreover, C remains the only choice of writing the most portable code ever. There isn't a reasonably popular CPU on this planet that doesn't have a C compiler for it, while Java runs only on "java computers".
- jrockway 18y agoC is entrenched. Everyone uses it, and because everyone uses it, everyone continues to use it. That doesn't make it good, though, just popular. Read pg's "Beating the Averages" for a more eloquent explanation. You seem to think that Java is C's competition. It's not. I think we can all agree that Java is one of the worst programming languages ever created. (The VM is nice though.) Nobody is telling you to use Java or C++. They are telling you to use a dynamic language (Perl/Python/Ruby) or a functional language (Haskell/OCaml/Lisp). I don't know how C programmers do it, but somehow they just get things done. Sure, but their programs usually leak memory (ever use Firefox?), and their libraries handle errors by terminating the whole program (see PulseAudio; any error condition immediately calls exit(1)). There isn't a reasonably popular CPU on this planet that doesn't have a C compiler for it, while Java runs only on "java computers". I don't optimize my life for solving problems I don't have. Every machine I want my code to run on has Perl, Lisp, Haskell... whatever. If C was the highest-level language I could use, then obviously I'd use it. But it's not, so I don't. Finally, gcj will compile Java down to machine code; ghc compiles Haskell to native code. So I don't ever see a situation where I will absolutely have to use C for some reason (other than interfacing with C libraries, of course).
- 18y ago
- lpgauth 18y agohttp://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index.... Java is #1 in the industry. I'm not saying I like it but your school is just trying to make sure you can easily get a job after school.
- omouse 18y agoThis has been covered elsewhere, but the job of a university isn't to give you what you want. It's to give you perspective and a different way of thinking. If they teach only Java, you're missing out on a lot and you'll only be prepared for Java. On the other hand, if you're taught Haskell, Scheme, Smalltalk, Forth, C, etc. you'll (hopefully) learn how to pick up any language easily and always have a job, even when the industry-standard/popular language changes. But anyway, no arguing about this because it's been beaten to death (and I just woke up from a nap, don't anger me! :P)
- lpgauth 18y agoI agree, it's just that most undergrad programs are funded by companies.