LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-23-2006, 11:40 AM   #1
arnuld
Member
 
Registered: Dec 2005
Location: Punjab (INDIA)
Distribution: Arch
Posts: 211

Rep: Reputation: 30
confused about "programming"


hai all,

1st of all this post is not about C++, it is about general programming. i know about functions, variables, compilers, interpreters etc etc but i have never done any real-life coding. i am trying to learn C++ as most of the jobs in my area are for the graduates/PGs carrying these skills:

1.) C++
2.) OOA & D
3.) Design-Patterns
(programmers who can comprehend at least 50% of "Design Patterns" by GoF)
4.) experience in real-life C++ projects.
5.) experience of UNIX

now there is only one good book available in my area: "Stroustrup" (by good book i mean an author who thinks C is not prerequisite for C++). i am trying to learn C++ from it but from last 2 months my progress is not so good. i only know just a handful of C++ constructs. i am not even able to understand the "Desk Calculator" programme in chapter 6 which forms the basis of chapter 8 & then 9.

i am not even able to think of the problems what programmes i should post. one day i tried to read "K&R2" i came into immediate programming mode & started to write small useful programmes given in exercises & also understood the concepts behind these programmes pretyy well but i am avoiding C as it is not useful to my situation & even i if put time to learn C it will only increase the gap between me & C++ & hence between me & the job, the opprtunity to make & stand on my own feet at age 25. hey, dont take it wrong, the Hacker within me loves C but the corporate does not :-(

i think the problem has more to do with "immamturity & newbiness" to
programming than with C or C++. i am confused & worried about my future & my younghood.

what do you suggest?
 
Old 12-23-2006, 12:12 PM   #2
tamtam
Member
 
Registered: May 2004
Distribution: Slackware.
Posts: 323

Rep: Reputation: 33
From my own experience I would carry on learning C then move on to C++. Alternately get a good book on C++, something by Deitel&Deitel will do nicely, C++ How to Program. The hardest thing to grasp in moving from C to C++ is the OO side of things. Although you could easily learn C++ without any C knowledge, you can employ similar techniques in C++ as used in C to construct class methods.
 
Old 12-23-2006, 12:49 PM   #3
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
Of course c++ can be done with out C. Also your problem is not with c++ but with OO aspects. Object Oriented is just a method or a style to program and in reality it can also be done in C. What c++ or Java type of programming languages provide is the support for classes and objects. So first try to get the understanding about OO and then use C++ as an language for OO, and understand all the concepts with in c++(actually this should go simulteniously).

Do not use Stroustrup if you are newbie. It is though the best book its not at all good for newbie. Use boos like Teach you self C++ in 21 days or C++ Complete Reference or Thinking in C++(free available online).

Do not try to do some real life coding at the very first day, OOP takes time to learn, because its not marly programming constructs but it is rather to visualize the real life problem in terms of OOP. Robert Lafore book is also good.

Some thing about Desk Calculator, Well Stroustrup is the creator of c++ and if you try to program like him its difficult, actually that example and the entire book is written is a fashion that one can understand if one knows how programming languages work internally, rather then how to work with programming language. So just start with any other book and I am sure its not that difficult also.

Best of luck.

Last edited by hiren_bhatt; 12-23-2006 at 09:32 PM.
 
Old 12-23-2006, 01:30 PM   #4
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Quote:
Originally Posted by arnuld
1st of all this post is not about C++, it is about general programming.
Actually, the rest of your post is about C++, and it seems like you're just trying to get a job. That's respectable, but I wouldn't call it "general programming". Learning a single language isn't going to help your programming overall, but it will make you an excellent programmer drone if that's what your target company wants. However, if they want their programmers to be able to think outside the box, experience in only one language will be a detriment.

Quote:
Originally Posted by arnuld
i am avoiding C as it is not useful to my situation & even i if put time to learn C it will only increase the gap between me & C++ & hence between me & the job, the opprtunity to make & stand on my own feet at age 25. hey, dont take it wrong, the Hacker within me loves C but the corporate does not :-(
You should be aware, if you're reading Stroustrup, that C++ allows 99% of all C code. For the most part, C++ = C + new features (hence the name). Learning C is not going to make you a worse C++ programmer! Why in the world would you limit yourself to learning only one language? Sometimes you've got to start at the conceptual "bottom" and work your way up! (or sideways)

And I wouldn't take it so hard, because C++ is one of the hardest languages out there. It has bunches and bunches of features coupled with syntax that is sometimes truly horrendous. Like the others have said, Stroustrup's book is the perfect reference for C++ -- once you know the language! It's terrible to start off in!

But I think you've got the wrong mindset about programming. You claim to know the theoreticals (variables and functions -- there's a lot more than that) and think the practicals should follow automatically. That's not the case. Programming is about equal parts knowledge and experience. And the best way to get better is to have those two proceed hand-in-hand, building both together. Write the code and learn the theory, lather, rinse, and repeat. And it takes time; you don't become great overnight.

Good luck. And please don't take this the wrong way, I'm not trying to be mean. I just believe that single-mindedness is a sure-fire way to drive yourself into a professional niche from which it is difficult to escape.
 
Old 12-23-2006, 05:07 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Book recommendations:

* Design Patterns; Gamma et al
http://www.bookpool.com/sm/0201633612

* Thinking in C++, Bruce Eckel
http://www.bookpool.com/sm/0139798099
http://www.mindview.net/Books

* Applying UML and Patterns, Craig Larman
http://www.bookpool.com/sm/0131489062

To the extent you want to design (or manage!) medium to larger scale projects, I would strongly encourage you to look at the Larman book. I've found it *incredibly* useful over the years - and I keep find myself coming back to it.

IMHO .. PSM
 
Old 12-23-2006, 08:49 PM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
I my view the best introduction to OO is Object Technology: A Manager's Guide by David Taylor. It doesn't have any programming examples but in very simple language it explains the concepts of OO. (FWIW) Don't worry about design patterns until you understand OO.
 
Old 12-23-2006, 11:37 PM   #7
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by arnuld
but i am avoiding C as it is not useful to my situation & even i if put time to learn C it will only increase the gap between me & C++ & hence between me & the job,
I totally disagree. And my employer even considers C to be a prerequisite to C++.
 
Old 12-23-2006, 11:44 PM   #8
arnuld
Member
 
Registered: Dec 2005
Location: Punjab (INDIA)
Distribution: Arch
Posts: 211

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by hiren_bhatt
Of course c++ can be done with out C. Also your problem is not with c++ but with OO aspects. Object Oriented is just a method or a style to program and in reality it can also be done in C. What c++ or Java type of programming languages provide is the support for classes and objects. So first try to get the understanding about OO and then use C++ as an language for OO, and understand all the concepts with in c++(actually this should go simulteniously).
what makes you think that trouble is OO aspect?

i dont think trouble is OO way of C++. i can't comprehend what exactly is the trouble but it is not because of OO way.


Quote:
Originally Posted by hiren_bhatt
Do not use Stroustrup if you are newbie. It is though the best book its not at all good for newbie. Use boos like Teach you self C++ in 21 days or C++ Complete Reference or Thinking in C++(free available online).
i have Eckel's book but trust me he uses "heavy C". one needs to know C & i speak so because i read 1st 5 chapters of his book. it is on my desk.
 
Old 12-24-2006, 12:05 AM   #9
arnuld
Member
 
Registered: Dec 2005
Location: Punjab (INDIA)
Distribution: Arch
Posts: 211

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by taylor_venable
Actually, the rest of your post is about C++, and it seems like you're just trying to get a job. That's respectable, but I wouldn't call it "general programming". Learning a single language isn't going to help your programming overall, but it will make you an excellent programmer drone if that's what your target company wants. However, if they want their programmers to be able to think outside the box, experience in only one language will be a detriment.
whole corporate(except 10%, of course) moves in one direction, eyes blindfolded, programmers are run like horses by "pointy-haired-bosses". they donot know what is "outside of the box". they use .NET,C++ & Java because they are a Standard, not because they need to solve a problem[1][2]


Quote:
Originally Posted by taylor_venable
You should be aware, if you're reading Stroustrup, that C++ allows 99% of all C code. For the most part, C++ = C + new features (hence the name).
yes but in C++ it is really stupid to do:

"printf("%d apples", 5)" rather than "std::cout << 5 << "apples"

both are legal but i think latter shows the right & true use of C++.

Quote:
Originally Posted by taylor_venable
Learning C is not going to make you a worse C++ programmer! Why in the world would you limit yourself to learning only one language? Sometimes you've got to start at the conceptual "bottom" and work your way up! (or sideways)
so you say the way: K&R2 -> OOA&D -> Stroustrup is fine?


Quote:
Originally Posted by taylor_venable
But I think you've got the wrong mindset about programming. You claim to know the theoreticals (variables and functions -- there's a lot more than that) and think the practicals should follow automatically. That's not the case. Programming is about equal parts knowledge and experience. And the best way to get better is to have those two proceed hand-in-hand, building both together. Write the code and learn the theory, lather, rinse, and repeat.
Hmmm... you are saying, i ,with my curent knowledge, should start coding for a project.

