3,498 reputation
11019
bio website
location Italy
age 50
visits member for 3 years, 3 months
seen 2 days ago

Born an living in the suburbs of Milan (Italy), I graduated in 1989 as a Master Electronic Engineer, specializing in information technology an inter-networking systems and plants.

Interested in programming since the early '80s, today working mainly in C++ and D programming languages, in libraries development.


Feb
2
answered Should methods always return from one place?
Feb
1
comment How does C++ handle multiple inheritance with a shared common ancestor?
About CRTP, the assertion "nothing is required to be virtual" is true in your example as in the most of the CRTP classes implementation cases, but has a difference in respect to regular inheritance: IComparable<A> and IComparable<B> are distinct types and there is not anymore an IComaprable* that can point to them both (no runtime polymorphism). For calasses used as values, or where object types are statically known, this is not an issue. Otherwise IComparamble<Derived> will most likely have an IComparabeBase (not templetized) with all pure virtual methods (2nd grade polymorphism).
Nov
9
comment Should I use C style in C++?
from the google style guide: "Use only approved libraries and language extensions from C++11 (formerly known as C++0x). Currently, none are approved." Uhmmmm... Time to upgrade the style guide ...
Nov
6
answered What is the way to understand someone else's giant uncommented spaghetti code?
Nov
6
comment In C and C++, what methods can prevent accidental use of the assignment(=) where equivalence(==) is needed?
@JohnR.Strohm This is just half of the cake: if C had := for assign and = for compare you will not mistake comparisons with assignment, but could potentially mistake assignments with comparisons (writing a = b where a:=b is required). You and karl are both right taken together and both wrong taken individually. Of course we can discuss about the "probability" of one mistake respect to the other, but -at the and- it just all about each one's personal habits.
Oct
28
comment Is “send us a page with code” a typical interview requirement?
After reading the "sort of stuff" and the comment to that I was frankly terrified about how many of them focused on the poor structure, without even get what the real problem was. (the logic inversion: to permit only numbers he denied all the ASCII non-number individually. Every other non-number that lives outside the 0..127 space remained permitted!) If that's the result, I wonder about the knowledge of recruiters!
Oct
22
awarded  Enlightened
Oct
22
awarded  Nice Answer
Oct
22
answered Does putting types/functions inside namespace make compiler's parsing work easy?
Oct
21
awarded  Custodian
Oct
21
reviewed Approve How can I explain object-oriented programming to someone who's only coded in Fortran 77?
Oct
21
answered How can I explain object-oriented programming to someone who's only coded in Fortran 77?
Oct
17
comment What can go wrong if the Liskov substitution principle is violated?
@Songo: Not necessarily: it can, but those methods are "unreachable" from a base pointer (or reference or variable or whatever the language you use calls it) and you need some run-time type information to query what type the object has before you can call those functions. But this is a matter that is strongly related to languages syntax and semantics.
Oct
17
comment It's ok to study the C++ from a book that only support the 1998 version of standard?
... Although it is certainly true that many of today's best practices derives from Andrei's studies and publications
Oct
17
comment It's ok to study the C++ from a book that only support the 1998 version of standard?
@DirkHolsopple: One of the things I've leaned in 30+ more year of experience is "never use the word "definitive". Andrei's work was truly the predecessor of template metaprogramming. It is certaily good about the concepts, but it requires a review about the samples, at least because C++11 syntax can greatly simplify many of them (He make a lot of mortal-jumps to allow varadic template surrogates not anymore necessary, for example!). The point is to be aware of it. You can study Andrei's techniques, of course, but I would not recommend them as today's best practices...
Sep
6
comment What's so bad about pointers in C++?
@James: "it'll be your fault, not the designers" ... Good contract must result from a negotiation of both the parties. Breaking a "bad written" contract result in "bad" things, but is is much more a designer's fault, than user's fault. Remeber that design is clueless if no-one is able to use it. Good contracts inhibit improper use, don't punish after allow it. Punishment can make the designer satisfied, but if diffused has a "social cost" the designer also will pay. Do you get the metaphore?
Sep
2
awarded  Yearling
Aug
31
awarded  Good Answer
Aug
26
comment In C and C++, what methods can prevent accidental use of the assignment(=) where equivalence(==) is needed?
@James: ... not to mention it will not work for a == b !!
Aug
10
revised Is there a different usage rationale for abstract classes/interfaces in C++ and Java
added 79 characters in body