What do schools have against teaching C?

You can talk about almost anything that you want to on this board.

Moderator: Moderators

DementedPurple
Posts: 318
Joined: Mon Jan 30, 2017 5:20 pm
Location: Colorado USA

What do schools have against teaching C?

Post by DementedPurple »

I'm enrolling into High School for next year and all of the school's tech programs never teach anything in the C family, it's always Python, Java/Javascript, and HTML. The same is true at the school I currently attend, the tech teachers seem to treat C as if it's some sort of crazy sophisticated language because it's "Low Level" which is far from the truth. C is a far more useful language to learn then any other because it can be used on practically any device, such as embedded systems, mobile devices, smart watches, game consoles, and even applications for PCs. So why would they rather teach a very niche language that works on niche devices rather then teach a language that would actually be useful?
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: What do schools have against teaching C?

Post by FrankenGraphics »

The school seems to be business oriented. Increasingly less job opportunities for people who specialize in C and C++ / growing rate of job opportunities if you learn something else. On one hand, C and C++ coders can expect a higher salary for their knowledge and expertise in the future, but the number of jobs are slowly diminishing, at least comparatively to other fields.

You need to write a computation heavy simulation or science thingy? Use C family. You want to get some job done at a tight price point quick without having to worry about memory management and what not? Use something high-level.
Last edited by FrankenGraphics on Sun Jan 28, 2018 2:41 pm, edited 1 time in total.
User avatar
Punch
Posts: 365
Joined: Sat Feb 16, 2013 11:52 am

Re: What do schools have against teaching C?

Post by Punch »

You can't "architecture astronaut" in C, I'm afraid, so that's why. :lol:

In all honesty people learn more about OOP and Design Patterns which are much more useful in the real world nowadays, they can learn low level stuff elsewhere if they desire.
This is a block of text that can be added to posts you make. There is a 255 character limit.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What do schools have against teaching C?

Post by rainwarrior »

My advice is take the course and learn Java and Python anyway. Doing so will only make it easier for you to eventually learn C, should you want to.

Most of what you will learn in a beginner's course is fundamental stuff that applies to most programming. The specific choice of language isn't a big deal here.
Rahsennor
Posts: 479
Joined: Thu Aug 20, 2015 3:09 am

Re: What do schools have against teaching C?

Post by Rahsennor »

What rainwarrior said. Java is pretty much C with a new coat of paint, and probably easier to learn anyway. Javascript and Python are further removed but the basics are still the same, and that's all you'll be covering in a high school course anyway.

FWIW I think the teachers are right to call C a "crazy sophisticated language because it's "Low Level"". It is a low-level language. It's trivially easy to shoot yourself in the foot. You have to do all the safety checks yourself, manually, and even the pros stuff them up on a regular basis.

I would go so far as to blame the modern acceptance of buggy programs as simply the way things are squarely on the C family's shoulders, because the most frequent 90% of all bugs could be (and are!) reliably caught at compile time in more advanced languages. You really do need to know what you're doing.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: What do schools have against teaching C?

Post by FrankenGraphics »

That's another thing... bug hunts, manual bug prevention & testing can be expensive. You want to cut unnecessary production costs and automating away a good portion of all human error factors is one such.
User avatar
infiniteneslives
Posts: 2104
Joined: Mon Apr 04, 2011 11:49 am
Location: WhereverIparkIt, USA
Contact:

Re: What do schools have against teaching C?

Post by infiniteneslives »

Maybe it's just a high school thing mostly..? Not sure about others with EE/CS degrees, but the majority of my EE/CS classes used C. But I also got a taste of asm, java, python, along with verilog and matlab if you count them. Not sure how things have changed since 2012 when a graduated though. There was absolutely no programming classes when I attended high school in early 2000's.
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: What do schools have against teaching C?

Post by rainwarrior »

There was no programming instruction at all in my high school until the last year I was there when it became a new course. At the time it was C++, but they switched to Java a year or two later. This was not quite 20 years ago, and Java was a bit less popular at that point (and a whole lot slower).

Throughout my university computer science program, the beginner courses were Java, and so were most courses, but you were expected to learn at least the basics in a variety of other languages too (e.g. Haskell, Prolog, Matlab, assembly). I only had one course that used C++, which was for computer graphics. I don't think there are any courses there that use C at all, though there are certainly graduate students and faculty doing some work in it.

So, C has never been on offer for formal instruction in the educational system I grew up in. Even C++ was rare. I don't know what kind of justifications you're hearing about C being "crazy sophisticated" or whatever, but I think the real reason is just popularity, not language features. Java is the most popular programming language. That's the same reason my high school briefly offered C++ while I was there, but they would have had something similarly spurious to say about why they didn't use Java instead. There's always something bad you can say about any programming language, especially if you want to make an excuse not to use it.


I learned BASIC from library books and magazines. Later I learned C++ from a book, and then quickly learned C and a whole lot more when the internet became a household thing. By the time my high school offered any course in programming, it was too late for me to learn anything from it. I would have loved an opportunity to have classroom instruction in it earlier on. To have peers to learn with, and a teacher to ask questions of would have been amazing. (Nowadays my old high school has 3 programming courses! Java, of course.)

So... take it anyway. If you want, try to learn C on your own, at the same time or later, or whenever you have the interest and inclination to do so.
zzo38
Posts: 1096
Joined: Mon Feb 07, 2011 12:46 pm

Re: What do schools have against teaching C?

Post by zzo38 »

I still think C is good, and so is assembly language. And, there is many other programming language good for use for different purpose, too.
(Free Hero Mesh - FOSS puzzle game engine)
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: What do schools have against teaching C?

Post by dougeff »

Java/Javascript
Just to make sure you are aware...Java and JavaScript are not related, and don't resemble each other in any way.

If you are interested in web programming, HTML and JavaScript will be usefull to learn.

If you want to make apps, particularly for Android devices, then Java is a good language to learn.

I like C and C++. You can do so many things with either.

python is a good language for high school aged programmers, because it is easier to read, ie. user friendly.
It's also easy to get simple programs up and running very quickly, and on any machine.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: What do schools have against teaching C?

Post by Bregalad »

There was absolutely not programming course in high-scool back when I was there (if you don't count Excel "programming") and I think there still isn't, but they're planning to introduce it. Think that the general public is ordinary people, which may not be that interested about programming computers. Low level programming is harder, so that's not the priority to teach to that public.
User avatar
Sumez
Posts: 919
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: What do schools have against teaching C?

Post by Sumez »

Can't say anything that hasn't been said here, but yeah - while I think C is good to know even if you aren't going to work with it, it's not good for teaching the basics of programming!

Java and C# are designed around the object oriented design idea (unlike C++ which sort of had it tacked on), do memory management for you, and are much more strict about when when you are allowed to build your program, pretty much enforcing ideal design patterns on you. The "only" disadvantage to using either of those would be a lower performance (which is surprisingly rarely relevant in most real life scenarios), and less control of dependencies.
Both of those languages are absolutely ideal for teaching the concepts of object oriented programming, which is likely what you will be doing if you ever get a job working with this kind of stuff, no matter what language you'll end up coding.

One thing those languages don't teach you however, is how things work closer to the internals of the computer, and in some cases that can be really good to know. C definitely teaches you some very important points about memory management that C# or Java like to pretend don't exist, but in regards to high school level beginner classes, an assembly language would be much more beneficial for teaching kids how things work, and I'd imagine most programming classes probably do take a week or two to at least touch on that subject?
I imagine there are a lot more choices now, when I went to what corresponds to "high school" in my country around 1999, my only option was a computer class lasting about a semester, which would touch on programming in terms of Visual Basic and a short flirt with some virtual assembly language we'd be making small tasks in using some kind of simple emulator.
Neither of those would be remotely useful in finding a job later in my life, but I think they worked just fine for the purpose - giving high school students an idea of what programming languages is, how they work, and what you can do with them... although as a big nerd I was familiar with most of that stuff beforehand...
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: What do schools have against teaching C?

Post by Drew Sebastino »

Rahsennor wrote:I would go so far as to blame the modern acceptance of buggy programs as simply the way things are squarely on the C family's shoulders, because the most frequent 90% of all bugs could be (and are!) reliably caught at compile time in more advanced languages. You really do need to know what you're doing.
Which is a good thing, because that means you're the one actually writing the program and not the computer.
infiniteneslives wrote:Maybe it's just a high school thing mostly..?
It's not. I'm taking my first semester of programming at a college (even though I'm still in high school), and we've been using Java. Hopefully C better; we've only been making really simple programs so far, but the thing practically makes itself. I don't even feel like I'm doing anything.
Sumez wrote:an assembly language would be much more beneficial for teaching kids how things work, and I'd imagine most programming classes probably do take a week or two to at least touch on that subject?
Our textbook had a few pages on it, but then that was it. It felt useless for them to teach that; things like binary and machine code have absolutely no relevance to Java programming as far as I can tell.

It's frustrating to me how little everyone (not here, obviously) seems to value efficiency. I can think of several programs that aren't even "super sophisticated" but could bog down even a modern computer due to brute-force checking and whatnot. And why even make something take 2 seconds if it only needs to take 1? My conspiracy theory is that Intel and other companies encourage learning institutions not to value code efficiency so programs run poorly unless you buy their newest hardware. :lol:
Rahsennor
Posts: 479
Joined: Thu Aug 20, 2015 3:09 am

Re: What do schools have against teaching C?

Post by Rahsennor »

Espozo wrote:Which is a good thing, because that means you're the one actually writing the program and not the computer.
While I can see where you're coming from (compilers sure do generate awful code sometimes), no, it really isn't.

I'm talking about static analysis, the ability of a compiler to detect certain runtime behaviours at compile time. Even a straightforward strong type system can keep you from accidentally adding feet to meters, for instance. C is really bad for this, as it has a handful of fixed types whose sizes aren't even exactly specified (Is an int 16 or 32 bits? How about a long?), doesn't allow you to define new ones (a typedef is just an alias), will cheerfully allow you to store a value in a variable too small for it, silently discarding the high bits, and lets you put == anywhere you can use - (true story: I once wasted an entire day hunting for that typo in a 1000-line program).

In this particular case, there's no reason you can't have your cake and eat it too - a strong type system in a low-level programming language will work just fine, since it doesn't affect the generated code at all. Rust takes things a step further and enforces compile-time memory safety - null pointers, uninitialized values, dangling pointers, double-frees and all those other hard-to-debug errors are completely prevented, with no runtime impact. The compiler simply checks that you've dotted all your eyes and crossed all your tees. That sort of thing is tedious and error-prone for humans, but is literally what computers were built for. As a programmer, why wouldn't you want to make the computer do your work for you? :P

Anyway, I'm derailing the thread. My point is, there are languages out there that go out of their way to tell you when you're doing something that's going to cause you grief later on, and those languages are much better introductions to programming than ones that don't - but that doesn't have to mean those languages are only for beginners. The second-best-selling game of all time was written in Java, you know.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: What do schools have against teaching C?

Post by FrankenGraphics »

Heck, as far as install base goes, it has even been (and is) commercially sound to learn ActionScript (the language of Adobe Flash & AIR). Flash alone has 1,5 billion installations, it runs on every pc, modern console and mobile device, and games like angry birds and farmville speak for themselves in terms of economic viability. ActionScript via flash is also responsible for vast amounts of shovelware. :lol: While flash is rapidly becoming less significant as a web presence and is going to see discontinuation of development by 2020 at latest (in favor of HTML5), the more app- and game-oriented Adobe AIR is a more or less direct continuation, so ActionScript is still a valuable skill in some fields of the industry.
Post Reply