Go ahead, I, the mighty, wonderful, beautiful, athletic C++ will answer all your questions!
Name:
Anonymous2012-02-18 4:04
Why are you so shitty?
Name:
Anonymous2012-02-18 4:14
So some containers require overloading an operator to use them (operator<) and some require template specialization fuckery with hash_code or whatever. Why the inconsistency? Surely they should all use the same mechanism (regardless of the exact operator or template specialized).
>>4
No I haven't. That's why I am asking -- is that a problem?
Name:
Anonymous2012-02-18 8:08
>>7
As a developer, it doesn't matter. The question is rather, why do you care?
It doesn't affect performance, nor code cleanliness.
Name:
Anonymous2012-02-18 9:30
I'm interested in the reason for the disparity. Is operator< consider a mistake? Wouldn't operator## or similar be much simpler to implement, and much more sensible to use?
As it stands the compiler is basically searching for a random specialization of a strange template in some unknown file which describes how to hash objects of a particular class. The coupling there is... strange to say the least.
Name:
Anonymous2012-02-18 9:44
Dear C++...
What where you smoking when you accepted to have "friend" functions????
I have just read Struct Soup's C++ book, and in the Introduction chapter, he says among the "basic good practices" to NOT use friend functions, even though you "can".
You see, I can use pointer math but is it really necessary for a Hello World?
sometimes you need a function that is used as a method, but the thing acting as the this object is not the first parameter. The << operator used with streams is the basic example, and the only thing I use friend functions for. I'll use friend classes when defining helper data types that make up a private component of a larger data type. There is probably a work around this that would improve reuse, like abstracting the helper types to a more general function, but sometimes achieving that much generality doesn't always pay off.
Name:
Anonymous2012-02-18 16:23
>>13
That is the single most brain damaged thing I've read so far. Geeze, why don't you just run along and write some more bloated code you idiot.
>>14
It can be used to accomplish the same effect achieved with lexically scoped class declarations.
Name:
Anonymous2012-02-18 19:41
TITS OR GTFO ``FAGGOT''.
Name:
Anonymous2012-02-18 19:52
Why must C++0x lambdas functions have explicit type declarations for local variables? Why can't the variables be typeless, like a variable in the most abstract?
Name:
Anonymous2012-02-18 19:58
>>17
Shut up you burger flipper, don't ask questions you don't understand.
Name:
Anonymous2012-02-20 3:48
>>9
Is anyone here actually qualified enough to answer this?
I guess there could be a hashcode unary operator. That's an interesting thought. But the operator symbols seem like they had better have some useful application for the primitives, and hash code generation for the primitives is trivial, it usually consists of a cast to an int, or reinterpreting the couple bytes as an int.
This problem is solved in java by providing the root object class with a hashcode function that may be overriden from any derived class. And one could do the same in seeples, if they wanted to wrap every primitive and every object they defined under a root object class with a virtual hashcode function. But a lot of seeples code isn't written that way, and tryig to interface with it would cause headaches. It is better to just follow suit with what is commonly done. If you don't like it enough, then just use something else.
>>19
I am not qualified to answer your question. Please disregard it.
Name:
Anonymous2012-02-20 8:34
Why are you not as good as D?
Name:
Anonymous2012-02-20 12:34
>>21 `>comparing a standardized language with a nonstandardized hack, that is probably interpreted by perl
>>23
who cares? rather, compare the platforms where C++ is supported, versus the platforms where D is supported.
D is a huge hack, that tries to do something C++ is already perfectly capable of.
Name:
Anonymous2012-02-20 13:32
>>24
also, D sports two different stdlibs... which are both incompatible to each other. that also includes phobos itself; code that compiles with dmd1, does NOT compile with dmd2, and vice versa. it's a total clusterfuck
Name:
Anonymous2012-02-20 13:47
>>25
Tango has pretty much been phased out as of D 2.0, due to massive improvements in the official D standard lib.
Name:
Anonymous2012-02-20 15:55
>>23
D is garbage. It doesn't even run on Solaris or any architecture other than x86. It's an ugly language to begin with. Even Go is more portable and nicer than that shit. Comparing D to C++ is an insult to C++ (which can be gerneralized as "Comparing D to * is an insult to *"). C++ runs on IBM mainframes, PIC microcontrollers, and everything in between. x86 assembly is more portable than D. That just proves how shit D is.
>>27
Which has to do with the fact that it's only two years old. This is one maintaining a language that's only 3 years old. Do you expect it to have as many implementations as a 30 year old language in 1/15th of the time?
>>27 PIC controllers
Hahahaha, unexperienced guys are funny.
Name:
Anonymous2012-02-20 16:53
>>29 Which has to do with the fact that it's only two years old. http://en.wikipedia.org/wiki/D_%28programming_language%29 Appeared in 2001
They had 11 years and didn't even port it to Solaris/x86 or OS X/PowerPC (Intel Macs weren't around until 2005)? Why would anyone use this language when its authors didn't even care about Macs or any platform other than Intel? D is a toy language with no compelling features. There's nothing that makes code easier to write, maintain, or verify. Its syntax offers no improvements over C++. There are no optimizations that you can't get with Clang. There's no reason why anyone would use D over better supported, better optimized, and more portable languages. D is garbage.
>>31 Why would anyone use this language when its authors didn't even care about Macs or any platform other than Intel?
I take it you're not a serious programmer. If you like to squander your free time and coding talent on some Hong Kong knockoff chipset like the Dragonball so you can make your Furby talk to your 1988 vacuum cleaner, be my guest.
>>33
D is garbage. It's up there with Brainfuck and Unlambda in languages used by "serious programmers." Portability allows a language to change with the times. Perl originally ran on a few OSes including Amiga, SunOS and VMS. Now it runs on Linux and Windows (and many other OSes). If D was written at the same time as Perl nobody would be using it today (well, nobody uses D anyway) because the developers would never port it to anything that doesn't run on the original CPU architecture. If a language provides no benefits over C++ and it only runs on a few x86 OSes even though it has a backend that uses LLVM, why would anyone use it? LLVM doesn't support DragonBall, but isn't it sensible to assume that D would run on all the architectures LLVM does support? I guess not, because D is an irrelevant shit toy language. If any "serious programmers" cared about it they could have ported it to Solaris, ARM or PowerPC themselves.
I wonder why "D programmers" use such a garbage language. Maybe they came from a PHP background (no offense to PHP programmers) and discovered the wonders of "native code."
>>35 LLVM doesn't support DragonBall, but isn't it sensible to assume that D would run on all the architectures LLVM does support?
Supporting multiple architectures with an LLVM backend isn't as straightforward as you seem to think, especially if your language has low level features. It's still pretty funny but realistically I can't blame them at all.
I wonder why "D programmers" use such a garbage language. Maybe they came from a PHP background (no offense to PHP programmers) and discovered the wonders of "native code."
True story: I know a bunch of people who got swept up in earlier waves of D hype a few years ago. The ones who got there via C became very cynical ("YES ANDREI TELL US MORE ABOUT THE BEAUTY OF RANGES") and moved on to less baffling projects like Go and Clojure. The ones who got there via Perl are still D zealots. I'm not sure what to infer from that.
Name:
Anonymous2012-02-21 13:23
>>37 True story: I know a bunch of people who got swept up in earlier waves of D hype a few years ago. The ones who got there via C became very cynical ("YES ANDREI TELL US MORE ABOUT THE BEAUTY OF RANGES") and moved on to less baffling projects like Go and Clojure. The ones who got there via Perl are still D zealots. I'm not sure what to infer from that.
A++ would giggle again
But seriously, D is nothing but a huge hack. It's unbelievable, but achieves... nothing. Nothing that C++ isn't already capable of...
Name:
Anonymous2012-02-21 13:33
HEY GAIZ WAT R U TALKING ABOUT IN DIS THRAD LOL? IMA GIRL PORGRAMMER AND IM LEARNIGN PYTHON HAHA 1337 H3X0R OR WUT? UR SO RANDUMM PROGGLES ^_^
#OccupyWallStreet
-- Sent from my iPhone
Name:
Anonymous2012-02-21 13:35
>>31
And it took from 2001 to 2007 just to reach version 1.0. The language has been in constant flux until about 2009, when the feature set was finalized. Now that the language is complete, Walter Bright has started working on porting it to other platforms, starting with MacOSX.
>>38
Well... Go barely achieves anything more than D, but people still welcome it like the second ejaculation of Christ. And you probably aren't old enough to remember it but Java was received the same way by all the seppelgoobers who didn't know how caches worked and had total faith in the perpetuity of Moore's law. I guess usability is just one of those hard problems with unfathomable search spaces and it's human nature to blunder cluelessly in and out of local maxima.
The most depressing thing is that while individuals learn from their mistakes some of the time, societies don't. Oh well.
>>41
Java is a completely bad example.
It was designed to be a clean C++ for scripting purposes, on the client-side web.
But it failed, thanks to Netscape mocha/livescript (later Javascript). Somehow it became useful for JSP/Servlets, and now the “Compile Once Run Anywhere” is just bullshit that people don't care anymore.
Name:
Anonymous2012-02-22 5:36
>>41
But Go doesn't claim "to be better than C++". In fact, Go was actually called "Lingo" once; They revived the old project, gave it a new name and runtime.
Name:
Anonymous2012-02-22 5:38
IAMA dubs AMA
Name:
Anonymous2012-02-22 7:50
Oh mighty C++ hear my prayer.
How do I put a torch under my ass and actually learn a programming language?
I learned BASIC in 1992. HTML in 1996. I have learned nothing well enough since.
Name:
Anonymous2012-02-23 14:18
You must read the holy book, The C Programming Language, by Kerrigon & Ritchy, and do all the exercises in the book.
>>45 How do I put a torch under my ass and actually learn a programming language?
Programming isn't about knowing a language. It's about setting goals and figuring out what problems to solve (and then solving them, of course). You already learned BASIC and you're not a programmer yet, so obviously "learning a programming language" is not the right problem to solve to get to your goal.
Picking which problems to solve when you're first learning to be a programmer is pretty fucking hard because it usually has to be something you actually care about, or you'll never solve it. So step one should be to ask yourself ``what do I want my program to do?'' This question is also very important for deciding which language to use. You wouldn't write an operating system in Ruby or Python, and you really don't need a monstrosity like C++ for a script that just renames a bunch of files on your desktop.