|
-
February 11th, 2005, 06:40 AM
#1
Learning C
Hello,
I have been working with visual basic now for the last 4 years or so. I have decided that it is now time for me to get to grips with C/C#/C++.
I have a copy of Borland C/C++ and visual C++.
Have any C Gurus got any suggestions as to good reading materials that I could get into?
Also, which is your favourite version of C?
I've read in someone's sig that;
With C its easy to shoot yourself in the foot. With C++ its harder to do that, but when you do you blow your whole leg off 
I have a sketchy knowledge of java which we rushed through in class. Is java similar to C?
Thanks for your time 
Regards
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
0100 1101 0110 1001 0110 0011 0110 1000 0110 0001 0110 0101 0110 1100 0010 0000 0100 0101 0110 1100 0110 1100 0110 0101 0111 0010
-
February 11th, 2005, 06:54 AM
#2
Re: Learning C
In short terms....get the book 'Accelerated C++' and start learning C++...forget about C...
-
February 12th, 2005, 09:42 AM
#3
Re: Learning C
 Originally Posted by HairyMonkeyMan
I've read in someone's sig that;
With C its easy to shoot yourself in the foot. With C++ its harder to do that, but when you do you blow your whole leg off 
...and with Java is even harder but you can blow whole your boddy. 
Well, start learning C++ as Andreas already said, then you'll understand what Bjarne meant.
-
February 12th, 2005, 10:28 AM
#4
Re: Learning C
I (partly) disagree with ovidiucucu and Andreas. I am not a guru in programming, I just use C, C++, Matlab and Java for scientific purposes (image & video processing, pattern recognition etc). What I have understood is that C++ and Java are much more "flexible". The problem is that they are quite SLOW for computational programming:
- java is really slow (everybody knows that...)
- C++ (when using STL, at least in windows) is very-very slow
I am currently using C for computations for video processing and I find it easy to make real-time algorithms. I've used C++ for speech recognition and it was as fast as matlab was ( ) and Java for image processing (it was also very slow).
Anyway, to sum up, in my opinion object - oriented programming has lots of wonderfull things (like templates, operators overloading), even for computational programming but in most cases is much slower than pure C. So it depends on what you need that for. If you are a student and you will use programming for scientific purposes, then use some C. If not, C++ (and in my opinion better Java) are much better than C.
C book: Kerrnighan, Richie
-
February 12th, 2005, 10:46 AM
#5
Re: Learning C
 Originally Posted by yiannakop
- C++ (when using STL, at least in windows) is very-very slow
Just curious.
STL in Unix, OS2, etc. is not so "very-very slow" like in Windows is?
-
February 12th, 2005, 01:03 PM
#6
Re: Learning C
 Originally Posted by yiannakop
- C++ (when using STL, at least in windows) is very-very slow
Where did you hear that ?
-
February 12th, 2005, 01:13 PM
#7
Re: Learning C
 Originally Posted by yiannakop
- C++ (when using STL, at least in windows) is very-very slow
Perhaps C++ (when using STL, at least in windows) is very-very slow indeed, if running on 80486 computer with TURBO off.
-
February 12th, 2005, 01:44 PM
#8
Re: Learning C
 Originally Posted by yiannakop
- C++ (when using STL, at least in windows) is very-very slow
This is most likely an implementation issue with the particular compiler.
 Originally Posted by yiannakop
- java is really slow (everybody knows that...)
Some of Java's library routines (especially some of there math routines) are indeed slower then C/C++/Python's. However, Java's performance has improved over the years and many times, a Java program can run just as efficient as a C++ program.
Hungarian notation, reinterpreted? http://www.joelonsoftware.com/articles/Wrong.html
-
February 12th, 2005, 02:46 PM
#9
Re: Learning C
 Originally Posted by cma
Some of Java's library routines (especially some of there math routines) are indeed slower then C/C++/Python's. However, Java's performance has improved over the years and many times, a Java program can run just as efficient as a C++ program.
That is true... especially when it comes to object creation, C++ is somewhat slower when it comes to this... from what I've heard.
-
February 13th, 2005, 05:49 AM
#10
Re: Learning C
 Originally Posted by yiannakop
- C++ (when using STL, at least in windows) is very-very slow
Well...what do you mean with slow? The STL defines some default timing specs to which every implementation need to follow...so the run-time operation must be the same...
 Originally Posted by yiannakop
Anyway, to sum up, in my opinion object - oriented programming has lots of wonderfull things (like templates, operators overloading), even for computational programming but in most cases is much slower than pure C. So it depends on what you need that for. If you are a student and you will use programming for scientific purposes, then use some C. If not, C++ (and in my opinion better Java) are much better than C.
I don't want to argue about the topics you listed here, however, you are right in tha one should always choose the language based on the project. Nevertheless, my point was simply...in order to learn C++, I would not recommend to start with C first...
-
February 13th, 2005, 05:54 AM
#11
Re: Learning C
 Originally Posted by cma
However, Java's performance has improved over the years and many times, a Java program can run just as efficient as a C++ program.
Well...performance and efficiency are two different things...
-
February 13th, 2005, 06:03 AM
#12
-
February 13th, 2005, 01:02 PM
#13
Re: Learning C
 Originally Posted by Andreas Masur
Well...performance and efficiency are two different things... 
Well, when one speaks of efficiency, there's usually some notion of performance involved and vice-versa 
 Originally Posted by ovidiucucu
Perhaps C++ (when using STL, at least in windows) is very-very slow indeed, if running on 80486 computer with TURBO off.
Why would anyone want to run Windows on a 486 in the first place? 
I'd rather stick with DOS especially with TURBO off
Also, if you still want to learn C, look into: C Primer Plus, 4th Edition by Stephen Prata, which is a relatively easy read.
Last edited by cma; February 13th, 2005 at 01:17 PM.
Hungarian notation, reinterpreted? http://www.joelonsoftware.com/articles/Wrong.html
-
February 13th, 2005, 09:48 PM
#14
Re: Learning C
Well-written C++ code is not much more inefficient to C. Many people think OO induces this gigantic code bloat, which is not the case. Obviously code will run slower than C, but in most cases the efficiency differences between the two will only matter in cases where heavy optimization is needed.
As for Java, obviously it runs slow when compared to other languages. It is platform independant to maintain its portability, some speed has to be sacrificed, but as with C++, well-written Java code can still get decent performance
-
February 13th, 2005, 10:10 PM
#15
Re: Learning C
I seconded Ben_Phillips. Code bloat and inefficiency are usually related to poor design and improper use of the language. For example, using virtual inheritance for all classes and passing parameter only by value. As C++ offers programming paradigm, like OO as well as GP, it allows us to cope with complexity and reuse much easier. This would translate into more time saved in software development.
Beside that, take a look at Blitz++. It is supposed to provide performance on par with Fortran 77/90. Thus in IMHO, if C++ is inheritantly slow, such effort would not be undertaken in the first place.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|