Quote:
Originally Posted by taylor_venable
Good luck. And please don't take this the wrong way, I'm not trying to be mean. I just believe that single-mindedness is a sure-fire way to drive yourself into a professional niche from which it is difficult to escape.
well, thanks for the "Good-luck" :-) but what makes you think i possess "single-mindness"? & what is that "niche" you are talking about?


[1] http://paulgraham.com/icad.html
[2]http://www.dilbert.com/comics/dilbert/the_characters/index.html
 
Old 12-24-2006, 05:10 AM   #10
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
Arnuld, it seems like you are not happy with some replies, but still you should respect it.Anyways
Quote:
Originally Posted by arnuld
what makes you think that trouble is OO aspect?
i dont think trouble is OO way of C++. i can't comprehend what exactly is the trouble but it is not because of OO way.
Well if you remove OO from c++ then there is not much difference between c and c++, except for example in c we use printf and in c++ we use cout, provided if you call that a difference. Though internally it is, but thats not some thing which makes c++ different form C.

If you know OO then is must not be a trouble to learn c++. Moreover let me say that its OO that make c++ special, if you know how to write c++ code and do not know OO fundamentals then its not of any meaning. Nor do corporate want some one with c++ only, they want some one with strong fundamentals, such as concepts of OO and lot other things as-well.
So if you think that trouble in not with OO then there should not be a trouble with c++.

Quote:
Originally Posted by arnuld

i have Eckel's book but trust me he uses "heavy C". one needs to know C & i speak so because i read 1st 5 chapters of his book. it is on my desk.
Well in that case use the book I told previously
Sams Teach Yourself C++ in 21 Days. It says that the book is for those who come to c++ directly and dont want to go for c.

Last edited by hiren_bhatt; 12-24-2006 at 05:12 AM.
 
Old 12-24-2006, 07:24 AM   #11
arnuld
Member
 
Registered: Dec 2005
Location: Punjab (INDIA)
Distribution: Arch
Posts: 211

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by hiren_bhatt
Arnuld, it seems like you are not happy with some replies, but still you should respect it.Anyways
you are mistaken. i never had that feeling.

Quote:
Originally Posted by hiren_bhatt
Well if you remove OO from c++ then there is not much difference between c and c++, except for example in c we use printf and in c++ we use cout, provided if you call that a difference. Though internally it is, but thats not some thing which makes c++ different form C.

If you know OO then is must not be a trouble to learn c++. Moreover let me say that its OO that make c++ special, if you know how to write c++ code and do not know OO fundamentals then its not of any meaning. Nor do corporate want some one with c++ only, they want some one with strong fundamentals, such as concepts of OO and lot other things as-well.

So if you think that trouble in not with OO then there should not be a trouble with c++.
now, that seems like a good point. now the things you mentioned in your earlier post make sense to me. it also means that C & C++ will become SAME if i remove OOP, Std. Lib. & Templates.


Quote:
Originally Posted by hiren_bhatt
Well in that case use the book I told previously Sams Teach Yourself C++ in 21 Days. It says that the book is for those who come to c++ directly and dont want to go for c.
i think i need to consider this one. ok lets go to www.gobookshopping.com
 
Old 12-24-2006, 10:39 AM   #12
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by hiren_bhatt
Well if you remove OO from c++ then there is not much difference between c and c++, except for example in c we use printf and in c++ we use cout, provided if you call that a difference. Though internally it is, but thats not some thing which makes c++ different form C.
Actually, it is. Not the fact that C++ uses a different function for output, but the fact that that function is an overloaded operator.
 
Old 12-24-2006, 11:17 AM   #13
Dan04
Member
 
Registered: Jun 2006
Location: Texas
Distribution: Ubuntu
Posts: 207

Rep: Reputation: 37
Quote:
Originally Posted by arnuld
i dont think trouble is OO way of C++. i can't comprehend what exactly is the trouble but it is not because of OO way.
I agree. OO was pretty easy to learn -- when I did it in Java.

Imho, the hardest thing about C++ is that when you declare class MyClass, you get three different types: MyClass, MyClass*, and MyClass& (plus const versions of each of these). And they behave very differently.

Code:
MyClass* p;   // does nothing; declaration only
MyClass  c;   // calls default constructor
MyClass& r;   // compile error; references must be initialized
In Java and Python, you only get one type: MyClass* (but spelled without the star). Makes things a whole lot simpler.
 
Old 12-24-2006, 12:18 PM   #14
hiren_bhatt
Member
 
Registered: Oct 2005
Distribution: FC3,Debian
Posts: 127

Rep: Reputation: 15
Quote:
Originally Posted by Dan04
Actually, it is. Not the fact that C++ uses a different function for output, but the fact that that function is an overloaded operator.
Yes I know that it is an overloaded operator and if you carefully read my post(the one that you have quoted) i have implicitly mentioned by saying "Though internally it is". I did not mentioned explicitly because i considered not going in to whose inner details. But I still stick to what I have said, that if you remove OO from c++ then there in not much difference between c and c++, since the overloaded operator also comes from OO concepts.

Quote:
Originally Posted by Dan04
OO was pretty easy to learn -- when I did it in Java.
Well weather OO in easy or not, I would not like to go in a debate. Yes its not that difficult to learn but you really need to take care when you model some real life problem into OO. I have just so far emphasized the importance of OO(and nothing else) when you work with languages like c++.
Still this is my thought, some one may differ and there is nothing wrong in that,i respect it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
wpa_supplicant confused on psk="secret password" gimmee Fedora 2 12-23-2006 05:05 AM
Confused by command "find" chen666 Linux - Newbie 4 11-11-2006 05:43 PM
Display open ports "Confused :S" ALInux Linux - Networking 8 12-13-2005 06:09 AM
"What distribution is right for me?" and other confused newbie questions. Joe Molotov Linux - Newbie 3 09-10-2001 01:23 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration