Taking a step back, or maybe it's forward?

SoundTheSurrender

Diamond Member
Mar 13, 2005
3,126
0
0
I'm trying to gain a better understanding of programming, from the terms to actually coding.

I'm a VB.NET/ASP.NET/C# programmer. At least that's where I can do my best.

Now I'm getting back into general C++.

I use a Macbook with a Mac OS so I installed Eclipse. I also picked up Object-Oriented Programming in C++ from the library.

http://www.amazon.com/Object-O...Josuttis/dp/0470843993

Does this look like a good start? I want to learn general C++ with the standard library so I can use it on either Windows/Mac/Linux/Unix whatever.

THanks
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
As long as you are linking to stdlib and using gcc to compile on the Mac you should have no problems porting to Linux/Windows.
 

presidentender

Golden Member
Jan 23, 2008
1,166
0
76
Originally posted by: degibson
Originally posted by: IHateMyJob2004
Your choice is fine, but why not Java?

Oooh lets have another C++ v. Java thread!

Why not both? Java was my first language, but I'd be in favor of someone who knows neither learning C++ first, so as to be grateful for the abstractions Java gives them.
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Originally posted by: EricMartello
C++ >>>>>> Java or any other one of those "fake" McProgrammer languages.

:roll:

Ignorance at its finest, but I guess when you're a hammer everything looks like a nail.
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
I'm so past the language snob crap. I used to look down on VB.Net people but anymore I just feel like whatever gets you what you want done, so be it brother.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
C++ >>>>>> Java or any other one of those "fake" McProgrammer languages.

Hahaha. Ok, well, then I see your C++ and raise you 8086 assembler. Why don't you use a man's language? ;)

Any microcode jocks in the house?
 

Kirby

Lifer
Apr 10, 2006
12,028
2
0
Originally posted by: Markbnj
C++ >>>>>> Java or any other one of those "fake" McProgrammer languages.

Hahaha. Ok, well, then I see your C++ and raise you 8086 assembler. Why don't you use a man's language? ;)

Any microcode jocks in the house?

Bah, I'm a l33t analytical engine programmer. ;)

<- Done work with Motorola 68HC11
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: Markbnj
C++ >>>>>> Java or any other one of those "fake" McProgrammer languages.

Hahaha. Ok, well, then I see your C++ and raise you 8086 assembler. Why don't you use a man's language? ;)

I'll see your 8086 assembler and raise you verilog -- real men write their own processors before they do any programming.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: degibson
Originally posted by: Markbnj
C++ >>>>>> Java or any other one of those "fake" McProgrammer languages.

Hahaha. Ok, well, then I see your C++ and raise you 8086 assembler. Why don't you use a man's language? ;)

I'll see your 8086 assembler and raise you verilog -- real men write their own processors before they do any programming.

I still have nightmares from VHDL :|
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: degibson
Originally posted by: Markbnj
C++ >>>>>> Java or any other one of those "fake" McProgrammer languages.

Hahaha. Ok, well, then I see your C++ and raise you 8086 assembler. Why don't you use a man's language? ;)

I'll see your 8086 assembler and raise you verilog -- real men write their own processors before they do any programming.

Haha, winner.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
And now... a response that hopefully benefits the OP.

OP, think about what you want to learn to do, not what language you're using. The first will help you decide the other. I'm not entirely sure what it is that you want -- this is a bit too vague for very much specific advice:

Originally posted by: SoundTheSurrender
I'm trying to gain a better understanding of programming, from the terms to actually coding.

If you just want to learn something new and useful, all you have to do is write something you've never written before. E.g., if you always write GUIs, try writing an SMTP server. If you're interested in learning to fly without a safety net, C, C++, and various flavors of ASM are all good choices.
 

EricMartello

Senior member
Apr 17, 2003
910
0
0
Originally posted by: JasonCoder
I'm so past the language snob crap. I used to look down on VB.Net people but anymore I just feel like whatever gets you what you want done, so be it brother.

Snobbery isn't the issue. A program written in C or C++ with no special attention to optimizations will run circles around similar code written in any of your McProgrammer languages...this includes:

VB
C#
Anything .NET
Anything with coffee nomenclature

Obviously a non-exhaustive list. Programming in assembler would be "ideal" for the fastest code, but that is not a high level language and it is not portable...furthermore, optimized C++ can keep up with ASM in terms of execution speed - negligible differences most of the time.

