- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Yeah, it teaches the basics, but it is also limited. I bet people exposed to QBASIC for too long are the types of people that write God objects and thousand line methods.
Admin
Admin
OK, but it sounds to me like this is an actual course being offered by the school. Do you know what computing course my middle school offered? "Introduction to Microsoft Word."
I ended up with independent study in SQL, because I spoke personally with my school counselor about the lack of options for me. But I most certainly did not have an instructor who would sit down by me and find the query errors.
Instead, I had Google, a copy of MySQL For Dummies, and a syntax highlighter.
The school in this story is clearly doing something very wrong with their budget if they have staff who are, dedicating time to teaching C to middle school students. Mind you, these students are 10-12 years old. I didn't even learn PHP until I was 11. I was 15 by the time I learned C, and I was always considered "gifted." (In other words, I got to be in the reading group with the books WITHOUT pictures.)
Just the concept of multiple 11-ish-year-olds in any reasonably-sized group would even be capable of learning C is foreign to me; I was the first student to do so in my high school in 20 years. Even in a large school (with an enrollment of, say, 1000 middle school students), I would only expect one or two of them to even be capable of understanding what programming is, let alone debug C compiler errors.
Admin
Admin
Admin
less than a century ago 14 was adult? In which country?
Admin
Admin
I work with C# monkey^ who keeps bagging me that C is dead, and C# is the future, and I just nod and smile and watch as (though less widespread, perhaps) my skills are more desired than his = PROFIT.
^Actually, I don't think he's very capable even in C# - but that's another story....
Admin
Admin
Yea, Like I use to say whenever someone is mentioning LabView: It's fine for playing, but you still cant get a screen big enough to make anything useful with it.
Admin
At the age of 14 in Britain you would have the option of leaving school and going to work, earning a living (or contributing towards a living) working in a shop, or the fields, or a factory, or whatever. You would be under adult rules, and wearing adult clothes, and expecting to comport yourself as an adult. You would probably also be eyeing up the local members of the opposite sex and smoking in the back alley behind your workplace. You would have been going to the pub with your father and uncles and drinking a modest quantity of ale (having had your initiation getting disgustingly plastered at least once). You would have been getting married at 16 or 17 to your sweetheart and going into the army to do your national service. And if you'd got into trouble you would have been tried as an adult and made to serve out your sentence as an adult.
Compare and contrast C21.
Admin
Back to good old Fortran: A character in column 6 was for continuing the previous line. How many times have I per accident written some code all starting in column 6 ...
Admin
"Do you know what’s wrong, Mr. Artyom?” “No, I don’t.” “A good programmer needs to be creative. Any ideas?”
!!!
Admin
Always blame the compiler. Sigh :( // comment
command
just multi-line comment. It's like wondering why following compiles int main(void) { http://google.com return 0; }
Admin
Admin
Actually, this is common in robotics, where you need to define a local coordinate frame. It's conventionally called "North East Down"
http://en.wikipedia.org/wiki/Axes_conventions#Ground_reference_frames:_ENU_and_NED
Admin
Admin
Admin
Admin
That's just me being snide, mostly - but I think there's truth in it. I've used both (not deeply, I admit) and Ruby feels like a language for doing stuff, and Haskell feels like a language for proving a point. And if you're teaching someone to write programs, you should really give them a language that's used to write programs.
(this is also why I excluded LOGO - it's "optimized" for educational purposes and not for actually making stuff that works, which makes it a terrible tool for teaching)
Admin
I learned Ancient Greek in junior high school. In high school, we did Latin and Greek, along with Greek History. (The Greeks, for example, used C++, while the Romans used Java).
Admin
When I was 12 there was no access to computers at school, so we built them ourselves out of matchboxes and beads, and simulated them with pencil and paper. When computers for the masses finally arrived at the end of the '70s, we youngsters had cut our teeth on writing flow diagrams and analysing processes algorithmically before writing our first line of computer code. My first "actual" programming experience was in ALGOL 68 on coding sheets, on which I wrote a routine to calculate the first 20 factorials. Then I went up to Uni where I learned Basic on a Prime, and Pascal on a North Star Horizon, and shortly after, Basic on a BBC-B.
Teaching Javascript, CSS and HTML sounds like a sensible way to eddicate kids into programming nowadays, though I thoroughly endorse C.
Admin
No, I would not. I want them to be taught, not tortured. There will be people of different skill levels regardless of the methodology. I would prefer the methodology be humane.
Why should someone who would be very good at programming put up with bad treatment? (Or anyone do so?) Maybe that potentially-excellent programmer decides, "Who needs this? I think I will go with one of my other options."
Sincerely,
Gene Wirchenko
Admin
I feel overwhelmed by the sheer amount of misinformation you're spreading. If you're such an expert on C, I suggest writing a compiler for it. You'll learn so much!
No, it isn't.
No, it isn't.
It's fair enough to list PHP as undesirable for beginners. That language is documented mostly by the implementation (written in C), which relies upon undefined behaviour. If you don't know what that means, or you can't see anything wrong with that, continue reading by all means.
How can it be that you'd suggest learning C or Lisp as a first programming language, but not Haskell or Logo? You seem to lack an understanding of programming paradigms and undefined behaviour, which are two hurdles for learning programming languages.
As any university student studying linguistics will tell you: Syntax isn't the only important aspect of languages.
"Colourless green ideas sleep furiously." -- Noam Chomsky
The syntax of C might give the impression of a well-defined language. Don't let this fool you. I quoted a famous example from Noam Chomsky to demonstrate a distinction from syntax and semantics in English. The sentence might be grammatically correct, but it's semantically dribble; It makes no sense.
C has such a distinction, and room for a far deeper level of misinterpretation than most programming languages, too. Most of that misinterpretation occurs in the realms of undefined behaviour, which most other programming languages don't have.
Undefined behaviour makes testing and debugging difficult in C. A program that invokes undefined behaviour might appear to work, if only by coincidence. Upgrading the compiler or C standard library, the OS or the computer could cause the program to break. Can you imagine how this might affect the score of a student if the professor uses a different OS and compiler?
If you've never heard of undefined behaviour, then you've never really learnt C. Stop commenting about it.
"Higher-level" isn't well defined, though I would suggest that C programs running on a Lisp machine are presented with an entirely different set of memory problems.
Where in the C standard is the term "stack" or "heap" mentioned? Nowhere.
Is a misplaced "understanding of the stack and the heap" more important than the ability to test and debug your programs, to ensure that they are actually valid programs while learning? No.
If you're going to put yourself in the place of a teacher, you really shouldn't write like an idiot. Your priorities are backwards. I suggest going back to primary school and having your English tested before writing a C compiler to be ACVS or CVSA tested. You're probably better off writing the C compiler in Haskell than in C or Ruby.
CAPTCHA: dolor. trtrwtf is a dolor.
Admin
What would this have to do with anything? Do you really think you can write a moderately complex program in C without understanding how memory works? If you think it's useful to know how the machine works, C is a good way to guarantee that a student understands this.
(or, I suppose, that a student who can't manage to understand this doesn't get any further, which is just as good)
Have you ever had to explain aliasing to a "senior" programmer? I have. The guy had created a bug which he was unable to test and debug, because he didn't understand the structure of memory in his machine. So, based on my experience, yes, this understanding is essential, and it's not misplaced. It's all well and good to write in high-level languages, but if you can't think at the low level when needed, you're going to have a lot of problems.
As I say, it's also possible to teach a student using Java or C# just about any other serious language, but C has some advantages, which are worth understanding. Simply frothing at the mouth about them isn't really convincing.
Yes, I can see how that would be a problem. So your students use the gcc, you make sure their installation is good, and off you go. If they have problems, you help them sort them out. Environment issues and wonky installs are part of programming. You deal with them. The issues with C are not especially weird.
I've already explained that. I want people to use real languages that write real deployable code. Toy languages are not a great way to learn to program.
Admin
I love the idea that teaching someone C is "inhumane".
"Okay, Ahmed, I'm going to ask you one more time, and if you don't tell me the name of your cell's leader, it's going to be hard on you"
"You'll never make me talk!"
"Oh, yeah? Boys, teach him about pointers."
"Oh no! Anything but that, I'll talk, please, just don't make me learn C!"
Admin
Very cool history.
Programmable calculator here, factoring integers using a naive algorithm. It took forever, and was even slower than doing it by hand. It pissed me off so much I programmed it to do a tight goto loop and left it in a corner. When I got back to it the batteries had run down, which I thought was pretty funny. It got the last laugh, though. After that, it was never the same and would run down batteries 2x faster. A friend of mine who did the same thing on the same kind of calculator, noticed too that it ate up batteries much faster.
My first real computer experience was with an Apple II. I hacked in Basic a while before discovering assembly language. For those not familiar with 6502, it's much more fun than you would expect. Then later I got into 68000 assembler and really liked it. After that, I learned C and only touch assembler when required.
Back then, it was easily possible for someone to understand absolutely everything about their computers, the O/Ses and the languages used to write them. Today, not so much...
Admin
Today is going by too slowly.
Admin
The problem is that you're not suggesting learning C, but a subset of C that is highly system-dependant, non-portable and definitely not C. Are you sure that's what you want to teach?
The C standard says: The semantic descriptions in this International Standard describe the behavior of an abstract machine... In the abstract machine, all expressions are evaluated as specified by the semantics.
Notice the keyword "abstract". Is it relevant to know how memory works on your x86? No! If you want to learn that, you'll need to learn more than C will teach you. C doesn't teach you real and protected mode x86 assembly. C doesn't teach you all of the stages of booting. C doesn't teach you about paging... and just like none of that is relevant in C, none of it is relevant in C#.
It's misplaced because it's not required, and I find myself repeating myself: Where in the C standard is the term "stack" or "heap" mentioned? Nowhere.
"Low level"?! What gibberish! Only first and second generation programming languages are low level. C is a third generation programming language. Are C++, C#, Java, BASIC and Pascal also "low level"?
Where in the C standard is it stated that C must be compiled on your Intel x86 processor? That'd be the significant requirement of being "low level". I've already quoted evidence to the contrary... Consider the definition of the word "abstract".
Based on your experience, undefined behaviour that "works" isn't a problem. When will people actually learn from the THERAC-25 incident? You should be put to death...
What happens to the undefined behaviour that they don't spot, because "the program works"? In six months time they try to compile and run it using gcc on their ARM processor instead of their x86 processor, and all of the sudden a problem pops up. They then learn what a crappy teacher you were. Hopefully one of them pays your carpenter to install dodgy foil insulation and you die in a fire. You don't seem to have grasped the concept of "undefined behaviour", yet.
I may seem resentful. It's only because I see so much unnecessarily non-portable code written by people like yourself who couldn't be bothered picking up K&R to actually learn the language. You might as well mash your dribbling faecal orifice all over the keyboard to produce your programs.
Have you written that compiler, yet?
Admin
How does C teach you about the stack? Like every other high-level language, it hides all the details from you. If you want to know the real basics, learn assembly language.
That makes no sense. If you can move forward without backfilling the basics, the basics weren't really all that basic in the first place. If professionals quite correctly prioritize learning high-level stuff over the low-level details, why force early students to learn the low-level details, since they obviously won't need it?
Admin
Admin
The student wasn't at fault here.
I think the article author assumed the WTF was the teacher's (using the wrong compiler), and didn't realise the real cause.
I must admit, I knew about \ continuation characters, but had forgotten about them (as with trigraphs, which caught me out recently), as I never use trigraphs, and only use the continuation character on big macros (which I try to avoid nowadays), so I'd not related them to this situation.
I suspect the real issue was that 'Edu-C' had kindly trimmed spaces off the ends of lines, so they didn't confuse users, which made the original '<space>' (not a continuation character) into '' (a continuation character).
Admin
Why should they learn the low-level details? Because the low-level details make you a better programmer, and we want programmers to be better. Why should professionals prioritize learning high-level programming techniques over low-level details? Because time is finite, and it becomes more so as you go on. Since the groundwork is infinitely deep, and there are few or no natural stopping points where you can say "I have now learned enough", so an arbitrary stopping point is needed if we're not going to spend our whole lives preparing. The better our preparations, the better off we are, but we shouldn't put off the work until our preparations are perfect. Eventually, we have to get on with it.
Admin
First twenty factorials could be 0 to 19 or 1 to 20.
Your code can be optimized big time (19 vs. 190 multiplications). This is likely similar to what Matt Westwood was doing in Algol those years ago.
Does it matter which is used? Sadly, these days, usually not...
Admin
Oh please. In my grade school (class size of about 45) we learned BASIC and LOGO and such starting around second grade; by middle school Visual Basic was offered and Java was shortly after that. Always had a few dozen kids in those. Though of course none of those are C. I was using C-like languages (NQC -- a variant of C for robotics) in 5th grade and trying to teach it to my classmates by 6th. Started teaching myself C++ by 7th. Granted, they're not going to be doing anything too complex with it, but the basics really aren't that hard. Could CERTAINLY get some middle school kids writing some simple games with a graphics library like Allegro in a full year course.
Admin
So...what, if we can't make them into perfect Software Engineers in middle school, then we shouldn't even try to get them interested in the subject? I'm not sure I understand what you're getting at...sure it's necessary to know that stuff by the time you enter the workforce, but the point being made was that there's plenty you can learn before that, and even if you do want to teach data structures first, it's simple enough that even middle school kids should be able to grasp the basic concepts.
Admin
Exactly this. In fact, if you give kids the basic concepts, which they can grapple with, they then find it a lot easier to get the math underlying them. (Is it easier to teach logarithms to a kid before or after they've written linear and binary search routines, and looked at their performance?)
Admin
I'd rather use block comment to comment out block of code rather than comment out every single line of the block with line comments.
Admin
There are good arguments for either. If you're on a large project, and you're trying to find references to a particular function, it's nice to be able to search the codebase and see from the search results whether the reference is live or commented out. It also shows up more effectively in a diff: the whole block of code shows up as commented, not just two lines. So line comments have some good features for communicating intent.
I agree that block comments are aesthetically nicer, and I use them on my own time, but as a member of a team I usually push for line comments as the house style when commenting out code.
Admin
Burn!
Admin
Yeah, it's right up there with polio.
Admin
TRWTF is that my irony detector seems to be broken - it's claiming that some of the various 'eleven is too young to learn C!' posts are sincere.
Sure, there may be only two eleven year old kids in a typical school already capable of writing programs in C. But then, there are probably not very many competent historians in middle school, yet that doesn't deter us from teaching history.
The undefined and inconsistent behaviour isn't that big a deal - any language with a history of real-world use has undefined and inconsistent behaviour across multiple implementations. 'print "Hello World"' is a SyntaxError in Python 3.2, for example, and I've run into an awful lot of Java apps that seem to actually care what JVM and OS you run them on. (And environment-specific warts affect other classes - is the difference in behaviour between Visual Studio targeting a Win8 surface tablet and gcc targeting OpenBSD desktops that much harder to deal with than bureaucrats who demand that paleontology be taught in a way that does not contradict young-earth creationism?)
Admin
What concerns me more, is you being unable to use "Preview" to detect and solve puny typos in your comment. Software developer not able to parse BBCode?
Preview is your friend.
Admin
The problem are so called programmers who cannot check their code actually compiles.
Preview is your friend.
Do not get me wrong, I find your dialogue with "trtrwtf" quite insightful and worth while reading - just having trouble actually reading it. Thanks.
Admin
this
.Admin
I can smell the pretentiousness from here