![]() |
| | #1 |
| Registered User Join Date: Mar 2008 Location: PEI.Canada
Posts: 3
| What is the best of the two? Anyway, I was thinking C because the Linux kernel is programmed with such. Also, I am currently running PC Linux OS (very cool, IMO ).Anyso, whatever advice you have will be much appreciated. ![]() Later. :3 |
| Pipes is offline | |
| | #2 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,768
| The problem with simple is that it's simple. C is simple to understand, but you also have to do practically everything "by hand." C++ is much harder to fully understand, but gives you more powerful tools. |
| brewbuck is offline | |
| | #3 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| You'll be needing a LOT of C knowledge before you can tackle the Linux kernel code. As stated, C is a lower level language, and many of the things that are easy to do in C++ becomes a whole lot harder in C. And to fully understand C++ you obviously should understand and know the basis of C too - as nearly everything you can do in C can be done in C++, which of course means that some people WILL do that. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #4 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,710
| What sort of programming interests you? Writing user applications or kernel / device driver work? Have you learnt how to program yet? The analogy is learning to drive vs. choosing your car. It's all very well buying a Ferrari, but without knowing how to use it, all you're going to do is wrap it round the nearest tree. |
| Salem is offline | |
| | #5 |
| Registered User Join Date: Mar 2008 Location: PEI.Canada
Posts: 3
| I want to do application programming and game programming via OpenGL. I know the basics of C, and very, very little C++. Also, OS programming interests me, but yeah, I do need a lot more knowledge before I can tackle that. Anyway, what are some good books do you think are worth recommending? Also, which would be better for my needs, C or C++? I know I've asked it before, but now that you know what I wish to do, perhaps you could help me to decide. ![]() Anysuch, thanks again. |
| Pipes is offline | |
| | #6 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,710
| http://www.rafb.net/efnet_cpp/books/ Remember to separate learning the language (C++) from the APIs (say OpenGL). If I were starting today, I think I'd go with C++ first. |
| Salem is offline | |
| | #7 |
| Registered User Join Date: Mar 2008 Location: PEI.Canada
Posts: 3
| Ok, C++ it be. |
| Pipes is offline | |
| | #8 |
| Banned Join Date: Nov 2007
Posts: 678
| My first language was Java. Then I started doing C. And to my dismay, it lacked everything. Then I learned C++. Since they talked about Java being secure, and I was more interested in hacking (in my school days), and C++ allowed you system level access. Then came the myth buster: Java, C++ - Two books - Same number of pages I was done with Java book in say 2-3 months, was writing GUIs, networking code, applets, games etc. 2-3 months later I was still confused about the basic syntax of C++. Let alone about learning an API to make C++ worth something practical. But I like your selection, your guts, your enthusiasm. Good luck with C++! |
| manav is offline | |
| | #9 |
| Registered User Join Date: Apr 2008 Location: USA
Posts: 22
| C is an intermediate language which means that it resides somewhere between a true high level language (HLL) and assembly for the sake of this argument. C++ is the encapsulation of C functions into groups within libraries as they would apply to system objects and it is this wrapping of C that makes C++ a true HLL. C++ could compared to acting like a make file with linking instructions for managing the compilation of a C application's system code. The stepwise top down structure that basically presides over the systematic breakdown of C++ (atomic level) is as follows: 1.) C++ [ high level language:encapsulates C ] 2.) C [ Intermediate language: uppermost to assembly ] 3.) Assembly [ True intermediate language:uppermost to binary ] 4.) Binary [ Machine lingo in ones and zeros I/O:instruction sets ] C is what Unix was originally written in and BSD/Linux distros pretty much follow suit. C++ is the best choice out of C and C++ because you will inevitably learn C anyway while learning C++. Addressing C++ first will eliminate double work and suppress the confusion that allot of C developers encounter when trying to migrate to C++. An example of some of the confusion that exists between C and C++ could be summated with the following example: C's print to the console output is printf while in C++ it is std::cout. What's more confusing is the fact that you may use both printf and std::cout in the same method. The point that remains is that you would have to use/include the header files for both C and C++ in the pre-processor directives region of your file that contains the printf and std::cout function methods. To make a long nightmare short, get several books regarding: - general C++ programming - the standard template library for C++ (STL) - C++ Templates Design - the Boost Library. There will be around four to five thousand pages of reading in short order here, but it will be well worth the effort and extremely fascinating. OpenGL will simply fall into place after a good walk around the block with the previously mentioned subject matter under your hat. You will not regret the commitment. Last edited by TheRaven; 04-30-2008 at 03:37 AM. |
| TheRaven is offline | |
| | #10 |
| Afraid of widths Join Date: Apr 2008 Location: Chicago
Posts: 887
| You're completely new to programming? Start with Python. |
| medievalelks is offline | |
| | #11 |
| Registered User Join Date: Oct 2001
Posts: 2,110
| I don't agree with the concept of "learning languages". If you want to learn C, learn C. If you want to learn C++, learn C++. If you want to learn assembly, Python, Pascal, or Perl, learn those. But don't learn something because you want to learn something else. That's silly. Last edited by robwhit; 05-01-2008 at 11:03 AM. |
| robwhit is offline | |
| | #12 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Also, I'd like to point out that languages is very small part of learning to program. Learning how to solve problems using a computer is much larger part of the learning experience. Once you know how to solve a problem in C, you can solve the same problem in Pascal, Fortran or Cobol by learning the language, but no matter how much you know the syntax and semantics of a language, if you don't know how the problem itself should be solved. A similar example would be to know exactly how a diesel engine works, and how you change wheels on a lorry (truck or whatever you like to call a big transport vehicle), but you haven't even got a driving license for a car - so you can do all the work to make the vehicle ready to drive, but you can't actually use it. [And remember, part of learning to drive is learning what is the right ways to do certain maneuvers in different situations, such that you comply with laws and customs of the country where you are driving, such as stopping at red lights (except in Italy ), overtaking on the correct side (except in certain US states), etc, etc]. The process of learning how to write software is a much more difficult part than understanding the language. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #13 | |
| Afraid of widths Join Date: Apr 2008 Location: Chicago
Posts: 887
| Quote:
I'm not recommending learning Python to help learn C, I'm recommending it to help learn basic programming. Scope, flow of control, data structures, functions, classes, etc. Last edited by medievalelks; 05-01-2008 at 12:16 PM. | |
| medievalelks is offline | |
| | #14 | |
| CSharpener Join Date: Oct 2006
Posts: 5,336
| Quote:
as a result I need to support the C code where reading from file is done char by char into the temp buffer and calling strcat to append the read char to the destination buffer... [sarcasm]Thanks for such advices...[/sarcasm]
__________________ If I have eight hours for cutting wood, I spend six sharpening my axe. | |
| vart is offline | |
| | #15 | ||
| Registered User Join Date: Oct 2001
Posts: 2,110
| Quote:
![]() Quote:
| ||
| robwhit is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|