Re: C/C++ question about dynamic "static struct"
On Monday, 22 October 2012 23:52:35 UTC+3, Jorgen Grahn wrote:
On Mon, 2012-10-22, Rui Maciel wrote:
Tobias M=EF=BF=BDller wrote:
The complexity of C++ makes it more difficult to agree on a common sub=
set
of features, because the level of knowledge may vary more.
It isn't that complex as you make it out to be. I know of a company in=
the
telecom industry which explicitly banned the use of exceptions and the =
STL
in one of their C++ projects, the later in favour of a set of custom me=
mory
pools. That policy was in the project's coding guidelines, and everyon=
e who
was added to the project was briefed about what was kosher and what was=
taboo. There was nothing difficult about that.
Well ... I think I might prefer using C to working in C++ without the
standard library. Unless its replacement was *really* good and
included drop-in replacements for things like iterators and algorithms.
And containers.
You should try QT then. That framework really has choosen to have everythin=
g
of its own. Only thing that I do not see as very reasonable is that QString
is internally UTF-16 not UTF-8. Perhaps it is because Symbian and Windows (=
favorite OSs of Nokia) also favor UTF-16. Rest of it is quite well made and
also the development tools are quite nice.
Weird guidelines aside, I have to partly agree with T.M. above -- it
/is/ harder to agree about C++. One guy wants it to be C, another
wants it to be Smalltalk, a third wants it to be 1980s C++, I want it
to be modern C++ ...
It's worth the effort, though.
That is anyway difficult but must be done when specialists of so very
different background have to coooperate. Usually there should be one
lead developer - architect type per team and others should be supporting
and assisting members. Several disagreeing leaders has disasterous result
independent of goal and tools.
You won't be reading idioms which were explicitly banned from a project=
..
And you won't be reading many things which were not. I've never seen
multiple inheritance -- not because it has been banned, but because
it's so rarely useful! I've never seen deep template meta-
programming, because I don't work with people who are into that stuff.
And so on.
Every week I find something that i have never seen before. Past week exampl=
e:
class Power
{
private:
// construct with factory methods
Power( std::string const& typeCode );
public:
// factory method
static Power fromValueAndUnitText( std::string const& text )
{
if ( text.size() < 2 )
{
// both value and unit can't fit
return false; //<--- i was here like WTF WTF WTF
}
// ...
// etc.
}
// ...
// etc.
};
Compiled without any warnings. I did not even know before that 'false'
converts so silently to 'std::string const&' on the compiler used in
that project.