LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-21-2015, 10:37 AM   #16
retroCheck
Member
 
Registered: Jan 2015
Posts: 34

Original Poster
Rep: Reputation: Disabled

a4z - I know it was me I messed something up. I didn't think about gitHub, I will have to do that, thanks.
 
Old 02-21-2015, 02:28 PM   #17
retroCheck
Member
 
Registered: Jan 2015
Posts: 34

Original Poster
Rep: Reputation: Disabled
a4z - Changed my code and got everything working. Your way did work I just needed to add header guards. Thanks again!

SoftSprocket - I read up on header guards as you suggested and that was part of my issue, thanks.

Last edited by retroCheck; 02-21-2015 at 02:29 PM.
 
Old 02-23-2015, 09:29 AM   #18
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
I always find, personally, with C++ that one always ends up spending a lot more time on the blasted language than the problem itself.
 
1 members found this post helpful.
Old 02-23-2015, 11:55 AM   #19
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by bigearsbilly View Post
I always find, personally, with C++ that one always ends up spending a lot more time on the blasted language than the problem itself.
to bad that you had a bad week end experience when you had a look on C++, but there is no need to be frustrated and spam threads with the fact that you failed.
 
Old 02-23-2015, 06:25 PM   #20
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 bigearsbilly View Post
I always find, personally, with C++ that one always ends up spending a lot more time on the blasted language than the problem itself.
Since I was so experienced with C and ASM before I switched to C++, I had exactly that same opinion of C++ for a long time after switching.

Programming well in ASM or C is almost entirely about the fundamentals of programming well. The language neither gets in your way, nor helps you very much.

The ways that C++ helps a lot may seem unimportant at first to someone who was doing just fine without any of that help. But the ways C++ gets in your way seem to be even worse if you are a skilled and innovative programmer, than if you are a beginner.

But that overall attitude is way in the past for me. Certainly C++ and its many design flaws still get in the way every day. But once you learn to use the power of C++, every other language seems lame. A language with the power of C++ and without the severe flaws of C++ could be invented. But so far as I know, it hasn't been. It certainly isn't any of the languages in common use. Meanwhile, I'm happy to tolerate the mis features of C++ (which probably include correct use of initializer lists as I suggested in this thread) in order to get the power of C++.

Once you decide to use C++, it is a mistake to look at the mis features as an excuse to make bad use of the language. That is my response to the article NevemTeve linked as well as other beginner approaches mentioned in this thread. Sometimes the two ways of doing something are the easy way vs. the ugly but correct way. The more complicated the project, the more you will discover that the easy way is a blind alley. The designers of C++ put the ugliest features in, not out of stupidity or spite but because those features were needed. Sometimes more basic, but less obvious, language design flaws painted them into a corner allowing only an ugly solution. But for the programmer, you don't get to reinvent the basics, so you should learn the correct way to use the tool you are using.
 
1 members found this post helpful.
Old 02-23-2015, 11:30 PM   #21
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Off: Whenever I meet C++, I prepare to suffer. One of this situations is described here: http://www.linuxquestions.org/questi...ix-4175519409/ -- it isn't event programming, only compiling someone else's program.
 
Old 02-24-2015, 12:54 AM   #22
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by NevemTeve View Post
Off: Whenever I meet C++, I prepare to suffer. One of this situations is described here: http://www.linuxquestions.org/questi...ix-4175519409/ -- it isn't event programming, only compiling someone else's program.
you can say this about every language, just point to an obscure bug of some compiler/interpreter implementation on some not very much used platform.
I think this is very interesting, as soon as there is a C++ thread people appear telling how horrible C++ is.
changes nothing on the fact that large parts of the world, and even on Mars, run on C++. event the utils they use to write their C++ rants are very possible written in C++.
there are people that get it, and people that do not get, I just do not understand why the people that do not get it always have to flame OT stuff into C++. We get it, you failed, you have a trauma, now you are jealous to the C++ people because they make the cool stuff and now you have to cry like a baby.
 
Old 02-24-2015, 02:34 AM   #23
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
Quote:
Originally Posted by a4z View Post
now you are jealous to the C++ people because they make the cool stuff and now you have to cry like a baby.
Apologies, it was just a personal observation after 20 years of work.

But you are correct, I admit it, I wish I was you.
 
Old 02-24-2015, 03:13 AM   #24
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Very true, it's only me being a lame beginner... since 1992 when I finished the uni...
 
Old 02-25-2015, 12:51 AM   #25
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by bigearsbilly View Post
Apologies, it was just a personal observation after 20 years of work.

But you are correct, I admit it, I wish I was you.
I understand you wish to understand that horrible programmers write horrible solutions on matter which language you let them use. But don't be sad, maybe you understand it during your next 20 years of observation.
 
  


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
Why can't we access a protected member in a derived class by a base class's object? Aquarius_Girl Programming 5 02-04-2012 10:35 PM
[SOLVED] C++ Class object can't find class methods TheCrow33 Programming 4 01-29-2012 05:04 PM
Derived class inside parent class array, possible? xemous Programming 3 10-17-2006 11:35 AM
C++ class-object? shivaligupta Programming 2 01-06-2005 02:25 AM
Event driven object-to-object: C++ template class mecanism ( NOT STL or STDC++) bretzeltux Programming 2 12-23-2003 02:45 PM

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

All times are GMT -5. The time now is 01:47 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