You are not logged in.

#1 2009-09-10 20:15:34

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

I had an epiphany: C++ doesn't actually suck

Yes, for a while I was a proponent of the 'C++ is for noobs, it lets you do stupid stuff, etc.' theory. This morning, I had a major facepalm moment.

While C++ is often used by total idiots, that in and of itself does not make it a poor language. It fills a rather important niche: a [more or less] high-level language that can still easily be compiled to machine code. As long as you've got a solid foundation in C, C++ is a good choice — then you know how it works behind the scenes. Not that I'd use it for anything absolutely requiring high speed, such as kernel code.

Okay, so maybe that was obvious to the more enlightened of you, but hey — give a former Apple fanboy a chance.

Offline

#2 2009-09-10 20:35:11

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: I had an epiphany: C++ doesn't actually suck

Peasantoid wrote:

but hey — give a former Apple fanboy a chance.

I know a couple good rehabilitation clinics? tongue

Offline

#3 2009-09-10 21:05:37

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: I had an epiphany: C++ doesn't actually suck

If you don't use multiple inheritance or virtual functions (and a couple of other small things) you can compile a c++ program without any RTTI. It won't use _any_ more indirection than raw C at this point.

If you use structs with function pointers in C, that's more or less equivalient to using virtual functions in C++.

These features do _not_ cost a lot. And they should only be used when the usage enables you to improve on program design. And if the program design improves, then so does probably both memory usage and execution time.

Offline

#4 2009-09-10 21:09:38

techprophet
Member
Registered: 2008-05-13
Posts: 209

Re: I had an epiphany: C++ doesn't actually suck

IMHO is a language places artificial restrictions on the coder, you need a new language. That's why I like C/C++. No limits. It'll let you trap yourself in an infinite loop and catch ^C so you cant escape if you want.

Offline

#5 2009-09-10 21:39:43

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: I had an epiphany: C++ doesn't actually suck

Don't express your positive opinion of C++ over at suckless.org. C all the way in that place.

OTOH, there seems to be no risk of expressing anything over there today, since their listserv seems to be down...

Offline

#6 2009-09-11 01:46:34

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: I had an epiphany: C++ doesn't actually suck

ataraxia wrote:

Don't express your positive opinion of C++ over at suckless.org.

Who said anything about 'positive'?
My opinion has merely reset itself to 'huh'.

Hmm, punt's codebase might have been less messy if I'd used C++... Now there's a thought...

Last edited by Peasantoid (2009-09-11 01:50:24)

Offline

#7 2009-09-11 01:56:01

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: I had an epiphany: C++ doesn't actually suck

C++ doesn't suck. It's just overly complicated. It does have some neat features though. The only problem is when people feel the need to use as many of those features as they can. That over complicates code.


neutral

Offline

#8 2009-09-11 03:46:25

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: I had an epiphany: C++ doesn't actually suck

Doesn't that come down to the programmer rather than the language, in the end? The natural temptation to do something because you can.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#9 2009-09-11 08:16:42

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: I had an epiphany: C++ doesn't actually suck

Sure, it does. It's an underpowered, overcomplicated mess filled with pointless trivia to be memorized and busy work. Its slogan should be: "C++: at least you're not writing in C." And it doesn't even do that well, since you nearly are writing C at times.

Offline

#10 2009-09-11 09:58:40

tadzik
Member
From: &tadzik
Registered: 2009-07-17
Posts: 91

Re: I had an epiphany: C++ doesn't actually suck

pauldonnelly wrote:

Its slogan should be: "C++: at least you're not writing in C."

+1

Offline

#11 2009-09-11 11:00:08

scio
Member
From: Buffalo, NY
Registered: 2008-08-05
Posts: 366

Re: I had an epiphany: C++ doesn't actually suck

I've always loved C++, even when it gives you headaches.  Every once and a while you have those moments when you go, "Holy crap, that's cool".  Not to mention I would have Qt's baby if it let me.

Offline

#12 2009-09-11 12:29:22

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: I had an epiphany: C++ doesn't actually suck

sand_man wrote:

C++ doesn't suck. It's just overly complicated. It does have some neat features though. The only problem is when people feel the need to use as many of those features as they can. That over complicates code.

In other words:  "There are no stupid programs, just stupid programmers"? wink

Offline

#13 2009-09-11 12:33:07

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: I had an epiphany: C++ doesn't actually suck

I shorten that to just "people are stupid".

Offline

#14 2009-09-11 14:16:31

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: I had an epiphany: C++ doesn't actually suck

Therefore, it follows that this whole thread is stupid smile

Bender wrote:

We're all jerks, that's my philosophy. You, me, this jerk...

Offline

#15 2009-09-11 16:29:30

Tyriel
Member
From: Melbourne, Australia
Registered: 2009-01-20
Posts: 161
Website

Re: I had an epiphany: C++ doesn't actually suck

People hate C++ o.O?  Are they JAVA programmers by any chance?

IMHO one of the greatest programming languages in existence.  I like C as well but I do beleive programmers should use the right tool for the job and  there are many cases where an object oriented approach is superior over procedual.... *gasp*.


The software required Windows XP or better, so I installed archlinux.

Offline

#16 2009-09-11 16:38:59

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: I had an epiphany: C++ doesn't actually suck

Tyriel, have you programmed something with GTK+ in C? You will see that it's rather object oriented, even though C isn't what people usually call an object oriented language. The language you're using don't dictate the paradigm, they just make a certain paradigm easier to follow.


(lambda ())

Offline

#17 2009-09-11 17:01:50

Tyriel
Member
From: Melbourne, Australia
Registered: 2009-01-20
Posts: 161
Website

Re: I had an epiphany: C++ doesn't actually suck

Sadly Andre, I have not coded anything in GTK+ as of yet.  All my C and C++ experience was either a part of a larger system (Unix based) of for Windows based projects... evil I know but it paid the bills.  Still you have me intrigued and I shall look into it as I have wanted to write something for about a year now but I am lacking the time.

Just an example of what I meant in the last post.  I once wrote a package for connection pooling which in theory could be used for any application that needed a large number of simultaneous connections (primary intention was web applications).  Now by using inheritance I was able to allow it to use just about any database you can think of my having an abstract class containing the available methods and the children classes used for a specific database by overriding the parent methods.  Now it has been a while since I have done any significant C programming but this task imo would be more complex.

This all said there are times when I feel C is brilliant and I would rather use it.  Once again I see it as the write tool for the job at hand.


The software required Windows XP or better, so I installed archlinux.

Offline

#18 2009-09-11 23:58:52

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: I had an epiphany: C++ doesn't actually suck

pauldonnelly wrote:

Sure, it does. It's an underpowered, overcomplicated mess filled with pointless trivia to be memorized and busy work. Its slogan should be: "C++: at least you're not writing in C." And it doesn't even do that well, since you nearly are writing C at times.

... enter the omnipresent negativity-spouting language bigot.
If you're going to make such claims, please provide examples so we can derive at least some informational value from your post.

scio wrote:

I would have Qt's baby if it let me.

You... ew.

Last edited by Peasantoid (2009-09-12 00:01:37)

Offline

#19 2009-09-12 03:37:48

caelestis
Member
Registered: 2009-04-04
Posts: 88

Re: I had an epiphany: C++ doesn't actually suck

What?

C++ is a versatile language, which has many tools and paradigms that you can follow for any job. You can do procedural, if it's more efficient, or OOP if you have great gains in time management and low efficiency costs. How can you hate C++ when most of it is derived from C? Sure, you might hate it for writing kernal code, when it is important to be as efficient and low to the hardware as possible, but when you are making Video Games or managing network code, at least C++ lets you do both. With compilers getting more efficient, C++ code can run as fast as C most of the time.

If you are well versed in C and C++, then you might find that it is great to have the option of solving a problem many different ways.

Last edited by caelestis (2009-09-12 03:41:25)

Offline

#20 2009-09-12 03:43:20

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: I had an epiphany: C++ doesn't actually suck

caelestis: May I suggest that you clarify the intended recipient of your post?

If you were talking to me: I *don't* hate it [anymore]. It's a well-rounded language that manages to support two paradigms without seeming overly awkward.

Last edited by Peasantoid (2009-09-12 03:49:55)

Offline

#21 2009-09-13 03:07:51

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: I had an epiphany: C++ doesn't actually suck

Peasantoid wrote:
pauldonnelly wrote:

Sure, it does. It's an underpowered, overcomplicated mess filled with pointless trivia to be memorized and busy work. Its slogan should be: "C++: at least you're not writing in C." And it doesn't even do that well, since you nearly are writing C at times.

... enter the omnipresent negativity-spouting language bigot.
If you're going to make such claims, please provide examples so we can derive at least some informational value from your post.

Nah, this territory has been done to death. There's no need to rehash it at length here. I'm just providing some balance for this thread. It's not like we've seen any sterling arguments for C++ here either. Just a bit of "blame the programmer" and some "it's dangerous, so it must be powerful", tempered with some "C++ has moderately usable implementations of extremely common language features".

Offline

#22 2009-09-13 03:50:15

Mardoct
Member
Registered: 2009-08-17
Posts: 208

Re: I had an epiphany: C++ doesn't actually suck

Semi-related.
real_programmers.png


The human being created civilization not because of willingness but of a need to be assimilated into higher orders of structure and meaning.

Offline

#23 2009-09-13 11:58:25

techprophet
Member
Registered: 2008-05-13
Posts: 209

Re: I had an epiphany: C++ doesn't actually suck

pauldonnelly wrote:
Peasantoid wrote:
pauldonnelly wrote:

Sure, it does. It's an underpowered, overcomplicated mess filled with pointless trivia to be memorized and busy work. Its slogan should be: "C++: at least you're not writing in C." And it doesn't even do that well, since you nearly are writing C at times.

... enter the omnipresent negativity-spouting language bigot.
If you're going to make such claims, please provide examples so we can derive at least some informational value from your post.

Nah, this territory has been done to death. There's no need to rehash it at length here. I'm just providing some balance for this thread. It's not like we've seen any sterling arguments for C++ here either. Just a bit of "blame the programmer" and some "it's dangerous, so it must be powerful", tempered with some "C++ has moderately usable implementations of extremely common language features".

When you accidentally fill 400GB of space within 5 minutes of running your program, you learn not to worship C++, but rather treat it as a vengeful spirit. Respect it, but be very careful.

Offline

#24 2009-09-13 14:15:45

scio
Member
From: Buffalo, NY
Registered: 2008-08-05
Posts: 366

Re: I had an epiphany: C++ doesn't actually suck

When you purposely parse 4 gigs of data across 8 files and send that across a socket to another machine for display as a 3D graph in less than a second you worship C++.

Granted I've never tried to do that in another language, but I've never seen a high level language faster than C++ when it's done correctly.

I'm sure someone will come back with benchmarks for some other language, but count this as my sterling argument for C++.

Edit: Added whitespace to avoid tl;dr

Last edited by scio (2009-09-13 14:16:26)

Offline

#25 2009-09-13 19:36:38

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: I had an epiphany: C++ doesn't actually suck

C++ users get Boost and the STL. That's pretty cool if you ask me. If anyone looks at the results of the Computer Language Benchmark Game, you'll find that C++ with Boost is pretty much crushing everything. I understand that those are submitted algorithms and could be bested, but it's pretty convincing.

Offline

Board footer

Powered by FluxBB