Pages: « 1 2 3 »
  Print  
Author Topic: c++0x  (Read 6131 times)
Offline (Male) MahFreenAmeh
Reply #15 Posted on: June 02, 2010, 08:01:19 PM

sysadmin
"Web Team"
Location: Austin, TX
Joined: Apr 2008
Posts: 13
AOL Instant Messenger - sirmxe
View Profile WWW Email
Retro: References and pointers. Two ways to point to memory. Yes, they're both useful. No, they're not simple. Learning to use C++ isn't that hard, I agree. But understanding all of its little details so you never run into weird situations is extremely difficult.

luiscubal: NULL should never have existed that way in the first place, and it's all caps. nullptr could easily be null without causing problems with NULL. It's stupid to call it nullptr no matter how it came to be that way. Besides, that's the point.

hi my name is NULL and i am a macro

 :troll:
Logged
sys(tem)admin(istrator)
[java,c++,c,javascript,html,css,php,perl,ruby,python,sql]
if you've got ideas, let me hear them.
Offline (Male) RetroX
Reply #16 Posted on: June 02, 2010, 08:12:57 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Yes, they're both useful. No, they're not simple.
What's not simple about them?  The pointer is where the variable is in memory.  The reference is that variable, not its value.  Yeah, there are a few operators to convert between them that don't make much sense, but you can still learn what they do.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) luiscubal
Reply #17 Posted on: June 03, 2010, 05:46:36 AM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
Compare it to Java, where stuff just magically goes around and people getting started don't even think about what's a pointer.

Is it stupid to be like this? Maybe. Will they risk getting trouble later due to incorrect assumptions? Maybe.
However, it IS simple.

So in Java: There are objects which are passed around.
In C++: There are objects which can be referenced, copied or accessed through their memory address.

Maybe you like C++ better than Java, but it is indeed more complex.

And pointers aren't the worse part of C++. You can code in C++ for a long time and still miss important details. C++ is easily one of the most bloated programming languages ever(C is not, though).
Logged
Offline (Male) RetroX
Reply #18 Posted on: June 03, 2010, 02:39:00 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
C++ can be used exactly like Java.  Object can be used to access any type, which can be coded in C.  It's just that C doesn't force you to use it.  Same thing with length and jagged arrays and other random, useless features that Java has.  You can do them in C++, but they're not forced.

How is C++ bloated?  It's "more bloated" than C, yes, but Java is far more bloated than either.  I don't quite understand your logic, here.

"Bloated" would mean "has more features than reasonable" in my opinion, and as far as Java goes, a lot more features are default than necessary.  Yes, it has several extra, useful functions that aren't in the C++ standard libraries, but the default functions that Java automatically uses are way too much.
« Last Edit: June 03, 2010, 02:53:51 PM by RetroX » Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) luiscubal
Reply #19 Posted on: June 03, 2010, 03:37:55 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
It's not a matter of what you use. It's a matter of what it has.
Sure, I might avoid pointers in C++, but C++ has pointers. Pointers are part of C++ obesity.
I might avoid trigraphs in C++, but C++ has trigraphs. Trigraphs are part of C++ obesity.
I might avoid friend classes and functions in C++, but C++ has friend classes and functions. Friend classes and functions are part of C++ obesity.

C++ has grown too big. Layers on top of layers on top of layers on top of layers, for the sake of legacy. C++'s age is noticeable, even more so because it kept so much from old C.

Sorry to say this, but C++ has become obsolete. Is it worse than C? I'm not sure. It has decent features C hasn't, but does all the crap it adds worth it?

And it's a shame. Because we could really use a low-level programming language with a few high-level features. But almost nobody cares. C++ is mostly for legacy. Languages like D never became "the next big thing", because programmers meanwhile discovered better alternatives such as GC-able/JIT languages(that, and the fact that D libraries suck).
Logged
Offline (Male) RetroX
Reply #20 Posted on: June 03, 2010, 03:59:17 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Java has loads of extra stuff, too.

I don't understand why having the ability to do stuff is worse than having too much that is forcibly included.

In C++, I can code terribly and make a class for every group of functions, but it's not forced.  In Java, you're forced to.

In C++, I can create a base object class that all other classes inherit, but I don't have to.  In Java, it's done automatically, whether or not that you need it.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) luiscubal
Reply #21 Posted on: June 03, 2010, 04:14:27 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
The "extra stuff" of Java is less than the "extra stuff" of C++. Although that gets a little ambiguous if you count the API.

Grouping functions in classes isn't bad. It's organized. If anything, it solves C++'s problem of having no decent auto-completion.
C++'s lack of basic "forced stuff" means it's horribly inconsistent.

But we weren't talking about C++'s inconsistencies and brain damages. We were talking about how bloated it is.
Logged
Offline (Male) RetroX
Reply #22 Posted on: June 03, 2010, 04:20:51 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
It seems unlikely that you'll change your opinion, so, I'll stop arguing with you.

You're still wrong, though.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) retep998
Reply #23 Posted on: June 03, 2010, 04:23:57 PM

Member
Location: Where else?
Joined: Jan 2010
Posts: 248
MSN Messenger - retep998@charter.net AOL Instant Messenger - retep998 Yahoo Instant Messenger - retep998
View Profile Email
"C++ is designed to give the programmer  choice, even if this makes it possible for the programmer to choose incorrectly" -Wikipedia
"C++ does not incur overhead for features that are not used (the "zero-overhead principle")" -Wikipedia

C++ is great because it lets you do anything you want, while at the same time not slowing your game down with extra stuff you don't want. If you don't use something, it's as if it never existed.
Sure the bloat can be a bit of a burden for someone learning c++, but it's also a burden having to learn all the many languages and their programming styles which c++ easily covers.
C++ puts everything together, while giving YOU the choice of what you want to do.
If you don't like c++, then don't use it.
I think it's quite obvious that the c++ supporters here aren't going to change their mind, so there's not much point arguing.
Logged
Offline (Male) RetroX
Reply #24 Posted on: June 03, 2010, 04:32:12 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
And of course, I'm one of the worst ones to argue those kinds of points.

Thanks, retep.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) luiscubal
Reply #25 Posted on: June 03, 2010, 05:23:56 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
I have no doubt that if we could just forget legacy and design C++ from the bottom up, we could come up with something really good.
Unfortunately, C++ is not that language.

Even though I don't think C++'s feature set is needed for the vast majority of applications, one can actually see how it can be useful. But just not C++. C++ has so much legacy that adding anything to the language is painful.

Also, C++ isn't infinitively extensible. At some point, it's better to just design a C++-made VM and use something else. Garbage collection(yes, it is useful) is notably bad in C++. Although I heard they intend to add it to a later version, I just don't see any way to add it nicely.
Logged
Offline (Male) RetroX
Reply #26 Posted on: June 03, 2010, 06:26:23 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Again, I'm no longer arguing with you.  You can't make a valid argument.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Male) Rusky
Reply #27 Posted on: June 03, 2010, 08:52:09 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
"C++ is designed to give the programmer  choice, even if this makes it possible for the programmer to choose incorrectly" -Wikipedia
"C++ does not incur overhead for features that are not used (the "zero-overhead principle")" -Wikipedia

C++ is great because it lets you do anything you want, while at the same time not slowing your game down with extra stuff you don't want. If you don't use something, it's as if it never existed.
Sure the bloat can be a bit of a burden for someone learning c++, but it's also a burden having to learn all the many languages and their programming styles which c++ easily covers.
C++ puts everything together, while giving YOU the choice of what you want to do.
If you don't like c++, then don't use it.
I think it's quite obvious that the c++ supporters here aren't going to change their mind, so there's not much point arguing.
These ideas are completely orthogonal to being bloated.
Bloat is a problem for everyone- you can't just ignore features others use.
Nobody's arguing against C++ anyway. Just that it's bloated.

We all use Windows at some point or another- I'm fairly sure everyone here agrees that while it runs nearly everything you want in some form or another, it's got a lot of stuff you don't want and a lot of stuff that's designed stupidly. It's the same with a lot of useful systems- nothing is perfect, and bloat is a pretty popular problem to have.
Logged
Offline (Male) Josh @ Dreamland
Reply #28 Posted on: June 03, 2010, 09:04:16 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2960

View Profile Email
As a language, C++ is fairly bloated. That bloat doesn't really get in your way unless you are trying to parse it. The output is typically far from bloated, though there are slight amounts of overhead if you utilize more than C would give you alone.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) retep998
Reply #29 Posted on: June 03, 2010, 09:29:26 PM

Member
Location: Where else?
Joined: Jan 2010
Posts: 248
MSN Messenger - retep998@charter.net AOL Instant Messenger - retep998 Yahoo Instant Messenger - retep998
View Profile Email
There IS a way to add GC to C++.
Just create a special smart pointer class, and have a bunch of methods so they keep track of their memory and stuff.
This way you can just #include the smart pointer stuff when you want to use it, and when you don't want to you can just use normal pointers. You can even mix them in the same line of code.
This is the beauty of C++, you can do anything you want.
Logged
Pages: « 1 2 3 »
  Print