Click here to Skip to main content
15,928,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help with a function that returns a vector.. Pin
Alvaro Mendez22-Mar-04 8:39
Alvaro Mendez22-Mar-04 8:39 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 9:14
protectorChristian Graus22-Mar-04 9:14 
GeneralRe: Help with a function that returns a vector.. Pin
Curi0us_George22-Mar-04 9:22
Curi0us_George22-Mar-04 9:22 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 9:27
protectorChristian Graus22-Mar-04 9:27 
GeneralRe: Help with a function that returns a vector.. Pin
Curi0us_George22-Mar-04 13:44
Curi0us_George22-Mar-04 13:44 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 15:01
protectorChristian Graus22-Mar-04 15:01 
GeneralRe: Help with a function that returns a vector.. Pin
Curi0us_George22-Mar-04 17:00
Curi0us_George22-Mar-04 17:00 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 17:07
protectorChristian Graus22-Mar-04 17:07 
Curi0us_George wrote:
typedef is part of the C++ language, just like the using declaration. It is perfectly valid C++, and Stroustrup himself gave similar examples of when one might use typedefs. He said that "unsigned char" is really too long and unwieldy to use, so we might define "uchar". Same with vector. It's often convenient to use a shorter synonym.

Your first point is valid, and I am well aware that Stroustrup shows the use of typedefs in similar circumstances to those we are talking about. He also makes clear that C++ langauge features were included on the basis of how they could be used well, not excluded based on how they could be abused by the clueless. The designers of C# could have learned from this approach. What I'm saying is that just because you CAN typedef, does not mean you SHOULD. Stroustrup also says that macros should never be used, they are always a sign of a bad design or a bad programmer. A typedef is really not much different to one possible use of a macro, that of creating our own language ( exactly what Stroustrup warned against ), by creating new names for things that already exist.

Curi0us_George wrote:
Typically your assumption would be correct, but not always.

Which makes your comment obviously dumb. Yes, it's entirely possible that it would be referring to some other class called vector, but from my point of view, I'd be forgiven for assuming it was a std::vector, and if every time you see a vector in code you go searching to make sure that it's from namespace std, then I'm afraid you're being overly anal.

Curi0us_George wrote:
Rather than blaming the typedef functionality for poor clarity, blame the poor names. Poorly named classes also lead to poor clarity, but it's not a fault with the feature. It's a fault with the programmer.

And that's what I've said all along, my point is that I've seen code rendered illegible by poor use of a plethora of typedefs, and really at the end of the day it's my opinion that anyone too dumb to read STL code should probably give VB a try. I still don't see how the typedef helps anything, except for the lazy typist, and it still remains that you have to 'learn' the typedefs in a project unless they are so descriptive that they are as long as the thing they replace.

And I really doubt we have any chance of convincing each other, or that we're even 100% on the same page anymore.

Christian

I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
GeneralRe: Help with a function that returns a vector.. Pin
Curi0us_George22-Mar-04 17:17
Curi0us_George22-Mar-04 17:17 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 17:23
protectorChristian Graus22-Mar-04 17:23 
GeneralRe: Help with a function that returns a vector.. Pin
Alvaro Mendez22-Mar-04 9:42
Alvaro Mendez22-Mar-04 9:42 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 9:45
protectorChristian Graus22-Mar-04 9:45 
GeneralRe: Help with a function that returns a vector.. Pin
Alvaro Mendez22-Mar-04 10:26
Alvaro Mendez22-Mar-04 10:26 
GeneralRe: Help with a function that returns a vector.. Pin
Christian Graus22-Mar-04 10:30
protectorChristian Graus22-Mar-04 10:30 
GeneralGetting control coordinates Pin
monrobot1322-Mar-04 7:32
monrobot1322-Mar-04 7:32 
GeneralRe: Getting control coordinates Pin
Brian D22-Mar-04 7:50
Brian D22-Mar-04 7:50 
GeneralRe: Getting control coordinates Pin
monrobot1322-Mar-04 7:53
monrobot1322-Mar-04 7:53 
GeneralRe: Getting control coordinates Pin
John R. Shaw22-Mar-04 20:08
John R. Shaw22-Mar-04 20:08 
QuestionHow to get domain name other than using GetComputerNameEx? Pin
CherezZaboro22-Mar-04 7:00
CherezZaboro22-Mar-04 7:00 
AnswerRe: How to get domain name other than using GetComputerNameEx? Pin
Antony M Kancidrowski23-Mar-04 3:09
Antony M Kancidrowski23-Mar-04 3:09 
GeneralRe: How to get domain name other than using GetComputerNameEx? Pin
CherezZaboro23-Mar-04 5:42
CherezZaboro23-Mar-04 5:42 
GeneralRe: How to get domain name other than using GetComputerNameEx? Pin
Antony M Kancidrowski23-Mar-04 12:28
Antony M Kancidrowski23-Mar-04 12:28 
GeneralRe: How to get domain name other than using GetComputerNameEx? Pin
CherezZaboro24-Mar-04 4:30
CherezZaboro24-Mar-04 4:30 
QuestionHow do I output text to my main SDI window ? Pin
glweid22-Mar-04 5:56
glweid22-Mar-04 5:56 
AnswerRe: How do I output text to my main SDI window ? Pin
Curi0us_George22-Mar-04 6:16
Curi0us_George22-Mar-04 6:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.