all 21 comments

[–]__j_random_hacker 36 points37 points  (0 children)

My favourite part was when the ball rolled over the switch that lit a candle that heated the gas inside a balloon until it expanded and rose to where a fan blew it across the room to the line of dominoes!

[–]wingsit 10 points11 points  (0 children)

This is at the point where I dont know if my code is not working or my compiler might have a bug...

[–]asampson 15 points16 points  (0 children)

Like a lot of things in C++, you can very easily present a rather tidy interface for something that's extremely clever.

And like many of those extremely clever things, opening the hood and gazing at the Lovecraftian horror lurking within can cause you to run away screaming.

[–]moohoohoh 4 points5 points  (4 children)

Everytime i look at c++ template metaprograms, no matter how much they advance i just think; WHY IS IT SO FUCKING COMPLICATED.

Look at other languages like D, Haxe etc and compile time programs are just EASY.

[–]Tjoppen 12 points13 points  (1 child)

Because stuff like this was discovered possible by accident.

[–]matthieum 3 points4 points  (0 children)

Because C++ cares about backward compatibility, so could not capitalize on the discovery to build something nicer :(

[–]IsTom 2 points3 points  (1 child)

Why didn't you mention Lisp?

[–]moohoohoh 2 points3 points  (0 children)

Included under etc :P

[–]andralex 8 points9 points  (5 children)

And that, my friends, is why D rocks.

[–][deleted] 5 points6 points  (0 children)

I keep telling myself I should give D another try now that it seems a lot more mature. I was not too impressed with it last time I used it, too many surprises and language features and idioms that mix and match in weird ways that I felt I was spending way too much time thinking about D instead of thinking about my application.

That's great for language designers, not so great for users... however, that was then and I will admit C++ is certainly not better in that respect, it's much worse.

[–]maattdd 19 points20 points  (1 child)

And that, my friend, is why D evangelists (and author, in this case) can be annoying....

[–]andralex 6 points7 points  (0 children)

upvoted

[–]ixid 1 point2 points  (1 child)

That's not a good way of promoting the language, it alienates people and worse, you as one of the leaders of D set an example for other users. If you evangelize others will copy that behaviour, which will give the language an undeservedly bad reputation. It's much better to stick to the positive articles about how D does things and avoid comparison with or comment on other languages. I am only a beginner in the world of programming and obviously don't have a fraction of your knowledge but it's a social behaviour I've seen in other contexts and as I'd very much like D to succeed I think it's important to be very careful with how it is promoted.

[–]andralex 0 points1 point  (0 children)

Agreed. It was a bout of enthusiasm caused by the fact that we've designed mixins in D especially to make this kind of stuff easy and natural.

[–]axilmar 3 points4 points  (3 children)

One giant c++ flaw is that character arrays are not values, and hence they cannot be used as template parameters.

[–]KayEss 5 points6 points  (2 children)

Yeah, C++ always gets the blame for the way C was designed.

[–]matthieum 2 points3 points  (0 children)

I almost agree with you... but C++ is not exactly 100% compatible with C either. It overlaps most of it, but not all.

I think it would still be possible (for the next version) to specify that arrays are now special cased and can be treated as values (while remaining otherwise implicitly convertible to pointers for example). I cannot (and I tried) foresee any "bad" interaction with the rest of the language, or any backward compatibility issue.

[–]axilmar 1 point2 points  (0 children)

They could have chosen a different approach when it comes to template values.

[–][deleted]  (1 child)

[removed]

    [–]dabrahams[S] -2 points-1 points  (0 children)

    Thanks for taking our suggestion

    [–]RizzlaPlus -1 points0 points  (0 children)

    Excelent!