C is an important programming language. It was created more than 30 years ago by Brian Kernighan and Dennis Ritchie and it is still used a lot especially to write systems software.
The Linux kernel, for instance, is written in C.
C is the new Assembly and this makes it an important language to master if one wants to be a proficient computer scientist.
In my opinion, there are two reasons why C is the new Assembly.
The first reason is portability. Assembly code is not portable and C is. Remember, C was invented around 1973 to write UNIX in a portable way. It is more sensible to learn C than to learn, say, IA-32 Assembly code especially it your time is limited.
Secondly, programming in Assembly is rarely done today because modern processors are superscalar and therefore reorder instructions. As a result, what you write is not what is being executed (or, more precisely, the order may be different). As far as I know, it is more efficient to use a good optimising C compiler (like gcc) than trying to manually optimise Assembly code on modern processors.
C allows someone to really understand how a Von Neumann computer works. And this is crucial to become a good problem-solver.
<rant>
At the University of Mauritius, the first language a student learns is C++. More precisely, it is a limited version of C++ where all the new features are ignored (STL(!), templates and generic programming for example). During the first year, the students only does procedural programming along with a little bit of object-based programming when doing the data structure module.
In my opinion, C would have been a much better choice. Sure, printf is not as easy to use as cout but C is so much simpler to learn. And, personally, I find it more elegant.
I really think that a first year University student should know all of C (and not a small subset of a more complex language). They should really understand what a pointer is and how recursion works.
Building a strong foundation in programming is important for someone who intends to work as a programmer for years and years.
The C Programming Language should be used as a textbook along with another good book on Data Structures.
One immediate benefit is that students learning graphics or systems software would have fewer problems using the standard libraries which are mostly C libraries (UNIX system calls, the pthread concurrency library, OpenGL, etc.)
Finally, instead of learning the syntax and semantics of a language, it would be much more interesting (not to say beneficial) to learn how to solve problems. One possibility is to teach students to solve the kind of problems given during the ACM Inter Collegiate Programming Contest (the easy ones at least…)
</rant>
Opinion?
(Addendum: While reading this post, I realised that another possibility is to teach C to make the student know how a computer works and, in parallel, use a higher-level programming language like Scheme to learn about how to build data structures. Opinion?)
chege says
Why not ADA as an introduction to computer programming language at uom ?
selven says
100% agreed.
Infact.. when i came to univ.. i was expecting to learn C first then do C++. since i found it a bit illogical that we were not shown lowest level stuff .. but started with C++ immediately. I was a bit disappointed, since i already knew a bit of C++.
anywayz.. knowing C is definitely a BIG advantage. Plus that “The C programming lanaguage” book is just FANTASTIC, cin bought it, then i looked at the book, i could have asked her to lend me it.. but definitely.. it was not a book that i would have want to be lent and give it away afterwards.. that is why.. i bought it myself.. even if it was a bit expensive.
+selven
vicks says
i think it might just work.. am among the first batch to test the new cse system.. the new yearly module structure.. i think the course needs a good restructuring and frankly we should look at it from a new perspective, i know some guys in 3rd year who just can’t put together some simple lines of code to solve a basic problem..
as you said having C taught at level 1 will surely help with computer graphics and systems software.
I think having 6 modules done in paralell is a mistake. Having only 3 modules per semester i think would be nicer.
BlueBerry says
How about Scheme or LISP? It’s something I asked one of CSE’s lecturers (he’s still here) some 4 years back and the straight answer I got is that it’s not something to be reckoned with!
I’ve begun to learn it by myself shortly before entering university (guess what: the first ‘real’ ebook I downloaded was the SICP). Since I got no previous programming experience, it’s (to me) the first language I guess I’ve learned…before C or C++!
Val says
i did C during my diploma in electrical eng at uom as well as the micro processor modules! it was a big disapointment not to do any assembly language in CSE. fink its coz of the yearly system that those modules were removed. thats a real pity coz wiv assembly language u get to really understand how the microprocessor thinks and how complex simple things like just displaying a ‘hello world’ message actually is!
codin in assembly is a course a bit of a pain in the ass but still i fink that u cant truly appreciate high level languages until u’ve done things the hard way!!
seems that as usual UOM is making the wrong changes…
avinash says
To Chege:
You asked about using ADA to teach programming? Personally, I do not know ADA. My little sister who is a first year student in an Ecole d’Ingénieur in France is learning ADA as a first language. So it must be good enough…
To Selven:
TCPL is a beautiful book. Every student (and every professional) should buy it. So many people confuse C and C++. They are different languages. They have different features and they behave differently. C++ is much more complex. And this is why it should not be used to teach programming.
To Vicks:
Do you think it’s a good idea to make students solve real problems instead of focussing on the syntax and semantics of a programming language?
What do you mean about the 6 modules being done in parallel? Do you mean that a student has too much to memorise for the end of year exams?
To BlueBerry:
Not something to be reckoned with? In the sense that it is not important? I guess that many people think that functional programming is useless. But they don’t work at Google…
Have you had a look at Ruby which is somewhat close philosophically to LISP?
To Val:
I’ve just learnt that CSE students don’t do any assembly language programming! This is a pity. I think I need to have a talk with my colleagues about this. I’ll keep you informed.
vicks says
@ avinash
i think focus should be on solving real problems, write simple pseudocodes or the algo. I think its up to the university to help us to develop the mindset of a programmer. Am not telling that syntax and semantics is not important but its something that i believe some1 can learn on his own.
well all modules are yearly, with the current system we have to multitask with 6 modules lol ( involving lots of context switching) :)
the modules in computer science demands lots of research, time and actualy students with this system don’t actually get time to do it,
say we have to do 6 modules yearly.. just split it and do 3 per semester actually doing the exams of the first 3 in the semester break and put emphasis on a major project at every level having higher credits whereby students will be ask to develp something that is related to what we’ve learn thoughout the whole year.
If we have to make some1 fail.. let the first level itself deter students..
no need to wait till 3rd year, while doing the final year projects that we see some are leaving the course or some aren’t able to provide projects of a decent level.
The computer hardware module, its just an electronic module from another course, y not make soemthing more specific to cse and actually add assembly language to it??
avinash says
Hi Vicks,
Basically you are proposing that
(1) We come back to the semester-based system (except that you said you wanted to have only 3 modules except of 6)
(2) At the end of every year, we organise a major project which is eliminative.
(3) Add ASM to our existing hardware module.
AFAIK, (3) is easy to implement. (1) is what many of us think. What do other students think? And (2) is difficult to implement without an overhaul of our CSE degree programme. But it is an excellent proposition. I’ll keep it “au chaud” somewhere…
Rakesh says
i agree with vicks, the idea of having 3 yearly modules cram in 1 semester is nice. we can as if get into the real matter of the 3 modules.
say having programming and datastuctures in the same semester i think will be quite nice.
thing about assembly.. i quiet reasonable to have it in computer hardware. and uom should stop taking one module from a course and another module from another course to make a brand new one.. its a crap method.. the modules should be tailor-made to suit the new course
a good example is maths for computing.. it is made for the course and i think its great. same should be done for hardware.
i also would like to recomend that for our projects normaly its us that derive a fictive situation and project requirements..
we have a software engineering module at uom. i guess having talks with a real client and taking his requirements would have been nicer..a great way to apply both our coding skills and design skills, fand maybe for the presentation the client and attend and give his apraisal which should be taken into consideration by lectures while allocating marks..
don’t know if its possible but it is certainly very interesting to have something like that :)
Stéphane Lee says
It’s not the language that we have to learn first. It’s algorithm that we have to learn first. Your sister is learning ADA in order to learn algorithm and the logic. ADA is like Turbo Pascal. Simple language to grasp.
Once you know the logic, you can learn the pointers in C etc…
Afiif says
in the curtin BSC comp science course, 7 questions of ACM Inter Collegiate Programming Contest were qiven as continuous assignments that should be delivered every 2 weeks in the Project Management Module in the 3rd year.
At the end of the day, no marks were given for the programs of ACM as it was a management module :(
I did Java and IJVM(assembly)in the first semester and C and C++ in the second semester.
to get BSC(honours) computer science, you need to study 5 years, 41 modules while in UOM, 21 modules in 3 years is equivalent of BSC honours. that is so unfair
avinash says
I don’t think it’s a good idea to compare different degrees. Mauritius has its needs while Australia has its. I personally studied in France where I did a lot of maths and physics which UoM students don’t do at all… That’s life ;-)