Hacker News new | past | comments | ask | show | jobs | submit login

My opinion is that one can easily teach these "high level concepts" (loops, syntax, control flow, etc) using C.

Furthermore my (admittedly curmudgeonly) take on the C vs "high level languages" debate is that learning something like Python "first" because it's "easier" is actually sort of damaging, in that the student will learn these "high level" concepts without any clue about the underlying implementation. They will then have to learn a bunch of "bag of tricks" that will seem arbitrary to them, and a bunch of "gotchas" to avoid, again, that will seem arbitrary to them, because they have no concept of things like the cost of memory copying (passing-by-value giant arrays as arguments to functions, etc).

I actually think that someone who is incapable or even worse, unwilling to learn programming using C, has no business programming anything at all of any import, beyond the most toy-example tiny scripts here and there.




>I actually think that someone who is incapable or even worse, unwilling to learn programming using C, has no business programming anything at all of any import, beyond the most toy-example tiny scripts here and there.

I'm a C hacker, and I do agree with this 100%.

And keep in mind, when I say "introductory", I'm talking a 1 semester class at most. I'm not saying that it should necessarily be any more than that.

>Furthermore my (admittedly curmudgeonly) take on the C vs "high level languages" debate is that learning something like Python "first" because it's "easier" is actually sort of damaging, in that the student will learn these "high level" concepts without any clue about the underlying implementation. They will then have to learn a bunch of "bag of tricks" that will seem arbitrary to them, and a bunch of "gotchas" to avoid, again, that will seem arbitrary to them, because they have no concept of things like the cost of memory copying (passing-by-value giant arrays as arguments to functions, etc).

Honestly, starting out with C++ when I was in my early teens(I'm in my late 20's now), a lot of those "bag of tricks" stuff I use daily was pretty much magic to me for a long time. It wasn't until I started to learn about dynamic memory management and serious data structure concepts in high school and college that it began to make sense.

That's why I think that the higher level languages are great for learning the basics of program flow control and basic computer data handling. The students don't need to know how dynamic memory allocation works at that point, but they will soon.

The overall point is that a well rounded, theoretical CS education should be teaching that the languages we use are closer to standard tools than the end-all of our products. There will be times where a high-level language will suit your needs perfectly well, and times where a low level language will have the raw power that you need, with the caveat of potentially needing a lot more thought and work to get the same results.


"My opinion is that one can easily teach these "high level concepts" (loops, syntax, control flow, etc) using C."

Then one day you have a line of students going out the door at your office hours who all need help understanding why their program is segfaulting. Some tried to free a pointer to something allocated on the stack, others tried to free a pointer twice, and one or two managed to find some undefined behavior that even you did not know about.

It is not that C lacks high-level structures, it is that any non-trivial C program must deal with low-level issues.

"the student will learn these "high level" concepts without any clue about the underlying implementation"

That is what computer architecture and compilers courses are for. You learn more about the implementation of your programs by writing a compiler than you do by using C, and writing a compiler in a high-level language is almost always less painful than writing it in C. Somewhere in the compilers course students should also learn how a garbage collector works, which will help them understand why they are seeing the behavior they see.


I disagree : you can easily teach high level concepts like control flow, branching, loops, logical operations, if/then, without even using pointers. You can even do some pretty high level numerical algorithm stuff just using plain old stack variables.


This is the first exposure to programming & computation class, anything superfluous such as semicolons or the keywords just trips people up and gets in the way of learning. You have to tell people to ignore all of the extra magic words just to get started, even though they would really like to know what it all means.

Look at Java:

  public class HelloWorld { 
      public static void main(String[] args) {
          System.out.println("Hello, World");
      }
  }
C:

  #import <stdio.h>

  int main() {
    printf("hello");
    return 0;
  }
Python:

  print "Hello"


#import <stdio.h> -> #include <stdio.h>


In C, you can't even get user input without using pointers. Command-line argument? argv is a pointer. fgets/fscanf into a variable? You have to use a pointer. Yes, you can tell the students to treat those stars and ampersands as necessary magic that they don't need to understand right now, but you're still using pointers.


Reading inputs without using pointers is pretty complicated in C...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: