Live data from Hacker News

Learn C, Then Learn Computer Science

qrohlf.com

101–110 of 134 posts

Re: Learn C, Then Learn Computer Science

#101

I think we need to break all of this down into at least three entirely separate areas: 1) Computer Science, which is, in my opinion, entirely a subset of mathematics, and should be taught as such. 2) Coding, which is the ability to break a problem down and describe it in a series of simple steps. 3) Craft and application, which is everything about how to use tools, best practices for code architecture, and everything…

The problem here appears when you want to teach #1. You shouldn't do it without also teaching #2 and #3 (isn't that obvious enough?), but #3 is often out, and it seems that there are some people trying to not "lose time" with #2 either.

I would say someone on a full CS-and-engineering track should study #2 (intro), #1 (rigorous CS/math), and finish with #3, since that's where you want to focus on the latest industry standards and trends. This is similar to my own CS university experience, but I'd like to see it broken out into much better defined areas, with different ratios of focus for different career tracks. I also think a full program should take significantly longer than a 4-year degree.

Incidentally, I think #1 could easily be taught without #3 at all. I get the impression that there are quite a few academic people who tinker with interesting algorithmic work, in esoteric languages, who couldn't effectively write maintainable code for mass deployment. Not that there's anything wrong with that, it's just a different area of specialization.

Re: Learn C, Then Learn Computer Science

#102
post #54
post #2

Don't confuse the strategies :-) Small liberal arts school has a strategy of broad based understanding of theory and the 'art', with graduate school providing the nuts and bolts specialization, large engineering school (USC) has the strategy of maximally skilled in execution of the art with enough theory to be effective. USC will assume that you will go to work right after you get your 4 year degree, Lewis and Clark…

"I think they are both valid approaches." For limited ranges of valid. If you are implementing a low performance requirement CRUD app, certainly you can become an effective programmer without knowing the low level details. But if you want to be an engineer? Good luck. I've worked with people that didn't know the stuff behind C, and they are pretty useless as soon as performance matters, or you need to talk to hardwar…

There are advantages to the other side. Many fascinating developments were made possible by those who prefer to think functionally, as opposed to imperatively. Modern relational database engines are fairly easy to implement once you understand set theory. Lambda calculus has taught me how to create a linked list using nothing but partially applied higher order functions. Software transactional memory was invented in Haskell, and it's easy to see why it happened there first.

The world needs people who think mechanically as well as people who think at a very high level of abstraction. I'm glad people like you exist, as tech would be vastly behind where it is now otherwise. I'm also glad there are people like me. We may not always see problems the same way, but the world is a better place because of our differences.

Re: Learn C, Then Learn Computer Science

#103
post #61

I would argue C is a difficult first language. It's even a difficult 2nd or 3rd language. I would start people off programming at a higher level of abstraction and once they can do that dive into how things work. You could start the other way but it may be too theoretical and discouraging. Pascal used to be the language of choice and IMO can still work well. Things got more complicated when we got all those competing…

C is an excellent 2nd language. The language itself is obtuse, but the underlying model is fairly simple. C++ is a horrible one. These days, probably nobody should learn C++ and should probably pick up Go instead. As a teenager, I picked up a book on C++ having already learned BASIC, Pascal, and MS-DOS but never got proficient in it. I should have picked C. The "++" lead me to believe that it was a better language th…

Go is not even close to being any kind of replacement for C++. Also, not all "real programmers" think that C is a better language than C++.

Re: Learn C, Then Learn Computer Science

#104
post #36

Earlier quoted context omitted.

"The whole language is a hack." Interesting enough that it is a must for the web development although it's lacking the structure definition from CS point of view. How about other scripting languages, such as Python or Ruby?

Python is growing in importance in scientific computing, displacing languages like R, MATLAB, and Fortran (yes, Fortran). There's a pretty good chance it will still be in wide use in science in 10-15 years. Ruby is harder to predict. It seems like a lot of the web developers who would have used Rails a few years ago are now opting for server-side javascript, based in node.js.

Thank you. But do you mean Julia to replace R, Matlab and Fortran?

Re: Learn C, Then Learn Computer Science

#105
post #21

This article resonated deeply with my own experience. Like Rohlf, I learned to program TI-Basic in middle school, and like him, I've had the ability to see several different teaching paradigms when it comes to computer science. In the high school computer science courses I was able to take, the programs were relatively simple with an, in my opinion, too-overt emphasis on object oriented programming. It was in java, a…

Ah may I ask which university? Mine also did Ada, then Unix in C, also Scheme thrown in there. Awesome progression, having learned Ada is really nice, it made me aware that there is a better way to do things, even if I never get to use that better way in real life!

Re: Learn C, Then Learn Computer Science

#106
post #91

Earlier quoted context omitted.

"C++ is a grotesquerie more suitable for a carnival horror show than something you want to introduce to new programmers." In my experience TAing an undergrad course that used C++, almost all of the things that left students scratching their heads were things that are present in C. No garbage collector, no built-in way to determine array sizes at runtime, no way to determine if a pointer has already been deallocated,…

Could you name some of the subsets of C? I know of several in C++ (exceptions, templates, multiple inheritance, smart structures) but even after programming in C for twenty years, can I come up with any number of subsets of C (okay, maybe one---function pointers).

As a portable macro assembler it is hard to get any subsets I guess.

Re: Learn C, Then Learn Computer Science

#107
post #90
post #32

Earlier quoted context omitted.

I have a similar experience, and agree with your sentiment. I taught myself TI-Basic in the 7th grade. Then when I was really fluent in it and started hitting its limits around the 9th grade (I was mostly interesting in writing real time games), I picked up z80 assembly. Later (10th grade) I wanted to write programs on my computer, I installed Linux and learned C (not that they're related, but the hacker world really…

I agree. I think the ideal is something like 6 months Python/Ruby, 1 year C, then one OOP and one functional language.

> then one OOP and one functional language.

They are already exposed to it by making use of Python/Ruby.

Re: Learn C, Then Learn Computer Science

#108
post #21

This article resonated deeply with my own experience. Like Rohlf, I learned to program TI-Basic in middle school, and like him, I've had the ability to see several different teaching paradigms when it comes to computer science. In the high school computer science courses I was able to take, the programs were relatively simple with an, in my opinion, too-overt emphasis on object oriented programming. It was in java, a…

Ah may I ask which university? Mine also did Ada, then Unix in C, also Scheme thrown in there. Awesome progression, having learned Ada is really nice, it made me aware that there is a better way to do things, even if I never get to use that better way in real life!

That's the thing, many that learn only C think it is the only way to do system level programming.

Re: Learn C, Then Learn Computer Science

#109
post #57
post #21

This article resonated deeply with my own experience. Like Rohlf, I learned to program TI-Basic in middle school, and like him, I've had the ability to see several different teaching paradigms when it comes to computer science. In the high school computer science courses I was able to take, the programs were relatively simple with an, in my opinion, too-overt emphasis on object oriented programming. It was in java, a…

Ada's powerful. The typing system is the best of the mainstream imperative languages. You can write good cross-platform code without thinking about endian issues. Almost as fast as C, strong gcc support. It's a shame it's so damn verbose. A fortnight ago I was trying to brainstorm how I could put a tighter syntax on it, possibly with some kind of pre-processor. Ideas welcome!

> It's a shame it's so damn verbose.

When a big part of your job is to read the code from others of various skill levels, one learns to have a soft spot for verbosity.

Re: Learn C, Then Learn Computer Science

#110
post #18

> This semester I used function pointers in an assignment and later heard them described as “Quinn’s magic C voodoo”. I still think I have to polish up on 'em: #include #include // int chk_arg(char *s, int (*f)(int)) { while(*s) if(!(f(*s))) return 1; else ++s; return 0; } // char *s[]= { "1048leet576", "numbers only pls\n" }; if(chk_arg(*s, isdigit)) printf(*(s+1)); > This was confusing - my classmates were juniors…

I am positive that 95% of the CS students with a BSc. degree in my college haven't even seen function pointers. We learn the basics of C then OOP in C++ and the rest of the study will be Java. It's a farce and as an employer I wouldn't even care whether my employee has a fancy degree. You won't find real coders if you choose them by their degree. At least in Germany it's like that. I am not sure of it's different in…

I am a Portuguese living in Germany and every time someone describes me how CS degrees work here, I always feel sorry for my work colleagues.

When I took my degree in Portugal in the mid-90's, it was a 5 year long degree, with heavy mix of theory and practical subjects in lots of programming languages.

I got to use C, C++, Prolog, Camllight, Java, PL/I, Algol, Pascal as compulsory ones. Plus many many others that I got to learn/use as part of the compiler design lectures I used to attend to.

All CS areas had introductory levels as compulsory, with the more advanced ones as optional subjects. Given the way the credits were set up, quite a few of those advanced ones were also required.

Post reply on HN