POV-Ray : Newsgroups : povray.off-topic : This is the sort of brokenness... Server Time
9 Oct 2024 16:15:18 EDT (-0400)
  This is the sort of brokenness... (Message 115 to 124 of 164)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 02:41:28
Message: <49c33a98@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Consider the case of "class alpha 
> {int abc;}" for a counter-example - I know exactly how that's laid out due 
> to the standard.

  I don't think the standard specifies what kind of padding the compiler
will use between member elements.

  For example, if you have a "struct { char c; int i; };", how many bytes,
if at all, are there between 'c' and 'i'?
  Suppose you have "struct { int i; long l; };" in a 64-bit system. Will
the compiler put padding bytes between 'i' and 'l' or not?

  Suppose you have:

class A {};
class B: public A { int i; };

  sizeof(A) will be, per the C++ standard, at least 1. But what will be
sizeof(B), and consequently the offset of 'i' inside it? The standard
doesn't specify, and the compiler is free to optimize the empty base
class away or not, as it sees fit.

  Oh, and it becomes even more complicated:

class A { int i1; public: virtual ~A(); };
class B1: virtual public A { int i2; };
class B2: virtual public A { int i3; };
class C: public B1, public B2 { int i4; };

  Want to start guessing the offsets of the ints inside C? Good luck.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 02:54:01
Message: <49c33d88@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >   You always succeed in returning to your favorite subject: Bashing
> > "unsafe" languages. And in your world there's only one such language: C++.

> You know something?  It's getting "really tiresome and old" that every time 
> I list problems with 5 or 6 different languages, you think I'm bashing on 
> C++.

  5 or 6 different languages? Really?

  You started by making a reference to "unsafe languages" within the subject
of modular programming as a reply to one of my posts (clearly as a reference
to C++), and later you said that C++ is the *only* unsafe OO language you
know of. After that you have been done nothing else than arguing why
modularity in C++ is broken and why Lisp, Java and C# are so great.

  It was certainly not me who brought up C++ into the conversation.

  Yeah, sure. You really have been pointing out problems in "5 or 6 different
languages", and I'm just being paranoid that you are concentrating a little
too much on C++.

> It's getting "really tiresome and old" that every time I point out 
> something that Windows does well, I'm told I'm bashing on Linux.

  Every time? When was the last time?

> It's 
> getting "really tiresome and old" that every time I point out problems with 
> unsafe languages in general, you think I'm bashing solely on C++.

  You explicitly wrote that C++ is the only unsafe OO language you know of.
You have been writing specifically about C++, not about "unsafe languages
in general".

> It's 
> getting "really tiresome and old" that every time I talk about automatic 
> resource management you think I'm bashing C++. It's getting "really tiresome 
> and old" that most times you tell me I'm ignorant and I ask you for more 
> information, you ignore that request, preferring just to insult me rather 
> than actually provide information that might improve the conversation.

  And it's getting really tiresome and old that you act all innocent after
a tirade of C++ bashing, saying that "I just wanted a serious discussion
and honestly wanted to know more", when it's rather clear that you didn't
really.

  It's also getting tiresome that every time I criticize some other language
you immediately assume I'm defending C++. For example, if I call some other
language "kludgey", you immediately assumed that I'm claiming that C++ is
not, even though I never said anything of the sorts. And of course you
immediately jumped to the opportunity of starting bashing.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 02:54:57
Message: <49c33dc1@news.povray.org>
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> Warp wrote:
> >   It breaks modularity badly. The whole idea of data hiding is that the
> > private part should be completely opaque to the outside. The second it
> > isn't, outside code will start making assumptions, and you can't change
> > the implementation of the class anymore.

> You CAN change the implementation of the class. It's not your problem if you
> break code that made assumptions.

  I don't think that's a good programming principle.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 03:00:47
Message: <49c33f1f@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> There are few other unsafe OOP languages I know enough about to discuss. Ada 
> and C++ are the only unsafe OOP languages I know

  Ok, here's a couple more:

- Objective-C. Regardless of the name, has nothing to do with C++.
- C#. Regardless of the name, has nothing to do with C++.

> >   The connection between my usage of the word "kludge" and your usage
> > of the words "unsafe" and "reflection" is purely your invention.

> OK. I was confused by the fact that your post had
> 1) A paragraph about how CLOS allows access to the private variables,
> 2) a comment about languages lacking data hiding aren't really OO,
> 3) a lack of specific support for hiding means the OO is kludgey.

  I still see no connection to "unsafe" languages and "reflection". Those
were your inventions.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 03:06:46
Message: <49c34086@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> > Darren New <dne### [at] sanrrcom> wrote:
> >>>> I'm saying that C++ does not enforce that you don't change private instance 
> >>>> variables from outside the class.
> >>>   And this has exactly what to do with whether (compiler-enforced) data
> >>> hiding is a good thing or not?
> > 
> >> Because there's two reasons for data hiding: (1) allow more flexibility in 
> >> implementation, (2) allow easier debugging.
> > 
> >> If you can violate my encapsulation, I don't see the data as especially 
> >> encapsulated, is all.
> > 
> >   You didn't answer my question.

> You said the designs of C# and Java are badly broken because they let you 
> get to the private variables of an instance using reflection. You then said 
> C++ doesn't let you get to a private variable of an instance. I was 
> disputing that claim. That's what compiler-enforced data hiding has to do 
> with C++.

> >   "Is enforced data hiding a good thing or a bad thing?"
> >   "In C++ you can bypass the encapsulation, so it's a bad thing."

> You skipped a bunch of context in between that I thought still applied. 
> Maybe you're reading messages in a different order than I am. That's one of 
> the problems when a conversation really gets going online. :-)

> If you're not going to apply that context, see my other messages where I 
> explain the types of access and seem to be mostly in agreement with you.

> >>>   Every single discussion about programming with you turns into C++ bashing,
> >>> no matter what the subject.

> >> I'm happy to bash any other unsafe OO language you might want to name. :-)

> >   It's getting really tiresome and old.

> I didn't start out bashing C++ this time. We got pretty far until you 
> *seemed to* claim C++ was better at modularity than C# or Java or CLOS. I 
> merely listed C++ amongst a half-dozen languages I was criticizing for 
> different individual design choices.

  You are seriously claiming that when you wrote "like, in unsafe languages,
where a stray pointer can change private variables without going thru the
class methods? :-)" as a reply to my post you were not directly and
exclusively referencing C++, especially with that smiley?

  What other half-dozen "unsafe languages, where a stray pointer can change
private variables" were you talking about there?

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 11:39:51
Message: <49c3b8c7$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Consider the case of "class alpha 
>> {int abc;}" for a counter-example - I know exactly how that's laid out due 
>> to the standard.
> 
>   I don't think the standard specifies what kind of padding the compiler
> will use between member elements.

It specifies that the first element has no padding before it.

>   For example, if you have a "struct { char c; int i; };", how many bytes,
> if at all, are there between 'c' and 'i'?

That's a different example, yes.  It's going to be compiler/architecture 
dependent.

>   Oh, and it becomes even more complicated:
> 
> class A { int i1; public: virtual ~A(); };
> class B1: virtual public A { int i2; };
> class B2: virtual public A { int i3; };
> class C: public B1, public B2 { int i4; };
> 
>   Want to start guessing the offsets of the ints inside C? Good luck.

I don't think the standard says what the offsets are for classes with 
virtual destructors.

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

From: Darren New
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 11:56:24
Message: <49c3bca8@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Warp wrote:
>>>   You always succeed in returning to your favorite subject: Bashing
>>> "unsafe" languages. And in your world there's only one such language: C++.
> 
>> You know something?  It's getting "really tiresome and old" that every time 
>> I list problems with 5 or 6 different languages, you think I'm bashing on 
>> C++.
> 
>   5 or 6 different languages? Really?

Yeah. LISP, Java, C#, C++, Python, and Ada. That's the first post I said 
anything that could conceivably imply C++ wasn't perfect. I pointed out how 
you could violate encapsulation in each of them.

>   You started by making a reference to "unsafe languages" within the subject
> of modular programming as a reply to one of my posts

Yes.

>(clearly as a reference to C++), 

Except I specificly used the phrase "unsafe languages" because I knew if I 
said "C++" you'd go off the handle.  I was particularly pointing out that 
unsafe languages let you violate modularity. Whether it's OO modularity or 
non-OO modularity is irrelevant to whether unsafe languages let you violate 
modularity.

 > and later you said that C++ is the *only* unsafe OO language you
> know of.

But it's not the only unsafe modular language I know. But you were talking 
about OO in addition to modularity, so that's why it came up.

> After that you have been done nothing else than arguing why
> modularity in C++ is broken and why Lisp, Java and C# are so great.

I haven't said the others were great. I simply said I preferred the 
imperfections in C# to the imperfections in C++.

>   Yeah, sure. You really have been pointing out problems in "5 or 6 different
> languages", and I'm just being paranoid that you are concentrating a little
> too much on C++.

Honestly, it really seems like that to me. I'm sorry you have so much of 
your ego bound up in a programming language.

>> It's 
>> getting "really tiresome and old" that every time I point out problems with 
>> unsafe languages in general, you think I'm bashing solely on C++.
> 
>   You explicitly wrote that C++ is the only unsafe OO language you know of.

Yes, after you asked me about it.  I also asked you to name another unsafe 
OO language, but you didn't. There are other OO languages that you can 
bypass the safety on, but most people using them don't without knowing what 
they're doing, specifically for performance.

> You have been writing specifically about C++, not about "unsafe languages
> in general".

No. I was writing about unsafe modular languages. It turned into C++ after a 
while, when people started specifically saying you can't bypass the 
modularity in C++ like you can in the other languages.

>   And it's getting really tiresome and old that you act all innocent after
> a tirade of C++ bashing, saying that "I just wanted a serious discussion
> and honestly wanted to know more", when it's rather clear that you didn't
> really.

Well, if you start out with that assumption, I guess anything I say can be 
twisted to read that way.

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

From: Darren New
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 11:56:33
Message: <49c3bcb1$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> There are few other unsafe OOP languages I know enough about to discuss. Ada 
>> and C++ are the only unsafe OOP languages I know
> 
>   Ok, here's a couple more:
> 
> - Objective-C. Regardless of the name, has nothing to do with C++.

Hmm. Yes, ok, I'd forgotten about that one, since I looked at it way back in 
the NeXT days but never used it. Very good, thanks. That's another example 
of an unsafe OO language where the lack of safety can lead to lack of 
modularity with all the same problems as C++.

> - C#. Regardless of the name, has nothing to do with C++.

C# is only unsafe if you specifically tell it "hey, I'm doing something 
unsafe."  That doesn't really count, any more than a safe language that can 
call out to C libraries is "unsafe".

>   I still see no connection to "unsafe" languages and "reflection". Those
> were your inventions.

Yes. It's part of an ongoing conversation, you see. "Access to private 
members violates encapsulation."   "Yes, and here's other ways to violate 
encapsulation."  See?

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

From: Darren New
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 11:59:28
Message: <49c3bd60$1@news.povray.org>
Warp wrote:
>   You are seriously claiming that when you wrote "like, in unsafe languages,
> where a stray pointer can change private variables without going thru the
> class methods? :-)" as a reply to my post you were not directly and
> exclusively referencing C++, especially with that smiley?

Yes. I am seriously claiming that. The smiley is there to say "Gee, I bet 
Warp will assume I'm for some reason attacking him. Maybe I'll try to be 
friendly and head that off."

If I was intentionally tweaking you, I'd use a winky face. :-)

>   What other half-dozen "unsafe languages, where a stray pointer can change
> private variables" were you talking about there?

C, for one. Any of the usually-safe languages that specifically bypass the 
safety features, like Ada using unchecked features or Eiffel with the 
precondition checking compiled out.

-- 
   Darren New, San Diego CA, USA (PST)
   My fortune cookie said, "You will soon be
   unable to read this, even at arm's length."


Post a reply to this message

From: Warp
Subject: Re: This is the sort of brokenness...
Date: 20 Mar 2009 12:41:52
Message: <49c3c74f@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> > - C#. Regardless of the name, has nothing to do with C++.

> C# is only unsafe if you specifically tell it "hey, I'm doing something 
> unsafe."  That doesn't really count

  Of course it doesn't.

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.