Much like google has relieved people of the need to actually know anything or think, McProgrammer languages are eliminating the need for programmers to actually know how to program.

Bottom line - learning C or C++ is in no way a "step back".
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: EricMartello
Originally posted by: JasonCoder
I'm so past the language snob crap. I used to look down on VB.Net people but anymore I just feel like whatever gets you what you want done, so be it brother.

Snobbery isn't the issue. A program written in C or C++ with no special attention to optimizations will run circles around similar code written in any of your McProgrammer languages...this includes:

VB
C#
Anything .NET
Anything with coffee nomenclature

Obviously a non-exhaustive list. Programming in assembler would be "ideal" for the fastest code, but that is not a high level language and it is not portable...furthermore, optimized C++ can keep up with ASM in terms of execution speed - negligible differences most of the time.

Much like google has relieved people of the need to actually know anything or think, McProgrammer languages are eliminating the need for programmers to actually know how to program.

Bottom line - learning C or C++ is in no way a "step back".

I entirely agree with EricMartello as far as the supremacy of C/C++ in the high-performance domain. I also agree with the general observation that using lower level languages tends to give you a better idea of WTF is going on than otherwise.

However, C/C++ are lacking in programmer productivity compared to McProgrammer languages. Until recently, software folks haven't had to worry much about performance in a lot of domains -- there's a good chance those days are coming to an end for a lot of people thanks to the multicore revolution, but there will probably always be code that simply isn't performance critical.

One 'problem' that often causes animosity is that it often takes ~a third of the time to implement feature_x in McProgrammer than in C++, and if feature_x isn't performance critical, then C++ junkies like myself look rather foolish for wanting to use C++.
 

Rangoric

Senior member
Apr 5, 2006
530
0
71
Originally posted by: EricMartello
Snobbery isn't the issue. A program written in C or C++ with no special attention to optimizations will run circles around similar code written in any of your McProgrammer languages...this includes:

Premature Optimization is bad.

Obviously a non-exhaustive list. Programming in assembler would be "ideal" for the fastest code, but that is not a high level language and it is not portable...furthermore, optimized C++ can keep up with ASM in terms of execution speed - negligible differences most of the time.

ASM writtten then analyzed for performance would be best, but there is a large cost in that.

Since you have to analyze at such a low level, that is time that could be better spent on higher level optimizations which tend to have a more dramatic effect. Given unlimited time ASM 'can' give better performance.

Much like google has relieved people of the need to actually know anything or think, McProgrammer languages are eliminating the need for programmers to actually know how to program.

:roll:

Bottom line - learning C or C++ is in no way a "step back".

I agree, because knowing more languages is better IMO :)
 

SoundTheSurrender

Diamond Member
Mar 13, 2005
3,126
0
0
Originally posted by: EricMartello
Originally posted by: JasonCoder
I'm so past the language snob crap. I used to look down on VB.Net people but anymore I just feel like whatever gets you what you want done, so be it brother.

Snobbery isn't the issue. A program written in C or C++ with no special attention to optimizations will run circles around similar code written in any of your McProgrammer languages...this includes:

VB
C#
Anything .NET
Anything with coffee nomenclature

Obviously a non-exhaustive list. Programming in assembler would be "ideal" for the fastest code, but that is not a high level language and it is not portable...furthermore, optimized C++ can keep up with ASM in terms of execution speed - negligible differences most of the time.

Much like google has relieved people of the need to actually know anything or think, McProgrammer languages are eliminating the need for programmers to actually know how to program.

Bottom line - learning C or C++ is in no way a "step back".

And also takes way longer to code.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Bottom line - learning C or C++ is in no way a "step back".

That, at least, we agree on. What you're missing is that 99% of all applications written are not performance bound on the speed of instruction execution. They're either waiting on the disk, waiting on the network, or waiting on the user. In that world it is far more important to have languages that increase productivity and make it easier to implement correct logic. Managed 'McProgrammer' code is far more robust and maintainable than "hard core" C or C++, especially in the hands of the average programmer. Programming is no longer just an activity for local user groups to get into over Mountain Dews on Friday nights. It's a mainstream discipline that thousands of business and organizations, and millions of people, rely on daily. Modern languages provide higher level abstractions that allow correct logic to be implemented more rapidly, and more robustly, and that's the bottom line. Nobody I know who actually wrote line-of-business apps in C++ to the Win16 or Win32 APIs misses those days. I wrote my first one to the Win16 API in 1989, and I know I sure as hell don't miss it.

It's great that C and C++ are still out there for those engineers working on applications that need absolute best execution speed. But I can tell you that in the nearly twenty years I've been doing this for a living, every time the science has advanced and provided a better set of constructs, there has been a cadre of "old timers" (or young geeks who think they are old timers) standing off to one side muttering "Pshaw! These young guys have no idea what it was like..."

 

Red Squirrel

No Lifer
May 24, 2003
71,314
14,086
126
www.anyf.ca
The beauty with C/C++ is you're not tied to a specific corporation. java is owned by sun, C#, VB, etc are Microsoft's. With C/C++ you have an easier chance to go platform inderpendant, with minimal loss of performance. If I had to pick a "managed" language I'd go Java though. But anything that can be done in a managed language can be done in C++. It's just that in C++ it can sometimes get much more complicated.

What I've started to do is any repetitious code I wrote base class/functions for and stick it in my master library which I include in all my programs. Makes my life easier and it's almost like coding using a managed language.
 

EricMartello

Senior member
Apr 17, 2003
910
0
0
Originally posted by: degibson
However, C/C++ are lacking in programmer productivity compared to McProgrammer languages. Until recently, software folks haven't had to worry much about performance in a lot of domains -- there's a good chance those days are coming to an end for a lot of people thanks to the multicore revolution, but there will probably always be code that simply isn't performance critical.

One 'problem' that often causes animosity is that it often takes ~a third of the time to implement feature_x in McProgrammer than in C++, and if feature_x isn't performance critical, then C++ junkies like myself look rather foolish for wanting to use C++.

That is the way of thinking that leads to sloppy, inefficient coding. The mentality that just because we have abundant system resources, we don't need to worry about optimizing the code...just to whatever works and get it done asap. I have a feeling a lot of small applications start out this way, but as they grow the fundamental "laziness" begins to result in code-bloat, which in turn leads to a slow, buggy application that hogs resources unnecessarily.

I'm not an old timer and I think McProgrammer languages have their place. Yes they are easier to use - that is how they were designed, but this ease of use comes at a cost. Let me use a real-world example:

Utorrent
A highly optimized bit torrent client written in C++. Total file size is around 270 KB. This program uses very little memory, executes quickly and runs with high stability. Despite its small size, it doesn't give up anything in terms of functionality or ease of use. It is a great example of why learning to code efficiently by not having to rely on "frameworks" or bloated code pools & libraries. The same application in .NET or VB would be over a megabyte in size, since the program would need to link to and include all sorts of junk (the stuff that the developer never had to know about), would rely on DLLs or MFC and stuff like that. Sure, those things make building an application easier but they're not making applications better.

The counterpart to Utorrent would be Azureus, a bit torrent client written in Java. By comparison, the program executes slowly, is very bloated, crashes frequently and does not do anything better than utorrent.

I can't argue that apps developed in C or C++ require a smarter individual and will take longer, but the speed and efficiency of the resulting application could easily make up for the increased dev time. Funny thing is that MS is pushing its .NET crap yet they won't dare code any of their "killer apps" in .NET. What language do you think they used for IE? Is MS Office done in VB or C#? I think not.

I am not an old timer, nor am I a snob. I am simply an individual who respects programmers that know their craft and take the time to write optimized code with little or no reliance on bloated, overhead-inducing frameworks and shared libraries...and I think everyone who is WILLING and ABLE to learn C or C++ should.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: EricMartello
Originally posted by: degibson
However, C/C++ are lacking in programmer productivity compared to McProgrammer languages. Until recently, software folks haven't had to worry much about performance in a lot of domains -- there's a good chance those days are coming to an end for a lot of people thanks to the multicore revolution, but there will probably always be code that simply isn't performance critical.

One 'problem' that often causes animosity is that it often takes ~a third of the time to implement feature_x in McProgrammer than in C++, and if feature_x isn't performance critical, then C++ junkies like myself look rather foolish for wanting to use C++.

That is the way of thinking that leads to sloppy, inefficient coding. The mentality that just because we have abundant system resources, we don't need to worry about optimizing the code...just to whatever works and get it done asap. I have a feeling a lot of small applications start out this way, but as they grow the fundamental "laziness" begins to result in code-bloat, which in turn leads to a slow, buggy application that hogs resources unnecessarily.

I'm not an old timer and I think McProgrammer languages have their place. Yes they are easier to use - that is how they were designed, but this ease of use comes at a cost. Let me use a real-world example:

