CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Learning C

  1. #1
    Join Date
    Dec 2003
    Location
    Northern Ireland
    Posts
    1,362

    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

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Learning C

    In short terms....get the book 'Accelerated C++' and start learning C++...forget about C...

  3. #3
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Learning C

    Quote 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.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  4. #4
    Join Date
    Dec 2001
    Location
    Greece, Athens
    Posts
    1,015

    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
    Theodore
    Personal Web Page (some audio segmentation tools): www.di.uoa.gr/~tyiannak

  5. #5
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Learning C

    Quote 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?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  6. #6
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: Learning C

    Quote Originally Posted by yiannakop
    - C++ (when using STL, at least in windows) is very-very slow
    Where did you hear that ?
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

  7. #7
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Learning C

    Quote 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.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  8. #8
    Join Date
    Feb 2004
    Location
    USA - Florida
    Posts
    729

    Re: Learning C

    Quote 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.

    Quote 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

  9. #9
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: Learning C

    Quote 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.
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

  10. #10
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Learning C

    Quote 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...

    Quote 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...

  11. #11
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Learning C

    Quote 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...

  12. #12
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Learning C

    Take a look at Bjarne Stroustrup's FAQ.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  13. #13
    Join Date
    Feb 2004
    Location
    USA - Florida
    Posts
    729

    Re: Learning C

    Quote 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

    Quote 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

  14. #14
    Join Date
    Dec 2004
    Posts
    85

    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

  15. #15
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3,128

    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.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured