Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » the D programming language

This thread is locked; no one can reply to it. rss feed Print
the D programming language
Kitty Cat
Member #2,815
October 2002
avatar

I wouldn't doubt typedefs in C++ to be mainly discouraged. You really don't need it except when you want to duplicate an existing type. Structs and classes automatically get a type name, as do enums. A typedef doesn't do anything except make one typename out of another typename (using it to define implicit pointer or array types is just evil, so don't go there :P).

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Thomas Fjellstrom
Member #476
June 2000
avatar

For one, it would be nice to have just to be able to change the type, without changing the name.

Quote:

I wouldn't doubt typedefs in C++ to be mainly discouraged

Probably cause it wasn't through through far enough. C++ has strict typing, and typedef misses that. Thats a bug imo.

Do it all the way, or not at all. Anything else will just cause needless confusion.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Probably cause it wasn't through through far enough. C++ has strict typing, and typedef misses that. Thats a bug imo.

If it was left in for compatibility with C, it would make sense. C++ itself seems to have no use for typedef, however code coming from C (eg. static inline methods in headers) that uses typedefs may rely on the compiler accepting such "implicit conversions".

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

code coming from C (eg. static inline methods in headers) that uses typedefs may rely on the compiler accepting such "implicit conversions".

Maybe in static "C" {} sections. C++ is already incompatible enough with C that changing typedefs strictness wouldn't have made anything any more difficult. You already know C++ is going to make type casting safer, and you should have been able to expect all of the language to conform.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

BAF
Member #2,981
December 2002
avatar

C++ feels crippled to me. I can't really explain why, but when I can whip out a program in 10 minutes in C#, then spend hours getting the same thing going in C++, it's crippled.

For one thing, there are no good string processing functions. At least not compared to C#'s string. Same thing goes for sockets.

Thomas Fjellstrom
Member #476
June 2000
avatar

Thats pretty much my sentament. I'll use C++ for Qt, since Qt supliments a lot of things C++ doesn't have (like a decent String and regex setup). C++ tries to be more than C, but really doesn't do a good enough job for me most times.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

axilmar
Member #1,204
April 2001

Quote:

C++ feels crippled to me. I can't really explain why, but when I can whip out a program in 10 minutes in C#, then spend hours getting the same thing going in C++, it's crippled.

For one thing, there are no good string processing functions. At least not compared to C#'s string. Same thing goes for sockets.

I don't wish to sound pedantic, but language != language with libraries. You can't compare C++ without any libraries to C# and its libraries.

Why don't you compare C# with Qt and tell us what you think? I've done so with the Java J2SE, and I find Qt equal or better.

Thomas Fjellstrom
Member #476
June 2000
avatar

Technically, the standard library IS part of the language. libc is part of C, stdlibc++ is part of C++.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Sevalecan
Member #4,686
June 2004
avatar

Quote:

C++ feels crippled to me. I can't really explain why, but when I can whip out a program in 10 minutes in C#, then spend hours getting the same thing going in C++, it's crippled.

Your definition of "crippled" is wrong.

Anyway, I'd have to say... Going by Tins of '05... Something that takes you 10 hours to code in C++ probably takes me 10 minutes.

And even then, do you even write C++? All of your code I ever remember seeing was C.

Also, do you remember bafirc? .. The C version. http://svn.bafserv.com/svn/bafirc/

;D

For a certain reason, this line really makes me laugh:
#define BAF_WOULD_BLOCK WSAEWOULDBLOCK

TeamTerradactyl: SevalecanDragon: I should shoot you for even CONSIDERING coding like that, but I was ROFLing too hard to stand up. I love it!
My blog about computer nonsense, etc.

BAF
Member #2,981
December 2002
avatar

Quote:

I don't wish to sound pedantic, but language != language with libraries. You can't compare C++ without any libraries to C# and its libraries.

I was comparing std::string (C++'s standard library's string) to System.String (C#'s standard library's string).

bamccaig
Member #7,536
July 2006
avatar

axilmar said:

I don't wish to sound pedantic, but language != language with libraries. You can't compare C++ without any libraries to C# and its libraries.

BAF said:

I was comparing std::string (C++'s standard library's string) to System.String (C#'s standard library's string).

That's valid. C and C++ really weren't designed with strings as a priority. In fact, they were designed before strings became as common as they are today (string operations are expensive, especially on older hardware).

Still, I think the syntax of C++ is mostly awesome (I acknowledge the template vs. bit-wise operator problem - since I don't understand templates I'm oblivious to that :P) and could use some more up-to-date standard libraries.

I'm pretty satisfied with C♯ and C♭ (AKA D 8-)) as potential replacements.

HoHo
Member #4,534
April 2004
avatar

Quote:

Why don't you compare C# with Qt and tell us what you think?

It is kind of difficult since C# bindings are not ready yet. Though there are official Java bindings for QT and they are called QT Jambi

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Goalie Ca
Member #2,579
July 2002
avatar

C++ is quite a wonderful language. It's flexible enough to do most things.

My two main gripes:

1) Library Support. std::libs sucks. C++0x is making a major push for more libraries to be made standard and some cleanup of the old libs. Most of the new stuff is from boost. Boost is a good way of doing things but it is only 1 way. C++ was designed to be flexible.. which is partly why there are so many different 3rd party libraries that each solve a problem in their own way with their own tradeoffs.
2) Syntactic Sugar (majorly needed!). How about a nice foreach, real lambda expressions, declare a function in a function, etc.

-------------
Bah weep granah weep nini bong!

bamccaig
Member #7,536
July 2006
avatar

axilmar
Member #1,204
April 2001

Quote:

It is kind of difficult since C# bindings are not ready yet. Though there are official Java bindings for QT and they are called QT Jambi

But C# has libraries that offer functionality similar to Qt.

HoHo
Member #4,534
April 2004
avatar

Quote:

But C# has libraries that offer functionality similar to Qt.

There is nothing that could even remotely compete with QT ;)

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

spellcaster
Member #1,493
September 2001
avatar

I totally agree here. Qt is awesome. The new Qt Jambi (Qt for Java, basically) is awesome as well. And not only because I got a macbook from them ;)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

And not only because I got a macbook from them ;)

TT gave you a macbook? Where can I sign up?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

Well, I won the Qt Jambi developer contest. 1st price was the macbook ;)

--
There are no stupid questions, but there are a lot of inquisitive idiots.

nonnus29
Member #2,606
August 2002
avatar

spellcaster
Member #1,493
September 2001
avatar

Mentioning tight lips in the same sentence as mo'fo made me pass out.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

nonnus29
Member #2,606
August 2002
avatar

Sorry, I should've said 'non-self-promoting Mo'Fo'.

:-/

:-[

Rampage
Member #3,035
December 2002
avatar

Johnny Tightlips:

http://upload.wikimedia.org/wikipedia/en/5/5a/JohnnyTightlips.jpg

-R

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Well, I won the Qt Jambi developer contest. 1st price was the macbook ;)

Wholy crap! Congrats!

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

Wow, that owns. 8-) Nice program, too.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.



Go to: