Thursday, January 15, 2015

Digest for comp.lang.c++@googlegroups.com - 25 updates in 3 topics

Christopher Pisz <nospam@notanaddress.com>: Jan 14 05:59PM -0600

On 1/14/2015 3:38 PM, jak wrote:
> opposite. I also think that you were very unlucky to have to put your
> hands in the code who have written clueless.
 
> regards
 
 
As an intelligent creature, I like to think that I learn from
experience, as all human beings should, while the political correctness
movement would have us believe such things are terrible (judgement!).
 
I would only believe it to be "unlucky" had it been one project, or two
projects, or one person, or two people, or even a handful of either. The
case is that in 20 years, I've moved around quite a bit, I've worked
with hundreds of people and on at least 20 significant projects. While I
am not trying to toot my horn, I am trying to say that I have a more
than adequate sample size to draw such a conclusion at least to the
point where it is worth voicing.
 
I am not pulling 80% out of my ass. I literally sat with the bug
trackers, read through the bug reports, the back and forth, and the
solutions, for thousands of tickets and in 80% of the cases it pointed
to C style code. I kept track out of the need to prove that firing said
C-style coder was worthwhile. In 4 of the 5 places I did this, there was
_one_ and only _one_ C style coder on a C++ team. Usually an old man
that had been there for years and years, which had made such a mess that
the company could not get rid of him for fear that no one could ever
figure out the secret lucky charms encoder rings he had littered the
code with.
 
These guys would always have arguments to the point spit was flying
through the air and the veins in foreheads looked like they were going
to burst. They would scream and yell "Efficiency!" I hate working with
those people. I truly do. I cannot fathom how many man hours were wasted
and how much money customers were charged, because some old stubborn
bastard would not learn new tricks. When I see any trace of that
mentality even in the newsgroup it enrages me and I must say something.
 
In summary, don't be sorry. Stop the c-style coding instead.
"Öö Tiib" <ootiib@hot.ee>: Jan 14 10:54PM -0800

On Thursday, 15 January 2015 01:59:20 UTC+2, Christopher Pisz wrote:
> As an intelligent creature, I like to think that I learn from
> experience, as all human beings should, while the political correctness
> movement would have us believe such things are terrible (judgement!).
 
In my experience far worst piece of code that I have ever seen was
written in C#. On the other hand the code of Python interpreter for
example I like, despite it is C. It is not language's fault that
programmer does not care about readability and robustness.
jacob navia <jacob@spamsink.net>: Jan 15 08:00AM +0100

Le 15/01/2015 00:59, Christopher Pisz a écrit :
> had made such a mess that the company could not get rid of him for fear
> that no one could ever figure out the secret lucky charms encoder rings
> he had littered the code with.
 
The 15/01/2035 00:59, we spoke about him in the cafeteria.
 
John: What was his name?
 
David: Who? The C++ coder? I think it was Pisz, Christopher Pisz. Why?
 
John: Ahh that old guy? I remember seeing him at the cafeteria, always
talking about C++ and why HyperBasic was wrong all along... I think he
couldn't adapt to the new coding standards the company has to support...
 
David: Yes, I remember, he would always have arguments to the point spit
was flying through the air and the veins in foreheads looked like they
were going to burst. He would scream and yell "Efficiency!" and other
irrelevant stuff. I mean, who cares about that now?
 
John: Well, he came from the time when HyperBasic wasn't even
conceivable, it would have taken a computer of that time a whole DAY to
print hello world in HyperBasic. Yes, he was completely outdated that
guy. It was a good decision to fire him.
 
David: Anyway, I prefer young people for programming. They never knew
about programming languages, and HyperBasic restricted english input
comes naturally to their generation that has grown up with computers
since they were born. All those old hands that needed a computer
language are now obsolete thanks goodness.
 
John: Yes, anyone can be a programmer now, HyperBasic will understand
any instructions in a few miliseconds using the new generation quantum
machines. Programming is finished as a profession.
 
John and David: Yes, that's the way of the future!
 
 
 
 
... the future of youth is old age Christopher. I wish you a long life.
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 15 07:04AM

On Wed, 2015-01-14, Christopher Pisz wrote:
> On 1/14/2015 3:38 PM, jak wrote:
...
> those people. I truly do. I cannot fathom how many man hours were wasted
> and how much money customers were charged, because some old stubborn
> bastard would not learn new tricks.
 
I haven't had /exactly/ your experience, but I've seen enough to find
what you're saying believable. Sadly.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 15 07:17AM

On Thu, 2015-01-15, 嘱 Tiib wrote:
> written in C#. On the other hand the code of Python interpreter for
> example I like, despite it is C. It is not language's fault that
> programmer does not care about readability and robustness.
 
I don't think anyone argues that you cannot use C well[0]: the problem
here was people using C++ as if it was (more or less) C.
 
/Jorgen
 
[0] Well, not in this part of this thread, anyway.
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jan 15 07:25AM

On Thu, 2015-01-15, jacob navia wrote:
>> had made such a mess that the company could not get rid of him for fear
>> that no one could ever figure out the secret lucky charms encoder rings
>> he had littered the code with.
 
You're falsifying what he wrote, which was:
 
> the company could not get rid of him for fear that no one could ever
> figure out the secret lucky charms encoder rings he had littered the
> code with.
 
So *plonk*. For good, this time.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
David Brown <david.brown@hesbynett.no>: Jan 15 09:23AM +0100

On 14/01/15 20:14, Jorgen Grahn wrote:
 
> I see C++ as a language which fixes the obvious flaws in C -- and I
> see C as a crippled and, in 2015, unnecessary (but not useless)
> dialect of C++.
 
C++ fixes /some/ of the obvious flaws in C, but not all - and like any
system that is big, complex and powerful, it has flaws of its own.
IMHO, the true power of C++ is the same as with any other programming
language - you aim to understand it and find a good balance of the
features that suit your needs and abilities for the work at hand.
Understanding the C subset and background is part of that, but so are
other C++ features. You should use C++ features where they improve on
the code compared to C-style features - but equally one should not avoid
a C-style array just because it happens to look like C code!
 
C is in no way a "crippled" language, and it is not unnecessary - but it
has remained largely static since C99. Tools have changed and improved,
but the language is mostly the same - and that is one of its key
advantages. If I write modern C++, I need to make sure I have a very
recent compiler that supports the features - and anyone working with the
code has to have learned the new features. But if I write good, clear,
modern C code, it will compile on anything, and any C programmer can
work with it.
 
C++ has been getting many more features over time - and that is an
advantage for C++. You can write neater, clearer, faster, and safer
code with C++11 than with C++03, and C++14 and C++17 continue to improve
the language.
 
So while I see that there is steadily more scope for the use of C++ in
traditional C domains (such as in an increasing proportion of embedded
development), C is far from "crippled" or "unnecessary".
jacob navia <jacob@spamsink.net>: Jan 15 09:25AM +0100

Le 15/01/2015 08:25, Jorgen Grahn a écrit :
> You're falsifying what he wrote
 
How could he have written about the HyperBasic team?
That's so obvious nobody would have doubted that I wrote that citation.
I did not want to edit it much though, just some MINIMAL changes and the
introduction of the HyperBasic team.
 
I am just setting his words in the context of 35 years in the future.
 
And my post is about AGE too, because he always says "OLD" C
programmers, as he would stay young forever, what he apparently believes.
 
HYPERBASIC is coming, and with it the end of all need for computers to
have some CODE to understand the wishes of the humans. That will be hard
to swallow for programmers, when all what they were doing becomes
completely obsolete.
 
Yes, my post is about our relationship to technical advances and how we
treat them, and above all how we treat people that apparently do not
want to change their ways of "coding".
 
How easy is then for you to ignore everything completely, misunderstand
some stuff and then, of course,
 
*PLONK*
 
Because you just can't argue anything, do not want to understand
anything, and yes, you, like him, are in great fear of becoming obsolete
and the only way of "avoiding obsolescence" is FIRING people that you do
not like or understand. That's why you do not want to discuss here anything.
 
What could you possible say?
David Brown <david.brown@hesbynett.no>: Jan 15 09:34AM +0100

On 15/01/15 08:17, Jorgen Grahn wrote:
>> programmer does not care about readability and robustness.
 
> I don't think anyone argues that you cannot use C well[0]: the problem
> here was people using C++ as if it was (more or less) C.
 
I have seen C++ used successfully as "ABC", or "A better C". But then
it was arguably using the C++ compiler to add features to C (in the same
way that "const" was copied from C++ to C), rather than writing C++ in a
C style. You can use namespaces, strong typing, const, function
overloads, default arguments, and various other C++ features as a way of
improving C - while avoiding C++ features such as classes,
constructors/destructors, new/delete, templates, and exceptions.
 
Is this a good idea? I don't know - but I have seen it used well. As
has been noted, you can write good and bad code in any language,
including a mixture of languages.
Melzzzzz <mel@zzzzz.com>: Jan 15 12:53PM +0100

On 14 Jan 2015 19:14:11 GMT
 
> I see C++ as a language which fixes the obvious flaws in C -- and I
> see C as a crippled and, in 2015, unnecessary (but not useless)
> dialect of C++.
 
Hm, lot of programs are written in C. According to TIOBE, C is most
popular language, more so than C++. One thing that keeps me program
in C++ is that it has great compatibility with C and therefore
very well interfaced with C libraries while also keeping
higher level code which is less lines.
I use C++ mainly because I have to write less lines of code.
Power of C++ over C is in less lines of code to do same thing , IMO ;)
I mean easier to abstract things...
 
jak <please@nospam.tnx>: Jan 15 03:16PM +0100

Il 15/01/2015 00:59, Christopher Pisz ha scritto:
 
>>>>>> [Please do not mail me a copy of your followup]
 
>>>>>> jak <please@nospam.tnx> spake the secret code
>>>>>> <m90pk2$1sg$1@speranza.aioe.org> thusly:
...
> bastard would not learn new tricks. When I see any trace of that
> mentality even in the newsgroup it enrages me and I must say something.
 
> In summary, don't be sorry. Stop the c-style coding instead.
 
First of all I would like for you to be clear that I am one Italian and
I am trying to respond to you in English:
You talked in your speech about your working path. Okay. I'd like you to
understand that if I am here with questions, the reason is because I do
not want to put limits to my knowledge about programming. I would like
to let you know that my programming experience with C language is quite
vast. I was writing drivers for linux and demons when his name was
xenix. yet no one had thought to remove the cobwebs from the code of it
and give it a new name. I know of other OOP languages like c-sahrp, for
example. But now, unfortunately, people have asked me to fix a program
written in C++, so you can see that the real problem is not the
programming language but the head of those who use it. :-)
Melzzzzz <mel@zzzzz.com>: Jan 15 03:51PM +0100

On 1/15/15 3:16 PM, jak wrote:
I was writing drivers for linux and demons when his name was
> xenix.
 
Hahahahhahahha ;)
Ian Collins <ian-news@hotmail.com>: Jan 16 06:58AM +1300

Christopher Pisz wrote:
> and how much money customers were charged, because some old stubborn
> bastard would not learn new tricks. When I see any trace of that
> mentality even in the newsgroup it enrages me and I must say something.
 
Those dinosaurs would be (and possible still are!) having the same
arguments on C projects. That mentality transcends language boundaries.
 
--
Ian Collins
legalize+jeeves@mail.xmission.com (Richard): Jan 15 06:26PM

[Please do not mail me a copy of your followup]
 
Christopher Pisz <nospam@notanaddress.com> spake the secret code
 
>The true downfall of C++ is C. Power my arse.
>80% of the bugs I encounter in bug trackers stem from C-style code from
>people with that mentality whom refuse to move on.
 
This is the point I was making. Listen to Stroustrup's advice (sorry,
haven't gotten permission from A-W to put it online yet). If you
listen to the guy who *created* the language he will tell you to stop
using C-isms (memset, C-style strings, <string.h>, strcpy, etc.) and
use the features that have been in C++ for over 15 years.
 
You ignore his advice at your own peril.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
jak <please@nospam.tnx>: Jan 15 07:28PM +0100

Il 15/01/2015 15:51, Melzzzzz ha scritto:
> I was writing drivers for linux and demons when his name was
>> xenix.
 
> Hahahahhahahha ;)
 
(rofl)
jak <please@nospam.tnx>: Jan 15 07:45PM +0100

Il 15/01/2015 15:51, Melzzzzz ha scritto:
> I was writing drivers for linux and demons when his name was
>> xenix.
 
> Hahahahhahahha ;)
 
I still retain a copy of it in floppy disks by 5 1/4" and their players
in a drawer. I am a romantic ... :-D
asetofsymbols@gmail.com: Jan 15 01:26PM -0800

Here in http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
When one see language graphics at end of that page
C language in years 2002-> 2014 is almost[quasi]
constant instead C++ in the same years seems
descend as java ... Or did I see it wrong?
David Brown <david.brown@hesbynett.no>: Jan 15 10:55PM +0100

On 15/01/15 18:58, Ian Collins wrote:
>> mentality even in the newsgroup it enrages me and I must say something.
 
> Those dinosaurs would be (and possible still are!) having the same
> arguments on C projects. That mentality transcends language boundaries.
 
I have certainly seen the same thing from assembly programmers when
discussing C.
legalize+jeeves@mail.xmission.com (Richard): Jan 15 11:16PM

[Please do not mail me a copy of your followup]
 
Ian Collins <ian-news@hotmail.com> spake the secret code
>> mentality even in the newsgroup it enrages me and I must say something.
 
>Those dinosaurs would be (and possible still are!) having the same
>arguments on C projects. That mentality transcends language boundaries.
 
And the whole thing is silly unless you have performance measurements
to back up your assertions. Otherwise, it's all just wishful thinking.
 
I'm all in favor of doing things efficiently. I work in graphics and
efficiency matters for these kinds of systems. However, armchair
pontificating about efficiency or obsessing about single bytes or
function calls is not how you get the efficiency that matters. If you
care about efficiency and want to be real about it, then I suggest
this book:
 
"The Software Optimization Cookbook: High Performance Recipes for
IA-32 Platforms", 2nd Edition
by Richard Gerber, Aart J. C. Bik, Kevin Smith, Xinmin Tian
<http://amzn.to/1xuccG9>
 
It's from 2005, but the discussion is still relevant today because it
mostly boils down to proper care and feeding of the data and
instruction caches on a CPU. When game developers scream "no virtual
functions!" that is their simplistic takeway from the real advice of
"keep your cache hot". The latter is what you need to remember, not
simplistic bugaboos about particular language features.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
DSF <notavalid@address.here>: Jan 15 01:58PM -0500

Hello!
 
I've always assumed that the keyword explicit produced a compiler
error if the argument was not the *exact* type.
 
explicit FBaseString(size_t bufferlen);
explicit FBaseString(CH ch);
 
CH can only be char or wchar_t.
The above produces the error:
Error: readdirs.cpp(287,32):Ambiguity between
'FBaseString<wchar_t>::FBaseString(unsigned int)' and
'FBaseString<wchar_t>::FBaseString(wchar_t)'
 
I assume this means explicit allows promotions before type checking.
 
Is this the case?
 
Thanks,
DSF
"'Later' is the beginning of what's not to be."
D.S. Fiscus
Marcel Mueller <news.5.maazl@spamgourmet.org>: Jan 15 09:48PM +0100

On 15.01.15 19.58, DSF wrote:
> I've always assumed that the keyword explicit produced a compiler
> error if the argument was not the *exact* type.
 
No.
 
explicit prevents from implicit constructor invocation without using the
constructors name (= class name), e.g. for copy construction.
 
 
Marcel
red floyd <no.spam@its.invalid>: Jan 15 01:53PM -0800

On 1/15/2015 10:58 AM, DSF wrote:
> 'FBaseString<wchar_t>::FBaseString(wchar_t)'
 
> I assume this means explicit allows promotions before type checking.
 
> Is this the case?
 
To provide an example to Marcel's comment, With explicit (excluding
your type clash error), the following happens:
 
FBaseString x(77); // OK
FBaseString y = FBaseString(77); // also OK
FBaseString z = 77; // ERROR -- constructor is explicit
red floyd <no.spam@its.invalid>: Jan 15 01:56PM -0800

On 1/15/2015 10:58 AM, DSF wrote:
 
> Error: readdirs.cpp(287,32):Ambiguity between
> 'FBaseString<wchar_t>::FBaseString(unsigned int)' and
> 'FBaseString<wchar_t>::FBaseString(wchar_t)'
 
Also, in this case, explicit is a red herring. The issue is that your
compiler is apparently not creating a distinct type for wchar_t, but
using a typedef of some unsigned type.
Victor Bazarov <v.bazarov@comcast.invalid>: Jan 15 05:50PM -0500

On 1/15/2015 4:56 PM, red floyd wrote:
 
> Also, in this case, explicit is a red herring. The issue is that your
> compiler is apparently not creating a distinct type for wchar_t, but
> using a typedef of some unsigned type.
 
Obviously, the same "unsigned int" for which it has a typedef for
'size_t'. I mean, on the close examination of the error message's
penultimate line...
 
V
--
I do not respond to top-posted replies, please don't ask
sergei.nakariakov.5@gmail.com: Jan 15 01:59AM -0800

http://www.amazon.com/Cracking-Programming-Interviews-Questions-Solutions/dp/1495459802/
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: