• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Noulakaz

Noulakaz

The blog of Avinash, Christina, Anya and Kyan Meetoo.

  • Home
  • About
  • People
    • Christina & Avinash Meetoo
    • Avinash Meetoo
    • Christina Meetoo
    • Anya Meetoo
    • Kyan Meetoo
  • General
    • News
    • Mauritius
    • Politics
    • Education
    • Business
    • Travel
  • Computing
    • Apple
    • Linux
    • LUGM
    • Programming
    • Web
    • Technology
    • Knowledge Seven
  • Entertainment
    • Music
    • Movies
    • Photography
    • Sports

On the necessity to master C

7 April 2007 By Avinash Meetoo 13 Comments

Photo from Flickr

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?)

Filed Under: Education, Linux, Programming, Technology

Reader Interactions

Comments

  1. chege says

    7 April 2007 at 18:57

    Why not ADA as an introduction to computer programming language at uom ?

  2. selven says

    7 April 2007 at 19:14

    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

  3. vicks says

    7 April 2007 at 19:56

    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.

  4. BlueBerry says

    7 April 2007 at 22:15

    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++!

  5. Val says

    8 April 2007 at 01:02

    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…

  6. avinash says

    8 April 2007 at 19:38

    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.

  7. vicks says

    8 April 2007 at 21:29

    @ 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??

  8. avinash says

    9 April 2007 at 00:16

    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…

  9. Rakesh says

    9 April 2007 at 09:20

    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 :)

  10. Stéphane Lee says

    9 April 2007 at 10:53

    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…

  11. Afiif says

    15 January 2008 at 18:56

    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

  12. avinash says

    15 January 2008 at 18:59

    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 ;-)

Trackbacks

  1. Dennis Ritchie is dead | Noulakaz says:
    13 October 2011 at 22:10

    […] have the book and I still like to open it at random and marvel at its conciseness and precision.I still think that all computer scientists should know C.UNIXWhat can I say? UNIX is a marvelous operating system: powerful yet easy to understand. The […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Our Personal Websites

Avinash Meetoo
Christina Meetoo
Anya Meetoo
Kyan Meetoo

Related Posts

  • Programming Quiz #1
  • The best way to introduce programming
  • Was the C Programming Language one of the best and, at the same time, one of the worst things to happen?
  • Creativity in Programming

Random Posts

  • Why are there so many programming languages?
  • Liverpool wins the Champions League 2004/2005
  • What exactly is Yahoo! Pipes?
  • EXIF data for the Canon EOS 60D

Archives

  • June 2025 (1)
  • May 2025 (3)
  • April 2025 (4)
  • January 2025 (3)
  • December 2024 (2)
  • November 2024 (2)
  • October 2024 (3)
  • September 2024 (7)
  • August 2024 (1)
  • July 2024 (1)
  • June 2024 (2)
  • May 2024 (3)
  • January 2024 (2)
  • December 2023 (1)
  • October 2023 (1)
  • September 2023 (4)
  • August 2023 (3)
  • July 2023 (1)
  • June 2023 (4)
  • May 2023 (1)
  • April 2023 (1)
  • March 2023 (5)
  • February 2023 (1)
  • December 2022 (1)
  • November 2022 (1)
  • October 2022 (4)
  • August 2022 (4)
  • July 2022 (3)
  • June 2022 (5)
  • May 2022 (5)
  • January 2022 (3)
  • December 2021 (2)
  • November 2021 (1)
  • October 2021 (1)
  • September 2021 (4)
  • August 2021 (2)
  • July 2021 (14)
  • May 2021 (2)
  • April 2021 (4)
  • March 2021 (9)
  • February 2021 (2)
  • January 2021 (1)
  • October 2020 (1)
  • September 2020 (1)
  • August 2020 (2)
  • July 2020 (5)
  • June 2020 (3)
  • May 2020 (5)
  • April 2020 (6)
  • March 2020 (2)
  • February 2020 (2)
  • January 2020 (2)
  • October 2019 (1)
  • September 2019 (2)
  • July 2019 (2)
  • June 2019 (1)
  • May 2019 (3)
  • April 2019 (2)
  • March 2019 (1)
  • February 2019 (1)
  • January 2019 (3)
  • December 2018 (1)
  • October 2018 (3)
  • August 2018 (2)
  • July 2018 (2)
  • June 2018 (1)
  • May 2018 (2)
  • April 2018 (1)
  • February 2018 (1)
  • December 2017 (1)
  • October 2017 (1)
  • September 2017 (1)
  • August 2017 (1)
  • July 2017 (1)
  • May 2017 (4)
  • April 2017 (3)
  • March 2017 (4)
  • February 2017 (5)
  • January 2017 (3)
  • October 2016 (1)
  • September 2016 (1)
  • August 2016 (4)
  • July 2016 (1)
  • June 2016 (1)
  • March 2016 (3)
  • February 2016 (3)
  • January 2016 (1)
  • December 2015 (1)
  • November 2015 (2)
  • September 2015 (1)
  • August 2015 (3)
  • March 2015 (1)
  • December 2014 (1)
  • November 2014 (4)
  • October 2014 (1)
  • March 2014 (2)
  • February 2014 (3)
  • December 2013 (1)
  • October 2013 (1)
  • September 2013 (1)
  • August 2013 (1)
  • July 2013 (1)
  • June 2013 (2)
  • May 2013 (1)
  • March 2013 (3)
  • January 2013 (2)
  • December 2012 (3)
  • November 2012 (4)
  • September 2012 (3)
  • August 2012 (2)
  • July 2012 (3)
  • June 2012 (2)
  • May 2012 (1)
  • April 2012 (2)
  • February 2012 (1)
  • January 2012 (4)
  • December 2011 (2)
  • November 2011 (1)
  • October 2011 (4)
  • September 2011 (2)
  • August 2011 (1)
  • July 2011 (2)
  • June 2011 (4)
  • April 2011 (7)
  • March 2011 (2)
  • February 2011 (1)
  • January 2011 (3)
  • November 2010 (3)
  • October 2010 (1)
  • September 2010 (2)
  • August 2010 (4)
  • July 2010 (2)
  • June 2010 (1)
  • May 2010 (3)
  • April 2010 (4)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (5)
  • December 2009 (2)
  • November 2009 (3)
  • October 2009 (1)
  • September 2009 (5)
  • August 2009 (3)
  • July 2009 (1)
  • June 2009 (3)
  • May 2009 (2)
  • April 2009 (7)
  • March 2009 (12)
  • February 2009 (10)
  • January 2009 (5)
  • December 2008 (4)
  • November 2008 (11)
  • October 2008 (6)
  • September 2008 (7)
  • August 2008 (3)
  • July 2008 (8)
  • June 2008 (6)
  • May 2008 (5)
  • April 2008 (7)
  • March 2008 (6)
  • February 2008 (3)
  • January 2008 (6)
  • December 2007 (11)
  • November 2007 (10)
  • October 2007 (7)
  • September 2007 (9)
  • August 2007 (3)
  • July 2007 (7)
  • June 2007 (8)
  • May 2007 (14)
  • April 2007 (11)
  • March 2007 (18)
  • February 2007 (14)
  • January 2007 (15)
  • December 2006 (16)
  • November 2006 (10)
  • October 2006 (7)
  • September 2006 (8)
  • August 2006 (8)
  • July 2006 (6)
  • June 2006 (4)
  • May 2006 (13)
  • April 2006 (10)
  • March 2006 (11)
  • February 2006 (7)
  • January 2006 (14)
  • December 2005 (8)
  • November 2005 (6)
  • October 2005 (7)
  • September 2005 (2)
  • August 2005 (6)
  • July 2005 (2)
  • June 2005 (6)
  • May 2005 (15)
  • April 2005 (12)
  • March 2005 (3)
  • February 2005 (8)
  • January 2005 (3)
  • December 2004 (1)
  • November 2004 (2)
  • October 2004 (2)
  • September 2004 (3)
  • August 2004 (3)
  • July 2004 (3)
  • June 2004 (3)
  • May 2004 (6)
  • April 2004 (10)
  • March 2004 (12)
Creative Commons License This work is licensed by Avinash Meetoo under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Unported License.