LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-19-2009, 03:48 PM   #16
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197

Quote:
Originally Posted by cppmyths View Post
You did not comment on my summarisation of your previous post
Maybe I couldn't think of a comment polite enough to belong in this forum. Why should anyone care what I think of your intentional misrepresentation of my point of view.

Quote:
I can only take to mean you full heartedly agree
That one is just silly.

Quote:
blindly submit this misguided advice to new comers
I'm pretty sure I have noticed good C++ tutorials in the past (probably while searching for something else). I didn't keep the URLs because I didn't think I had use for them, nor did I dig very deep into the contents. I didn't notice any good C++ tutorials recently while searching for good C++ 2D gaming tutorials for my sons, but since it wasn't exactly what I was looking for, it is only slightly surprising to me that I didn't trip over them.

Quote:
the "expert" is the best judge of the content, after all it should be an "expert" who wrote the content.
I have read a lot of "expert" ideas about what is good or bad practice in programming, along with the nearly universal idea that you need to start out with good practice even in the simplest projects where you have nothing but the word of the expert that the good practice will be worth something later. I've worked on lots of projects where mediocre software engineers stick religiously to some of that "good practice" creating even worse results than they might have achieved blundering in blindly on their own. Most of that "good practice" is garbage. It just gets in the way of actual good engineering. Some of it isn't garbage and if that were the part that were taught, I could see the benefit of starting with good practice before you know enough to understand why.

But since most of the good practice that is taught is garbage, a beginner has little to judge a tutorial by other than whether he can understand and use the lesson. Unlike a book, a tutorial is quite unlikely to be so bad that even after you understand it, you can't use it. A beginner is a better judge than an expert about whether the tutorial is understandable.

Good practice matters in the big projects. In little projects it is just blindly following pointless seeming rules because you trust some expert. Trusting the wrong expert will leave you worse off than trusting no expert. You ultimately won't really learn about good practice until you see why bad practice goes wrong in big projects.

So pick your tutorial; In doing so you are picking an expert to trust. You will be learning programming but also learning style. If you picked the wrong expert, you still learned programming but may later figure out you need to unlearn the style.

Pick a book and you are picking an expert that the publisher respected. Some people think that is more likely to be an expert you should trust. I don't think so. So you'll learn theory and style. You could easily miss learning programming among that theory and style. And the theory and style might turn out to be wrong.

Quote:
to dispel the common misconception that Open Source projects are a good method for a new comer to the language to learn it.
I meant a lot by the "If your level of motivation is high" and "If it were me" that qualified my initial suggestion to try an open source project. I didn't mean to imply it is the best idea for the majority of C++ beginners.

Most people don't seem willing to learn unless someone teaches them. The source code of an open source project probably wasn't coded with the intent to teach you. You can learn from it only if you approach learning as something very different from being taught.

I always had enough well justified contempt for most of my teachers, that I never had the misconception that being taught is a significant component of learning. But I know I was never a typical student, whether learning subjects at which I am gifted or learning subjects at which I'm hopeless. So I did not mean to recommend a typical C++ student jump right into an open source project.

Jumping into a big, probably badly structured, existing project is an important part of learning to be a good software engineer. If no one will pay you to do that without the "relevant" experience, open source is a good alternative. But I think I am in the minority as one of those for whom jumping into a big existing project works well as an introduction to a new programming language. Some of those who read this thread might be in that same minority. I think they can figure out which advice applies to them.

Last edited by johnsfine; 09-19-2009 at 03:50 PM.
 
Old 09-19-2009, 04:43 PM   #17
cppmyths
LQ Newbie
 
Registered: Sep 2009
Posts: 13

Rep: Reputation: 1
John I can not comprehend what you are trying to say when you contradict yourself so many times!

Please put me out of this misery and show me an open source project or on-line tutorial which are good examples for new comers to learn from. Try looking in your none expert mode as you seem to know what a good tutorial is in that mode.
 
Old 09-19-2009, 07:20 PM   #18
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
http://www.cprogramming.com
the actual question should be "What isnt C++ good for?"
as for ideas just walk around a bit it will come 2 ya it always doz
 
Old 09-19-2009, 10:09 PM   #19
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by cppmyths View Post
This thread was brought to my attention a few days ago and it seems that this myth is infectious, so I give you a reply I made about it.
You obviously have an agenda which you are pursuing and this is not the right place for it. If you read the original post you would know that ckaz was not purporting to be a beginner.

Secondly the general thrust of the original comments were: "you can do most things with C++ so what else are you interested in? Find something and make a project of it."

For a beginner to programming, that would too greater step; although having a long term goal can be helpful to provide inspiration during those bleak moments of incomprehension.
 
Old 09-20-2009, 12:05 AM   #20
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quite honestly, it doesn't really matter the quality of a tutorial, so long as it has accurate information, doesn't withhold information or obfuscate it to the point where you can't extract all of the pertinent ideas of the language, and it doesn't over-extend the authors' own expertise. In that sense, I guess that's my criteria for a good tutorial. I'd start with a tutorial that gives you enough to be dangerous up front, start experimenting with your own programs as soon as physically possible, and keep the web nearby so you can refine your knowledge. No single tutorial or book can effectively cover everything; therefore, you should constantly be looking for new sources and watching boards such as this and http://groups.google.com/group/comp....derated/topics.

One caveat, though, is that like johnsfine, I've never had trouble learning a programming language; therefore, this might not be the best advice. That isn't to say that I'm naturally good at it: it could just be that I'm intellectually compulsive.

By the way, where did the idea come from that OP doesn't know any C++? Apparently this has become a discussion about how to learn C++, which must have been from an inference of "why learn C++?", which I don't think was ever actually said.
Kevin Barry
 
Old 09-20-2009, 05:37 AM   #21
cppmyths
LQ Newbie
 
Registered: Sep 2009
Posts: 13

Rep: Reputation: 1
Quote:
Originally Posted by graemef View Post
You obviously have an agenda which you are pursuing and this is not the right place for it. If you read the original post you would know that ckaz was not purporting to be a beginner.
Point taken.
 
Old 09-20-2009, 11:42 AM   #22
kcaz
LQ Newbie
 
Registered: Aug 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Ummm... well just look at John. He is an expert programmer and look how he started. That was also when personal computers and tutorials and books weren't available so...

Anyways I'm going to try Johns suggestion of looking at open source projects, and I'll tell you how it goes .
 
Old 09-20-2009, 01:57 PM   #23
cppmyths
LQ Newbie
 
Registered: Sep 2009
Posts: 13

Rep: Reputation: 1
Quote:
Originally Posted by kcaz View Post
Ummm... well just look at John. He is an expert programmer and look how he started. That was also when personal computers and tutorials and books weren't available so...

Anyways I'm going to try Johns suggestion of looking at open source projects, and I'll tell you how it goes .
Well it is your choice and good luck. I would just like to say experts do not normally call themselves such yet leave it to for other people to be-stow the title.

@smeezekitty I would like to detail the problems I see with the site you recommend but this is not the place for such actions. Instead I may well write an entry to the blog when I have time.

Last edited by cppmyths; 09-20-2009 at 01:59 PM.
 
Old 09-20-2009, 05:42 PM   #24
kcaz
LQ Newbie
 
Registered: Aug 2009
Posts: 18

Original Poster
Rep: Reputation: 0
OK then... now that you're done hijacking my thread, I'm going to start looking around.

Thanks so much John and everyone else .
 
Old 09-21-2009, 08:34 AM   #25
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by cppmyths View Post
Can anybody suggest a good Open Source project or on-line tutorial which they feel is good for new comers to the language?
Since I noticed a C++ tutorial recommended in a different thread today, I took a quick look at it:

http://www.cplusplus.com/doc/tutorial/

Generally it looks pretty good. It does flow a bit more like a book than like a tutorial (I don't think it takes enough advantage of being a tutorial). But it still seems to me to be a better presentation than I have seen in C++ books.

I also think it gives many details too soon. In teaching any complex subject, there is a difficult tradeoff between simplifying the initial material so much that it is misleading (including making statements about the material that are simplified to the point of being factually incorrect) vs. qualifying every statement with so much reference to advanced detail that the student is buried and confused. This tutorial certainly doesn't feel to me like it hits that balance well. But I haven't tried to write such a tutorial and I won't claim I could do better.

I also think IDE's are good for most beginners and a tutorial should select and use a specific IDE. This one doesn't. It focuses on the C++ and leaves it to the reader to figure out the mechanics of compiling and running programs. That may allow a wider audience (platform independent) but requires more side effort from the student. The fact that the tutorial focuses on just the C++ effectively means the student can't focus on just the C++.


Quote:
Originally Posted by kcaz View Post
now that you're done hijacking my thread, I'm going to start looking around.
Sorry about extending that hijack. But I think most people who want to learn C++ are better off with tutorials.

I hope jumping into an open source project works well for you. If so, please tell us which one. I can't guess from what is in this thread so far whether you already learned enough C++ that jumping into a big project would be an appropriate next step for most people, or whether you are at an earlier stage of learning C++ where I think jumping into an existing project makes sense for only a minority of people.

Last edited by johnsfine; 09-21-2009 at 08:45 AM.
 
Old 09-21-2009, 08:43 AM   #26
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Post #26 created by accident while trying to edit #25, please ignore.

Last edited by johnsfine; 09-21-2009 at 08:46 AM.
 
Old 09-21-2009, 12:23 PM   #27
kebabbert
Member
 
Registered: Jul 2005
Posts: 527

Rep: Reputation: 46
Myself like the books of Bruce Eckel. They are free on his web page. Many like his programming books. I recommend that you look at his books. He has different language books.
 
Old 09-22-2009, 09:23 PM   #28
docesam
LQ Newbie
 
Registered: Jun 2003
Posts: 14

Rep: Reputation: 1
http://www.amazon.com/All-One-Refere...pr_product_top
 
Old 09-23-2009, 12:59 AM   #29
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
It is possible to write some spectacularly impenetrable code in C++. So, when picking a project to play with, pay attention to the coding style and the comments in the code. If you can't figure it out fairly readily, try another project.

As for why use it, I turn to C++ when I have a project that will have a substantial number of different entities ("objects") that I need to track and keep sorted out - particularly if that number is not only substantial, but dynamic and/or indefinite. C++ is very very good at that; an appropriate class definition and development can eliminate a huge amount of pain as the project scales up. I also may choose to use it - or a subset of it - when I have a need to be able to manipulate strings easily and have other compelling reasons for wanting to use C.

If neither applies, I'll probably pick another language; C++ can be quite intense to debug. I like C better for many things - particularly when I am close to the hardware, and I like PHP or perl for their relative simplicity, when I'm not concerned about speed and when what I am working on is far enough from the hardware.

Just today, I completed an initial deployment in a full-up test system of a project I have been working on for nearly a year.

On one end of the system, there is a kernel driver, written in C, that talks across a PCI bus to a digital signal processor which also has a driver component on it, and some onboard data processing. The component on the DSP is also written in C, as is the onboard data processing. Why C for these components? First, the DSP manufacturer (TI) supports C on their DSP using their Code Composer development environment. Second, on the Linux side, this driver is a kernel module, and the kernel is written in C. Also, the functionality of this driver is very close to the hardware, and C lends itself to that.

This driver is controlled by a real time data processing module that is written in C, and which runs in Linux. Why C? The nature of the data that comes from the driver lends itself to a C environment; it is arrays of floating point numbers that need to be processed in a linear fashion.

The data processing module extracts the necessary intelligence and passes processed information via SNMP traps to a controller module, which is purely C++, completely object-oriented, stateless, fully asynchronous, event driven, and real-time.

Why C++? Because this controller is in charge of a large number of RF modems, from various manufacturers and with varying capabilities. It needs to be able to handle each modem appropriately, and I don't want to have the mechanisms involved in handling the modems visible in the main code, which has lots of decisions of its own to make. So, the portion of the code that deals with modems is built in a class, knows all the different modem types, and just handles it in a fashion that is transparent to the main code. The main code just looks at a thing called a modem, and the class knows what this modem is and how to operate it.

Also, this controller receives a lot of different messages, from multiple routers and from multiple data collection modules - all sending to it via SNMP traps. These messages have a standard format, but differ considerably in their details and in their disposition. All of the dirty details are handled by message classes that consist of a base class and derived classes. The main code doesn't have to worry for the most part about these details; it is simplified and streamlined.

The controller has a number of other entities - physical entities and logical entities - that it needs to keep properly sorted out, and using classes and the capabilities of C++ makes much of this automatic.

The result is a controller design that I am quite satisfied with. It will scale very well; this project will grow indefinitely without encountering the kinds of issues that you DO encounter with a statement-oriented design that isn't very carefully and rigorously designed and maintained. The properties of individual entities are isolated from each other and available as required in a fashion that will keep them from getting confused with each other. The main code is as simple as it can be, given that many of the decisions require some complex calculations to make.

That is why I chose C++ for this aspect of the project.

Last edited by jiml8; 09-23-2009 at 01:31 AM.
 
Old 09-23-2009, 01:34 AM   #30
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by jiml8 View Post
It is possible to write some spectacularly impenetrable code in C++. So, when picking a project to play with, pay attention to the coding style and the comments in the code. If you can't figure it out fairly readily, try another project.

As for why use it, I turn to C++ when I have a project that will have a substantial number of different entities ("objects") that I need to track and keep sorted out - particularly if that number is not only substantial, but dynamic and/or indefinite. C++ is very very good at that; an appropriate class definition and development can eliminate a huge amount of pain as the project scales up. I also may choose to use it - or a subset of it - when I have a need to be able to manipulate strings easily and have other compelling reasons for wanting to use C.

If neither applies, I'll probably pick another language; C++ can be quite intense to debug. I like C better for many things - particularly when I am close to the hardware, and I like PHP or perl for their relative simplicity, when I'm not concerned about speed and when what I am working on is far enough from the hardware.

Just today, I completed an initial deployment in a full-up test system of a project I have been working on for nearly a year.

On one end of the system, there is a kernel driver, written in C, that talks across a PCI bus to a digital signal processor which also has a driver component on it, and some onboard data processing. The component on the DSP is also written in C, as is the onboard data processing. Why C for these components? First, the DSP manufacturer (TI) supports C on their DSP using their Code Composer development environment. Second, on the Linux side, this driver is a kernel module, and the kernel is written in C. Also, the functionality of this driver is very close to the hardware, and C lends itself to that.

This driver is controlled by a real time data processing module that is written in C, and which runs in Linux. Why C? The nature of the data that comes from the driver lends itself to a C environment; it is arrays of floating point numbers that need to be processed in a linear fashion.

The data processing module extracts the necessary intelligence and passes processed information via SNMP traps to a controller module, which is purely C++, completely object-oriented, stateless, fully asynchronous, event driven, and real-time.

Why C++? Because this controller is in charge of a large number of RF modems, from various manufacturers and with varying capabilities. It needs to be able to handle each modem appropriately, and I don't want to have the mechanisms involved in handling the modems visible in the main code, which has lots of decisions of its own to make. So, the portion of the code that deals with modems is built in a class, knows all the different modem types, and just handles it in a fashion that is transparent to the main code. The main code just looks at a thing called a modem, and the class knows what this modem is and how to operate it.

Also, this controller receives a lot of different messages, from multiple routers and from multiple data collection modules - all sending to it via SNMP traps. These messages have a standard format, but differ considerably in their details and in their disposition. All of the dirty details are handled by message classes that consist of a base class and derived classes. The main code doesn't have to worry for the most part about these details; it is simplified and streamlined.

The controller has a number of other entities - physical entities and logical entities - that it needs to keep properly sorted out, and using classes and the capabilities of C++ makes much of this automatic.

The result is a controller design that I am quite satisfied with. It will scale very well; this project will grow indefinitely without encountering the kinds of issues that you DO encounter with a statement-oriented design that isn't very carefully and rigorously designed and maintained. The properties of individual entities are isolated from each other and available as required in a fashion that will keep them from getting confused with each other. The main code is as simple as it can be, given that many of the decisions require some complex calculations to make.

That is why I chose C++ for this aspect of the project.
like this ?:
Code:
#include <stdio.h>
#define XI "%c%xll%c"
int main(){
int j = 'h';
int u = 100;
printf(XI, (u--==99)? 11+j: 0|j, (u-=80)?++u:(u&(0xff? 83:84)),(j-86)+(u-=7));
}
 
  


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
Good morning, god day, good afternoon, good night! wumpel LinuxQuestions.org Member Intro 3 10-07-2010 04:57 AM
LXer: IBM Sun acquisition : Good for Unix. Good for Linux. Bad for HP LXer Syndicated Linux News 0 03-18-2009 11:00 AM
A good live distro with a good hardware diagnostic & profiling program? studpenguin General 2 11-25-2008 03:37 AM
Ahat is a good desktop configuration for maximum compatibility and good performance? aerostarlegacy Linux - Hardware 0 12-12-2007 01:39 AM
Good morning, Good evening, Good night. Cheeseboy LinuxQuestions.org Member Intro 2 11-04-2004 09:46 PM

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

All times are GMT -5. The time now is 03:19 PM.

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