Utorrent
A highly optimized bit torrent client written in C++. Total file size is around 270 KB. This program uses very little memory, executes quickly and runs with high stability. Despite its small size, it doesn't give up anything in terms of functionality or ease of use. It is a great example of why learning to code efficiently by not having to rely on "frameworks" or bloated code pools & libraries. The same application in .NET or VB would be over a megabyte in size, since the program would need to link to and include all sorts of junk (the stuff that the developer never had to know about), would rely on DLLs or MFC and stuff like that. Sure, those things make building an application easier but they're not making applications better.

The counterpart to Utorrent would be Azureus, a bit torrent client written in Java. By comparison, the program executes slowly, is very bloated, crashes frequently and does not do anything better than utorrent.

I can't argue that apps developed in C or C++ require a smarter individual and will take longer, but the speed and efficiency of the resulting application could easily make up for the increased dev time. Funny thing is that MS is pushing its .NET crap yet they won't dare code any of their "killer apps" in .NET. What language do you think they used for IE? Is MS Office done in VB or C#? I think not.

I am not an old timer, nor am I a snob. I am simply an individual who respects programmers that know their craft and take the time to write optimized code with little or no reliance on bloated, overhead-inducing frameworks and shared libraries...and I think everyone who is WILLING and ABLE to learn C or C++ should.


What does the language of those two programs have to do with how poorly written one of them might be? I could recreate the same scenario above with two totally different languages. Your comparison would be valid if it a) the same developers wrote both applications and b) the 2nd application is a port of the first program into a different language. Other wise you are comparing apples to oranges, and not ones grown from the same soil or location.
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
Originally posted by: EricMartello
Originally posted by: degibson
However, C/C++ are lacking in programmer productivity compared to McProgrammer languages. Until recently, software folks haven't had to worry much about performance in a lot of domains -- there's a good chance those days are coming to an end for a lot of people thanks to the multicore revolution, but there will probably always be code that simply isn't performance critical.

One 'problem' that often causes animosity is that it often takes ~a third of the time to implement feature_x in McProgrammer than in C++, and if feature_x isn't performance critical, then C++ junkies like myself look rather foolish for wanting to use C++.

That is the way of thinking that leads to sloppy, inefficient coding. The mentality that just because we have abundant system resources, we don't need to worry about optimizing the code...just to whatever works and get it done asap. I have a feeling a lot of small applications start out this way, but as they grow the fundamental "laziness" begins to result in code-bloat, which in turn leads to a slow, buggy application that hogs resources unnecessarily.

I'm not an old timer and I think McProgrammer languages have their place. Yes they are easier to use - that is how they were designed, but this ease of use comes at a cost. Let me use a real-world example:

Utorrent
A highly optimized bit torrent client written in C++. Total file size is around 270 KB. This program uses very little memory, executes quickly and runs with high stability. Despite its small size, it doesn't give up anything in terms of functionality or ease of use. It is a great example of why learning to code efficiently by not having to rely on "frameworks" or bloated code pools & libraries. The same application in .NET or VB would be over a megabyte in size, since the program would need to link to and include all sorts of junk (the stuff that the developer never had to know about), would rely on DLLs or MFC and stuff like that. Sure, those things make building an application easier but they're not making applications better.

The counterpart to Utorrent would be Azureus, a bit torrent client written in Java. By comparison, the program executes slowly, is very bloated, crashes frequently and does not do anything better than utorrent.

I can't argue that apps developed in C or C++ require a smarter individual and will take longer, but the speed and efficiency of the resulting application could easily make up for the increased dev time. Funny thing is that MS is pushing its .NET crap yet they won't dare code any of their "killer apps" in .NET. What language do you think they used for IE? Is MS Office done in VB or C#? I think not.

I am not an old timer, nor am I a snob. I am simply an individual who respects programmers that know their craft and take the time to write optimized code with little or no reliance on bloated, overhead-inducing frameworks and shared libraries...and I think everyone who is WILLING and ABLE to learn C or C++ should.

Not sure that language choice was the only factor in the overall quality of the apps but...

Nothing at all wrong with C++. But someone can code poorly in an unmanaged language just as poorly as a managed language. I should know, I've wrote my share of craptacular unmanaged apps :eek:) I'd argue the chances are better for a shitty app in C++ than for C# or Java. Last I checked Bounds Checker (tm) had a robust business going. A product that is completely unnecessary in managed code.