Earlier quoted context omitted.
This reminds me of an interesting event that occurred in my C++ class. During one of the assignments I looked at a peers code. I became convinced that the code was wrong. His code looked a little like this: bool operator He ran the code and it worked. I was confused. Another student saw the teacher pass him and copied his implementation. His code didn't work. It gave the stack overflow error that I was expecting. It…
In gcc this would not give a stack overflow error.
Poll: Do you know C?
151–160 of 208 posts
Re: Poll: Do you know C?
#152Earlier quoted context omitted.
This reminds me of an interesting event that occurred in my C++ class. During one of the assignments I looked at a peers code. I became convinced that the code was wrong. His code looked a little like this: bool operator He ran the code and it worked. I was confused. Another student saw the teacher pass him and copied his implementation. His code didn't work. It gave the stack overflow error that I was expecting. It…
In gcc this would not give a stack overflow error.
Re: Poll: Do you know C?
#153I wish more languages had books equivalent to K&R. Here's how I learned C. 1. Buy K&R. 2. Read it. Maybe 2 or 3 times during the process of reading it, I would go write a program to try what I had just learned. This was was around 1980, so trying a program meant walking across campus to a terminal. I could either head to the computing center and use a public terminal, or to the high energy physics building (where I h…
Read it. Maybe couple of times (say only chapters 1-3) in the beginning. Understand the basic mechanism first rather than try out a program copied from somewhere else.
Start testing out simple things.
I'm lucky to not have fallen for all the blog posts/tutorials on openGL where they spit out a C file and say to compile and run it.
Re: Poll: Do you know C?
#154Earlier quoted context omitted.
This reminds me of an interesting event that occurred in my C++ class. During one of the assignments I looked at a peers code. I became convinced that the code was wrong. His code looked a little like this: bool operator He ran the code and it worked. I was confused. Another student saw the teacher pass him and copied his implementation. His code didn't work. It gave the stack overflow error that I was expecting. It…
In gcc this would not give a stack overflow error.
Re: Poll: Do you know C?
#155Earlier quoted context omitted.
This reminds me of an interesting event that occurred in my C++ class. During one of the assignments I looked at a peers code. I became convinced that the code was wrong. His code looked a little like this: bool operator He ran the code and it worked. I was confused. Another student saw the teacher pass him and copied his implementation. His code didn't work. It gave the stack overflow error that I was expecting. It…
In gcc this would not give a stack overflow error.
Re: Poll: Do you know C?
#156Earlier quoted context omitted.
No objects = no structs?
There are structs in C, as well as unions, but they are data only - no methods.
Re: Poll: Do you know C?
#157As a first reaction I thought, well, more than 50% of HNers fluent with C, the average age should be pretty high probably. But then I realized that actually the average HN age is probably around 25 (from other pools I saw here), so I guess, there are still a lot of fresh programmers learning C. I really hope so. I love higher level programming languages and spent a lot of time with Tcl, Scheme, FORTH, Joy, Ruby, and…
I'm 25 and consider myself very well-versed in C (though I still have to consult the C99 spec from time to time). When I was learning to program modern computers around the turn of the century, it was the only "serious" language for writing desktop apps (I had recently "graduated" from VB4). I then refined my skills over the course of my electrical & computer engineering degree and a short stint in the EE industry, w…
Re: Poll: Do you know C?
#158Earlier quoted context omitted.
Why write C-with-classes if you can just write C-with-structures-and-function-pointers instead?
C-with-structures-and-function-pointers doesn't give you easy inheritance, polymorphism, etc. Now anthropomorphism ... that would be fun.
If you play with languages that use prototype-based OO like Lua and JavaScript, you can see pretty clearly how to implement such things. Implementing your own OO system in Lua is an experience I'd recommend for anyone who uses OO; it's easy, and you'll almost certainly learn something you can apply elsewhere.
Re: Poll: Do you know C?
#159I wish more languages had books equivalent to K&R. Here's how I learned C. 1. Buy K&R. 2. Read it. Maybe 2 or 3 times during the process of reading it, I would go write a program to try what I had just learned. This was was around 1980, so trying a program meant walking across campus to a terminal. I could either head to the computing center and use a public terminal, or to the high energy physics building (where I h…
Re: Poll: Do you know C?
#160+1 to the non-existent poll entry that says: "I know C thoroughly, though I barely ever use it these days. I used it for so long and during such a formative period of my overall programming career that I can read/write C code with virtually no spin-up time even though I find myself touching C code very rarely. Oh, and btw, when I find myself coding C on a nix box, I am still amused at how I have muscle memory for all…