Re: typedef in a struct
- From: Bernhard Agthe <Bernhard.Agthe@xxxxxxxxxxxxxxx>
- Date: Tue, 26 Sep 2006 10:57:49 +0200
Hi,
The fact you don't like typedef is a style and has nothing to do with
c++. The style of c you prefer is just fine in a c++ file.
OK, so why should I use C++ when in fact all I need is simple C?
It's not I don't like typedef, I just like clean, readable code. And that doesn't extend to C/C++ only.
In my oppinion the use (or the not using) of tools (and C++ provides many tools) should be appropriate to solve the problem. That's code quality. If you can do it in C that's fine. If you need C++ that's also fine.
But sometimes you're restricted to C only by external constraints (for example when you code for some embedded system which only provides you with a plain C compiler).
So it is nonsense to write everything in C++ just because it provides you with some fancy tool - many of them have been "backported" already, but some just make no sense.
You see, just recently I saw an article in a popular computer magazine which stated that you are not allowed to use pointers in C because of the Professor-of-computer-science-Mr.-Nobody's-programming-principle. To avoid making errors. OK, this guy obviously never managed to work with pointers - but why should I not use them when they work most conveniently? Somebody telling me *not* to use something because it's "bad" in my eyes never understood (a) the principle of all tools being there for using them and (b) the tool he detests.
You see, I don't like Matlab because the interpreter has no type-checking whatsoever (and it's much too expensive). But why shouldn't somebody use it who feels comfy?
So if you feel more comfy with C++ that's fine with everybody, but don't expect others to feel the same way. Even if it's "better" for you it may be "worse" for the next guy.
Ciao...
.
- References:
- typedef in a struct
- From: Binary
- Re: typedef in a struct
- From: Michal Nazarewicz
- Re: typedef in a struct
- From: Bernhard Agthe
- typedef in a struct
- Prev by Date: Re: how to write a structure in a shared mem segment.
- Next by Date: can't read from a buffer
- Previous by thread: Re: typedef in a struct
- Next by thread: Building portable linux applications
- Index(es):
Relevant Pages
|