|
Good sharing of a growing trends.
|
|
|
|
|
I really like to read articles supporting C language to teach programming.
I teach videogames programming to people that have never written a single line of code and after looking for the best option I decided to start with C.
It was a great decision and most of the students learned a lot. In less than 20 lessons students were able to program a complete Pong game (screen management, resource loading, collision detection, basic IA...). They coded in Notepad++ and compiled with MinGW. I know they understood programming from the basis and they really enjoyed it.
To teach videogames programming, I also created a small library in C, it's called raylib (www.raylib.com).
It's been three years now teaching videogames programming in C and every year students surprise me with amazing games.
|
|
|
|
|
Poorly written, inaccurate - author does not really understand programming.
|
|
|
|
|
I absolutely disagree.
Maybe there is issue with the style but the content is far from being a vote 1.
And because Moore law fail for 10 years now!
NO increase in raw power, then while waiting for a next generation of processor (quantic class) at least 1 Millions time faster than current CPU, the need to make more for less will force to go back to low layer, close to the machine.
The recent increase of interest like C11, versus the proprietary approach of C# or the now so messy Java that are non longer inter-operable.
C stay a universal while still interoperable language.
And going from C to C++ is far easier than reverse!
Tomorrow there will be a schism, a major difference, 2 classes of programmers, 2 lands!, the warriors and the peasant.
Both are needed.
But dealing with language of highs level will force method of programming (they are build for matching a method)
Gordon
|
|
|
|
|
While I have my doubts as to what comprises the curriculum for today's students I don't see the necessity of learning low level languages for everyone. There's only so much time, maybe it's better spent on the non-technical side for most app programmers, subjects like economics and communication skills.
For an embedded programmer (and I'll include systems programmers or whatever they're called these days) not learning C (and assembly language!) is like trying to fly to the moon in a balloon. The lack of knowledge would be so great the programmer doesn't even begin to realize how far behind the skills curve they are.
Outside the world of JavaScript and iOS there's a whole other world of programming, the embedded world, where the latest skills have little use. Being able to read schematics, even lay out a circuit board, and coding in a mixed bag of C and assembly, are far more important than learning the latest framework. Target platforms are microwave ovens, car transmissions, lawn sprinklers, places where a web interface doesn't exist.
So yeah, C is one of those dark arts, relegated to the dim corners of the programming world. It does have it's place, but only for the few with the Dilbert "knack" for engineering over pure programming.
And C was hardly the first of it's kind. BCPL is the classic example of ancestry, but PDP-10 veterans will remember the BLISS systems programming language and it's innovative bit fields.
|
|
|
|
|
Hi Afzaal Ahma,
You are right, I think : a low-level, 3rd generation language such as C is able to provide students with several levels of abstraction, including level 0 which is close to the hardware... I would also recommend, for learning purposes, to get hands at the Forth language which can lead, once you got the trick, to lightning fast computations.
But this is only a personal taste...
Ok, it's good learning to program in Ruby, Python, C++ ; but it's also good to remember that C++ was initially, in its first version, a preprocessor that generated C code ; it was just a level of abstraction added to an already existing algebraic language. We're now adding just more levels of abstraction and keep forgetting the underlying issues that our code implies...
So, yes : microcontroller programming is not compatible with abstract languages ; and Curiosity did not fly successfully to Mars because it was written in Ruby...
Even the most sophisticated car embeds basic mechanical and electronic concepts in it ; A language such as C is like a ladder towards more sophisticated concepts. It helped us to naturally climb towards new levels of abstraction, without forgetting where we came from.
So I don't know if the C language would be the best programming language to learn first (maybe Pascal would be a first choice before learning C, just to take good habits before learning velocity) , but it is in my mind a definitive choice for learning programming (apart from the assembly language !).
In those times of high-level abstractions where finding a developer that got the underlying concepts is hard, this is a refreshing new to hear from someone like you who can jump to each level of the ladder...
PS : your comment on "murder of the programming concept is to teach programming on paper" reminded me an ex-colleague of mine who developed alone in his company, in the early 70's, a PL1 compiler in assembly language onto punched cards ; I think he must have used many papers since the resources were really scarce (access to the card puncher only was available only at defined times, card stack reading was availble only after 6pm to assemble its compiler, and no interactive screen to perform his tests). Ok, I know, these were "prehistoric" times, but he beat me into an informal code optimization race, in which I was working in assembly language and he was working in Fortran...
|
|
|
|
|
I do agree that C is a good tool for teaching low level programming, not necessarily the best, but there is so many resources available that it makes sense to use it as such. Also I do find that some courses seem to be lacking in the low level theories and practical examples (which BTW I tend to regard as more important than theory), not all of them, but you do find some.
Where I disagree though is in the idea that C needs to be a prerequisite for ALL programming (as your blog seems to indicate). There's some areas where using C is the exact WRONG choice, actually causing huge bugs and inefficient programs. And if a course is focused on a specific area, then it makes sense to use the language(s) most suitable to that area instead of going off on tangents which has little to no relation to what's being done. E.g. if the course is teaching client-side web programming, then it would make very little sense to incorporate something like Assembly / C. However if the course is teaching something like Systems or Embedded, then not having at least one of Assembly / C / Ada would be a crime!
But I do think that a general purpose programming course should at least have a decent session of teaching the low level - if just to indicate to the students what to look for when they need to do stuff like optimizing CPU registers and caches, and even how "true" memory management actually works (instead of just leaving it to some GC to do for them).
To put some things in perspective: C is NOT the "father of all languages". It's more like the conduit through which some of the more popular languages evolved. If you really want to get to the "father" then perhaps rather take Fortran, else you could have said Algol / BCPL (since they're actually the "ancestors" of C, like in Fortran --> Algol --> CPL --> BCPL --> C --> C++ --> Java --> Scala). Many other languages have evolved from different branches, some other branches (not much related to C) include Lisp (Arc, Common Lisp, Scheme, Clojure, K, R, Lua, Logo, etc.), ML (Caml, OCaml, F#, etc.), SASL (e.g. Haskell). There are many others also: Generational list of programming languages[^]
And nearly all languages tend to grasp parts of each other from even unrelated languages. E.g. the new "fad" of including functional aspects into normally imperative languages came from Lisp (in late 50s to mid 60s), think of the filter/map/reduce stuff in Python. As another example, C++ did start with C but incorporated stuff from Simula (i.e. the ancestor of Smalltalk, which in turn is a partial ancestor of ObjC). One which has a great many ancestor paths is Apple's new Swift language, it can count all the following as its direct ancestors: ObjC, Ruby, Python, Haskell. Which in turn means it derives from languages such as C, Simula, Perl, Miranda, SASL, SETL, etc.
|
|
|
|
|
i'll start you out at a 5 and tell you how you got to a 2... You are partly correct and partly incorrect. first your outlook, from a student's perspective overseas... that's a -1 own the fact you could possibly be incorrect and that you are inexperienced in programming but can bash on an entirety of two languages (java and c#). You need to understand the roadmap of these languages. where they started out at, and you need to understand where exactly they are heading. looking at some of the ancient posts (as it appears this is a rehash to something you wrote previously and just edited) (another negative there taking you to a 3 cause in your edit you fail to mention c# going open source and eventually over time being edited and able to have the low level programming that c has.)
Finally you talk about assembly.. the 1%. you want to talk about OS programming.. talk about how windows 10 is coded in c++ and C#. talk about IOS and Android being coded in objective c and java with C thrown in for the "low level programming" you appear to be talking strictly in a linux/unix environment of programming. another negative because you are a student and don't research or know better and just talk about how students are going out in the world not knowing anything when you should in fact reflect on yourself and your teachings as you teachers are keeping up with current times and you are not.
it's not we don't teach assembly because we don't want to.. we don't teach it because the need for it is very minuscule. and the theory (thats what you should be learning) is not needed anymore. We don't teach C for the same reasons. you look at the software world asembly and C make up i'd say at best 10% of the software industry, c++ probably another 20-25% the rest is java, c# IOS/objective c, cobal and various other languages. Software development shifted.. so did the programs that teach you how to do it. it's like power.. they wouldn't teach you how to operate a coal plant at a nuclear power plant. that information is useless and so is this post.
|
|
|
|
|
Thank you for time and comment Micah, I agree to most of the things that you have mentioned, but I disagree to a few also.
First of all, yes, your down-vote is valid. I am still a student, and I am learning programming... You should know that I am learning programming on my own. Not by my teacher. Not because I want to learn C, but because I don't think he can teach me to an extent that I want to. He would force me to cram the arrays to be
int arr[5] = { 1, 2, 3, 4, 5};
But he won't tell me how these objects are created, is constructor called on all 5 elements, is destructor called when all of these objects are no longer required. Is that how we should teach programming? To force students to just cram the paradigm?
This post was made on 20th November, and I did not know that .NET framework (including C# and compilers) was going open source (which went open source on 12th November). I don't see how that is a reason to down-vote this post.
I don't want to stick to today's requirement. I don't want to build applications and make $10k a month. I want to know what a computer is, how computers work, how RAM and other stuff are organized. Is that too much to ask for a student? If you're going to down-vote me, because I don't want to stick to the scripts of today's programming institutions. Then, go ahead! But, I am going to learn C and I am also going to provide an overview of C and Assembly Language to my students (yes, I do teach programming in C# and building .NET applications) in my area.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I think you make some valid points.
I would agree that it is important to learn:
- the basics of computer architecture
- resource management
- the ability to manage pointers
- the difference between low-level and high-level programming
However, I disagree with many of your other points especially towards the preference of C first.
One should always select the best tool for the job. I would argue that you have it backwards, and C is the right language 10% of the time, not 90%.
One should reach for the highest level of abstraction that your program can tolerate, learn and select efficient algorithms and data structures. If the program is too slow, profile, find the bottlenecks and optimize.
The level of quality of software does not have to do with the language it is written in for most cases. It is the level of attention the developer devotes to solving the problems and creating a quality product.
It is much easier to write a poor quality program in C that the higher level languages. Simply for the reason that there are so many more responsibilities for the programmer to write a safe and correct program. The reason for choosing this path is the control gained over resource management.
Computers have become a commodity. We are not starved for computing power. The majority of programs that are written, do not require assembly level optimizations to eek out every cycle of performance. Though, those types of programs, and the skills required to create them still are needed, by those that write them.
To summarize, new developers should be taught what exist and the basic skills required to analyze and make informed decisions. Then, use these skills to assess their situation, and choose the best tool for the job.
Regards,
Paul
|
|
|
|
|
Thank you for your time and comment Paul, I do appreciate your comment. These were a few opinions I had, not every one has to have.
A few moments ago, I said the same thing. If you give the following comment[^] on this blog post a look, you wil be able to find out that my opinion about commercial applications is same. An application should never be created in C language, because there are many points where C lags behind as compared to other programming languages such as C#. But C, where I was praising it, was the way it teaches the memory efficiency and other underground concepts, such as pointers and references; malloc etc.
You are right, C programming language is not the best fit for a programmer to use. Although it is efficient, but efficiency is not the only component to be used, resilience should also be the core of a software. Where C# would be a good substitute.
I did mention that these are my views, if you say then I would add these above paragraphs to the post. Should I?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
No, there is no need to state that these are your opinions, it's implied based on the type of article. Also, your experience and opinions are very welcomed at CodeProject.
You do strongly state how often C should be used, 90%. This is a very strong statement, because it implies the majority of applications have been written in the wrong language. It should be noted, your strong statements have provoked the great number of comments that you are receiving, with both praise and criticism.
With that said, here is my opinion based on experience:
It takes much more effort and discipline to write programs in these low level languages.
The further away from the concept of memory, processing cycles, computer architecture and even operating system, the easier it becomes to focus on the problem you are trying to solve.
Removing these abstractions creates more details for the developer to manage. The program then becomes more complex, and unnecessary complexity kills software design and implementations faster than anything else I can think of.
This is true no matter what level of the software stack you are at, as well as which language your program is written.
|
|
|
|
|
|
Thank you very much yafan.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
C is fun, even more when there is good IDE with refactoring and intellisense like tools...
|
|
|
|
|
Yes exactly. It teaches more about memory, processing, references and pointers. Although C++ is better for commercial use, but still, what C teaches, C++ can never! I prefer C over C++ in many ways. Although it would be wrong to use C for commercial purpose, but... At least for students C is better.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Very nice. I would agree with most of what you wrote in your article. I too think learning C is very valuable and makes a good base for learning higher level languages. At one point you say "always prefer low-level programming instead of high-level programming" but I would disagree with that. Every language has purpose, Java or C# were invented to allow people focus on what instead of how thus boosting the productivity. If you refuse to see that and always choose C for purity's sake you are doomed the same way as if you ignore low-level programming and only focus on the high level.
|
|
|
|
|
I would agree to your motive. You're right, there is a scale of using these languages which we need to follow. In real, Visual C# is my favourite language and I always prefer to stick to it as much as I can.
But, the main thing that I was trying to say here, was that new developers (especially students) must be taught the basics of C, and the concepts C has for the developers. There is no other such language which can be understandable by humans and also friendly to the computer system, their memory management and other stuff.
At an enterprise level, yes, you should use other frameworks such as .NET etc and build applications upon them instead of writing Assembly (low-level) or C code.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
In my opinion programming is the art of choosing the appropriate technique to solve problems.
There are problems (eg. micro-controller, devices,...), which are best to solve in C.
Since C is a high efficient technique to optimize resources and speed.
Other requirements need to be optimized to other goals, like re-useability and maintainability.
With huge Frameworks in background its mostly poison to develop efficient algorithms, since they are already there, and a programmer-artist is familiar enough with tools and framework to find the already existing - and prevent to re-invent the wheel.
In my opinion a micro-controler-developer does not need to know much about WCF, WPF, .Net, SQL, Linq and stuff - but can be an artist in his profession.
On the other hand a Database-application-architect does not need to know much about C - but must be familiar with all the stuff mentioned above - to be an artist.
And I'm really annoyed to see you ranting like "Why There Are No More Good software Anymore?".
Do you know all software?
Do you know Firefox at least? notepad++? paint.net? Visual Studio? no good software? can you do better?
|
|
|
|
|
Ok, first of all I would love to thank you for starting a debate because I love taking part in a debate as I am a lot critic and talkative. Then, I would love to thank you for coming up and trying to tell me that I am wrong. Which, in case, I am not and in fact the last paragraph you're writing about the "good software" proves you (somewhat) wrong.
1. Yes, programming is a technique, but it does not only refer to a single problem or a single program. A programmer is not the one who can design the front-end of the simple blog website. Is he? No! He is just a web developer or should I say, the web designer. A programmer is anyone, who has the knowledge to write programs for computer to understand and perform efficiently, if I am not wrong, then it is good to say,
Quote:
Any idiot can write code computer can understand, but a programmer would write the code that humans can understand.
Does that makes (even a little bit) sense to you sir? C is used, untill today and infact most of the time Assembly is also used, for speed and efficiency, you won't see anyone trying to develop a commercial OS in Visual C# (although Visual C# is my favourite language and I am sorry to it for hating it).
2. Again wrong, think of the .NET framework, that would run on Windows based platform only. You're now stuck on only one platform to build applications and run them. But, pure C applications would run independent of the platform and the framework you're using, you can build your C application and just create a suitable executable (I am not talking about the Window's application format .exe) to run on different platforms such as Mac, Windows, or even the embedded devices too. A framework, is not the best way to do. Afterall a framework is also built right on top of C (or any other such low-level programming language).
3. Agreed! This is my point, that I am trying to make through my blog post that every developer although must stick to the standards of the programming that is being done today, but must have the basic understand and concepts of the low-level programming, for micro-controllers, embedded devices etc. C would be used, there, you cannot expect any .NET framework to work there. There are some other languages such as Arduino language[^] used for developing for such board.
4. True! But this was none of my concern or it wasn't a part of the subject of the blog post and I also didn't want to talk about the experts in programming, or the database students! You should also try to criticize the posts here that are perfectly qouted and that stick to the scenario. However, you're right, SQL developer has no concern with C language, and would never have because SQL itself is a language.
5. Coming to the last point that you've made. Before I go critic on you, I would to ask you another question before answering your question.
Did you try to Google for a question like, "Which language {software} was written in?". Google would have helped you out a lot. For example, Firefox was written in C/C++ language just that the front-end was written in HTML, CSS and JavaScript[^]. Second, I do love Visual Studio, and the answer is same again. The main code for the Visual Studio was written in C++, just the front-end programming was done in XAML/C#[^].
This totally proves you wrong, and totally off-the-track to criticize my legit blog post. Ok, enough criticizing and proving you wrong. Now I would like to tell you what I actually meant here while writing the blog post.
You know, there are many institutes around the globe trying to create good developers and programmers and they teach them Java or C++, and most of them should I say, 70% of them teach just the keywords of the programming. I was one of the students who were taught just the basics of loop using a for loop and drawing a simple triangle shape with asterisks. That is the fact that I hated the most, I mean what good is a programmer if he doesn't even know what a memory is, where these variables are stored and other concepts like vectors in C++. You should also know C++ is still C. There is no major difference but just there are a few inhancements like classes and a few libraries. Try to write a program like this,
#include <stdio.h>
void main() {
printf("See, this is a C command but executed in C++!");
}
This code is of C, but executes in a C++ application because there is no major difference at all. C++ was just built on top of C itself.
New programmers, must be taught C, because C is the language which teaches them the basic usage of memory, pointers, registers, storage of a variable etc. C# and Java have their own framework on which they work and the memory and other management is done by these frameworks which, is good for noobs but not for someone trying to be a good programmer. Do you still beg to differ?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
Thanks Renju brother.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad,
Thanks for banging the drum. C is still a very useful language, useful and used. Much of working C++ is really just C with some macro-type boosting. Originally C++ was done was macros on top of C, back when C++ was getting started.
C teaches how to think about process and form in computation IN a way the modern bumper-bowling languages do not. A programmer not learning C, writing some significant programs in C, is like never learning how to do math without a calculator. The Computer Scientist and leading-edge developer community's modern diss on C is sad. It shows lack of respect for a truly pioneering language, a powerful language.
Are there alternatives to a grounding in the C language for the programmer who is wise? No. It is like a person claiming to be a Muslim scholar and yet never having learned Arabic, or a scholar of middle ages and ancient Rome and Greece who has never learned Latin or classical Greek. Or a scholar of the Christian or Jewish Bible who has never learned Hebrew.
Yet C is not some historical study. It is used in systems that have to work, and that do work.
To be a master of C requires no LINT, no IDE, no syntax highlighting in EMACS or VIM. It requires thought, and a mind that be happy in the careful manipulation of symbols, a true symbol manipulator that uses symbols to make things work. Another language of that sort is APL. Or even LISP.
Yes, a person can get down to bit level with NAND/NOR gate circuit wiring, or Assemblers, of PLC ladder logic, or actually many libraries for the newer generations of languages. But none of those languages train the symbol manipulating mind like C or APL, and a few others of similar shocking mind-developing power.
C is paleo. The healthy food of programming.
Best Regards and Egads, all!
bvw
PS: And in that significant code of C that an erstwhile pilgrim will write, by sure to use ++*ptr and variants, and mallocs and strcpy. Learn by making mistakes. Make many many many mistakes. Be bold. Without the achievement of many mistakes no one becomes wise.
modified 23-Nov-14 9:36am.
|
|
|
|
|
I totally agree to your statements and yes the new developers need to focus on the low-level programming, because without having a knowledge about low-level, the language of computer, how can one be a computer programmer. Today, most of the people are either iOS developer, Android developer or .NET developers. They don't have any knowledge on C or C++ that's why its not their right to call themselves one.
You're also right, and no offense taken for the scholar thing, you're right! When one doesn't know the basics how can be claim for a throne at all. Usually developers create a simple "Hello world" program and claim to get the reputation from the city and the honor too.
Mistakes would definitely make the programmers perfect, there is no such thing as learning the language by getting errors and exceptions. I still love how my programs complain to me saying, you've got a memory leak, you passed nothing etc.
Assembly can be a good step after C, but since nowadays people are really fond of watching their classes shaded in blue color, strings in dark brown so they won't like the Assembly language at all. That is why, I mentioned C to be atleast the low-level programming language that would be taught to them.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
The modern system of development and compile time complaints about programs, while immensely helpful for the novice, and even for the journeymen, is toxic for the master, and those who would become masters. To become a master your mistakes have to come at serious times. Like when there are a few million deployed units of you code. Or when a mistake costs a million dollars a hour until it is rectified, or the scariest cases: mistakes that cost lives, even possibly your own. Then a person gets serious about code, and how it works, and what happens when it doesn't.
Yet the great majority of people, of programmers, of IT managers, are afraid of that REAL LEARNING AND MASTERY PROCESS. Instead they replace it with super-smart IDEs that flag errors as they are typed and massive lists of bug checking in systems being built. Now as I said, those things are immensely powerful too. Yet beyond a pint in a human development they do NOT help and are toxic.
To get beyond that point you have to live with YOUR WORKING OR NONWORKING CODE in the real world, and a very real, dangerous real world. One where you will lose again and again. If you don't have some history of failed code that has caused real and significant harm in the world, I can't say you are a master. If your code has not caused a business failure, has gotten you fired for not working at the worst possible time, has not burped during a surgery, or dropped a missile from a wing at the wrong time, what kind of coder are you? It is hard to say you are a master. But failures do not made a master either. Mastery is about learning, fearsome learning, yet humbled learning. Mastery is never giving up on getting it right the next time, and about going forward and never backing off (or at least coming back into the fray of real life and coding in real life, after a "recuperation period" -- those can't be avoided sometimes).
That's the masters level of operation in living as a writer of real-world code. And the great majority of coders never get close to it. Nor do a great majority of computer scientists, and experts with many many certs, or managers who manage to keep their jobs. Whereas a master of a manager works to lose his job. Because every job is temporary, and when a project is done, or a process is established that works, the manager either has no more work available that would need his talents, or the project has been completed. This is MASTER level, remember. Most never reach to it, never even reach for it.
And as Peter Drucker said, in his massive opus, "Management", every knowledge worker is a manager. And we know that every coder is a knowledge worker. I wish that most would strive to be masters. Yet it is like choosing to take the path of hardship and struggle through life. That is the reality.
Anyway, learn C. Respect yourself. Respect your craft. Learn C. Or some language you can think algebra and computation in, a language rich in your crafts's history: APL, LISP and some others.
modified 23-Nov-14 10:27am.
|
|
|
|
|