Jump to content
xisto Community
Sign in to follow this  
Mordent

C At Uni

Recommended Posts

I recently (a couple of weeks ago) started my university course here in sunny Surrey studying electronic engineering. Part of this course (or at least for the first semester or two) is looking at C programming in general, and I just wondered if anyone else actually studied a different language as a "first real language" at university. I've done programming before (and I'm getting back in to the swing of PHP when I've got time), but one of the points made about C was that it is (to put it bluntly) very popular worldwide.

 

Did anyone else study C in their first year of uni? What did you think of it? How well did you do with it? What other languages have people done in their first year at university?

 

I'm only curious, because from what I can tell C should be the main forerunner in this field (even if you went to university a decade ago), so I wanted to find out if it actually is as such.

 

Any tips for a newbie C programmer in their first few weeks? As you may have gathered I'm an electronic engineer, not a computer scientist, so programming is just one of the focuses I'll be looking at, but it's one I really do want to have an awesome stab at.

Share this post


Link to post
Share on other sites

Well, there are really no global standards when it comes to first-year programming languages, but here in Egypt C and PASCAL are the two programming language course that first-year engineering students take. I'm not sure why they teach PASCAL here, but from what I gather it's because of its less wordy syntax and of its popularity in the past.

 

C, on the other hand, is very effective for two main reasons. Firstly, if taught right, it can give a student a rather comprehensive understanding of the programming methodology in general (except for Object-Oriented Programming, of course). The second reason is that it's as close to a low-level language as you can get without actually being low-level. It has enough options for you to fine-tune your control over every aspect of your software, with the added option of directly embedding Assembly Code right into it for even finer tuning.

 

But its power and versatility is actually the very thing that makes C a rather hard language to begin with. I never really fully appreciated how powerful this language was until I read Bruce Eckel's Thinking in C, which I believe is an amazing book that virtually restructures your mind to be, if you will, One with the C! ;-)

 

If there's any tip I could give you in your first weeks, it's this: don't give up too quickly. Introduction to new concepts in C can get pretty intense at times. If there's something you don't fully understand, don't shrug it off. Stay with it till you feel comfortable enough with it. After you learn the language itself, and if you're still interested in developing your skills in it, then I think you should definitely give Bruce Eckel's book a shot. It'll transform you from a Master to an all-out Wizard.

Share this post


Link to post
Share on other sites

We had both C (1st Sem) & C++ (2nd sem) in our first year at Sikkim Manipal University. Presently, I am in the last Sem (6) of the course. It wasn't new to me as I had studied C++ for two years in Senior Secondary (which precedes the graduation degree at university). I am mentioning the time periods because it might be different in your conuntry. Anyways, before that, I had done GW-Basic for 4 years in school.The language syntax of PHP is very similar to C/C++, so you shouldn't have any real problems. The main difference between C & C++ is that C is not object oriented and as such, doesn't support classes. In PHP, variable type declaration/determination is implicit. However, in C/C++ you need to handle them explicitly.A few of my friends are also doing Electronics Engineering. Most of them have moved towards a career in software development. Initially, those without prior knowledge of programming had some difficulties. But, they managed to sail through with a bit more effort in the first two semesters. I have seen intelligent lads dump programming because it seemed like rocket science to them. But, as you would know, its quite simple, actually. The main thing one needs to develop, is an understanding of the logic of programming - how to go about writing a program for a problem statement. Apart from that, you need to learn the keywords, statements & syntax of the language.

Share this post


Link to post
Share on other sites

...

A few of my friends are also doing Electronics Engineering. Most of them have moved towards a career in software development. Initially, those without prior knowledge of programming had some difficulties. But, they managed to sail through with a bit more effort in the first two semesters. I have seen intelligent lads dump programming because it seemed like rocket science to them. But, as you would know, its quite simple, actually. The main thing one needs to develop, is an understanding of the logic of programming - how to go about writing a program for a problem statement. Apart from that, you need to learn the keywords, statements & syntax of the language.

Oh, exactly. In 20 years time C will have likely been replaced by something completely new, but it's the principles of programming that I'm learning. C is just the language used to facilitate that learning by way of being pretty universal. As for your Electronic Engineer friends, my programming lecturer has a degree in Computer Science, and he's said about 20 times in the last 2 weeks that Electronic Engineers make better programmers because they know how to design something. As someone who's got a bit of a background in programming, I can see it easily being the most fun module of my course, so I'll likely take it up as an option when it becomes available.

 

Book-wise, I've got two older books courtesy of my dad: "The C Programming Language" (2nd edition) and "The Waite Group's New C Primer Plus" (note: it is a book on C, not C++, which is something I've been asked about 50 times already). The nice thing is that C hasn't changed much in the last few decades, so they're both still relevant (and more importantly: free for me ;)).

Share this post


Link to post
Share on other sites

We started to learn C in the first semester too, for the second one we moved to C++, but it was quite easy, because I knew how to do programming in C/C++ so the first lectures really were boring, later I don't know why we moved to C# on 4th semester or was it 3 semester can't really remember, now we have some lectures programming in ASM.. So I guess it's quite popular to start with C and end with ASM, even though I heard that later they will teach PHP and similar stuff, it depends on what side of Informatics students move.. When learning C++, there are different lectures for DirectX, but in some other universities I know that they are learning OpenGL, but who cares, we only learn the "basic" stuff :PBesides, for some students programming is really a headache ;)In school they taught us Pascal and Batch scripting with .bat and .cmd files on IT lessons, even though most of the time we liked to play Quake ;)

Share this post


Link to post
Share on other sites

Oh, exactly. In 20 years time C will have likely been replaced by something completely new, but it's the principles of programming that I'm learning. C is just the language used to facilitate that learning by way of being pretty universal. As for your Electronic Engineer friends, my programming lecturer has a degree in Computer Science, and he's said about 20 times in the last 2 weeks that Electronic Engineers make better programmers because they know how to design something. As someone who's got a bit of a background in programming, I can see it easily being the most fun module of my course, so I'll likely take it up as an option when it becomes available.

 

Book-wise, I've got two older books courtesy of my dad: "The C Programming Language" (2nd edition) and "The Waite Group's New C Primer Plus" (note: it is a book on C, not C++, which is something I've been asked about 50 times already). The nice thing is that C hasn't changed much in the last few decades, so they're both still relevant (and more importantly: free for me ;)).


I can't really see C being replaced since most applications are written in C and is continually written in C. Most kernels, especially UNIX-like and Windows ones are all written in C.

 

xboxrulz

Share this post


Link to post
Share on other sites

I can't really see C being replaced since most applications are written in C and is continually written in C. Most kernels, especially UNIX-like and Windows ones are all written in C.
xboxrulz


Well people used to say that too, when moving from cobol or fortran, in some year as I read ~1999 a lot of software was written in COBOL, I mean the most software were in cobol, bank systems and etc. thats why people still learnt it, anyway I guess now in 2008 it has changed, but anyway, just look how people start using Java, C# and Ruby even though it's not as C,C++ but a lot can change in upcoming years, noone really does ASM to much for software, except drivers, OS and similar stuff or some hardcore people, because the hardware is so fast that noone cares, in the years 1985 noone really liked scripting languages, because they were quite slow, especially bigger ones, Today we can see that scripting langauges really are popular.. ;)

Share this post


Link to post
Share on other sites

I can't really see C being replaced since most applications are written in C and is continually written in C. Most kernels, especially UNIX-like and Windows ones are all written in C.
xboxrulz

Agreed that at the moment C is a pretty prevalent language, but sooner or later it will become outdated. It's just the way things go, especially with the huge jumps in computing power these last few years. Already we're writing software for computers that make the Cray supercomputer (a pretty snazy piece of kit for its time) look like an abacus, and some bright spark will come up with a clever way of doing things which will completely change programming as we know it.

It's not as if C will be gone in an instant, and it's likely still on the up rather than on a downward slope, but everything has to peak sometime. My point was that it's not the actual language of C that's important to understand at university (although it wouldn't do any harm to do so), it's the techniques and programming methods that you learn that can be applied to programming in general.

Share this post


Link to post
Share on other sites

It is not important whether it's Pascal, C or any other language at the first year of studies, as long as it's 1. procedural (to make it easy to learn starter algorithms) 2. Simple in terms of libraries and environment (so the learner doesn't get confused with all the GUI API, huge IDE's etc.)We at our university in Belgrade (Serbia) at the first year studied Pascal (for half a year) and C (other half). I find it very useful since when we were taught C++ it was quite easier than if we didn't know C already, and then came Java which was a piece of cake once we knew C++, etc.Therefore I don't agree C is going to become "obsolete" ever, especially that it's still the fastest of all higher languages, that it is a father of almost 90% most popular languages today (C#, C++, Java, Javascript, PHP, etc.) which all use C syntax.It is also the main language for developing Linux (it is a question whether they're ever going to switch to another language), Unix, and a majority of popular games today.

Share this post


Link to post
Share on other sites

I took C langauge in my first year of engineering in my university, atm iam at second year engineering so iam gona take an advanced class of it. Its pretty sad, i mean i know that C is the basis of everything and if you can do it you can learn anything. But its better to teach them PHP or java or anything advanced and more usable programing language. At the moment i know PHP, C, C++ and java. Thats alot of syntax, i wouldn't be surprised if in some exam i write:

#include<stdio.h>void main(){ int x;scanf("%d",&x);echo "x";}

Srsly it could happen XD

Share this post


Link to post
Share on other sites

I already tried to mesh Java in C:

 

for (int intCount = 0; intMin < intMax; intCount++){}

That won't work in C but sure as hell looks like C lol.

 

I learned Java in high school in grade 12 and not C.

Sorry to revive a semi-dead topic, but just a quick check on something...

 

Is the problem with the variable declaration in the for loop itself? I remember my lecturer saying that the following is valid C:

 

int intCount;for (intCount = 0; intMin < intMax; intCount++){...}
while the following isn't:

 

for (int intCount = 0; intMin < intMax; intCount++){...}

due to the fact that the variable was basically created in the for loop? Correct me if I'm wrong on that one, but it's always good to know. I'm pretty sure he also mentioned that it would work in C++ (or maybe it was Java...)?
Edited by Mordent (see edit history)

Share this post


Link to post
Share on other sites

Well, it depends on the compiler you're using, for example if you use Visual Studio, well the Microsoft, Intel and etc. compilers, then this syntax is working:

for (int intCount = 0; intMin < intMax; intCount++){...}

But it won't work on GCC, for example then using Dev-C++ which is using minigw, but the syntax where you firstly declare an Integer and only then loop works on both I guess, can't remember, because I did the C using Visual Studio, even though I started with Dev-C++, but some stuff in the Uni didn't work so thats why I moved to Microsoft.. Microsoft it self in most of the examples are encouraging the wrong syntax, but it works and is easier in fact.

I can't tell how it's with Borland, even though I think on borland you need to use this syntax and thats why it's really the right way to use it, it works everywhere and the upper works only with Microsoft:

int intCount;for (intCount = 0; intMin < intMax; intCount++){...}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.