[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] C++ question re. dyn. mem.



On Wed, Aug 06, 2003 at 10:36:42AM -0400, MJM wrote:
> On Wednesday 06 August 2003 01:02, Dave Carrigan wrote:
> > >?Language experts sure get their shorts knotted up over simple questions.
> > > ?
> >
> > Because your question had to do with undefined and
> > implementation-dependent behavior.
> 
> I know that.   See my other posts.  I asked a question about handling dynamic 
> memory not type casting.  I changed what I was doing to use templates and 
> made a container class (probably did it wrong, but I don't care at this 
> point). 
> 
> I got dragged over the coals for type casting - something used often in the 
> kernel.  Now there is a suggestion that C++ is not C, the kernel is written 
> is C, and so the use of type casting in the kernel does not apply to C++.  
> That arguement suggests that C is unclean and C++ is doing things the Right 
> Way (if you're smart enough to use it correctly). All this worry over 
> casting.  It's a wonder that the kernel works on Intel, SPARC, Alpha, etc.  
> Funny thing is that while the kernel is working (casts and all), you guys are 
> compiling your pure C++ code.

I think what people mean is that C++ and C are not the same. And that
things that are perfectly OK in C might not be OK in C++. I wonder if
the linux kernel would compile on all platforms with g++ instead of gcc
:)

> This experience suggests that some experts like to to make others feel stupid 
> and they could care less about helping people with their knowledge.  Is this 
> how people are treated when they release open source code - language experts 
> pouncing on every line of badly written code?   

I think most people (myself included) would be really happy if language
experts would pounce on every line of bad code I wrote and tell me how
to write it properly :)

> It is unreasonable to expect application experts to be language experts.  
> It's good if they are but it's not necessary. I say it's better to create 
> more things with bad code than to create less things with elegant and easily 
> portable code.  Portability is a job for platform experts. Application 
> experts should stick to their knitting.  Language experts should ply their 
> trade with more respect for the humans that come to them for help.

Programmers should code for portability. By using a language that is
widely available and by coding in a non-system-specific style.

> Oh, and show your elegant portable code to a rank-and-file programmer for a 
> judgement on readability - you'll probably find him or her scratching their 
> heads in confusion for a long time. C++ already has a reputation for being 
> incomprehensible and thereby difficult to maintain.

That's an argument for ditching C++, not for writing what might be bad
C++.

> I can see why programming as a profession is fading and why programming jobs 
> are going to the lowest bidder.  Who wants to pay programmers to create 
> issues to argue about instead of creating product?

This is a mailing list, not a bloody software production house. The
people here are not here to work. They're here to discuss things and
answer questions.

P.S. I don't know if your code was proper or not. Maybe it is, maybe it
isn't. I'm not a C++ expert.

Bijan

Attachment: pgpTGSpUGuMYX.pgp
Description: PGP signature


Reply to: