Really const correctness in the first place belonged in the Objective-C group.
If you read the rest of my post I'm talking about immutability and const
correctness, so although this comment on popularity came first it was just a
subtopic and you have picked on this as a sub topic of the
On 20 Mar 2012, at 02:43, Nick Zitzmann wrote:
> On Mar 19, 2012, at 5:51 AM, Ian Joyner wrote:
>
>> Actually NSArray. Note NSMutableArray inherits from NSArray because it adds
>> extra functionality in methods that can change the object. You can assign an
>> NSMutableArray object to an NSArray
Amen.
On 2012-03-19, at 11:55 AM, Jens Alfke wrote:
> I don’t mean to be rude, but I’m about at my personal limit of patience with
> the amount of off-topic stuff one has to wade through on the Apple lists
> lately (especially xcode-users, but here too.)
On Mar 19, 2012, at 4:51 AM, Ian Joyner wrote:
> Popularity is more a proof of mass stupidity rather than quality. The cult of
> C followed on from what Bob Barton called the cult of FORTRAN in 1963 and
> also noted that systems programmers are high priests of a low cult.
Please take this off-
On Mar 19, 2012, at 5:51 AM, Ian Joyner wrote:
> Actually NSArray. Note NSMutableArray inherits from NSArray because it adds
> extra functionality in methods that can change the object. You can assign an
> NSMutableArray object to an NSArray reference, thereby making it unchangeable
> via that
fusing talking about things in see
:-)
>
> I hate to use Wiki for citation but:
>
> http://en.wikipedia.org/wiki/Const-correctness
>
> "In computer science, const-correctness is the form of program correctness
> that deals with the proper declaration of objects as mutabl
tability just another word for constant-ability?
I hate to use Wiki for citation but:
http://en.wikipedia.org/wiki/Const-correctness
"In computer science, const-correctness is the form of program correctness that
deals with the proper declaration of objects as mutable or immutable. T
I think you've nailed it. Immutability is certainly a good concept, but
including ideas from C++ is not a good idea because concepts are usually
perverted in C++ (and even C - ALGOL carefully removed the junk out of FORTRAN
and assembler but C, just put that garbage back in.) Concepts need very
No no, you've both been very helpful. The time lines and "Mutable" thoughts
are great points and more than answer my underlying question.
Understanding a bit of the history goes along way when trying to
rationalize (and adhere to) current conventions.
Many Thanks!
-Luther
On Sun, Mar 18, 2012 a
On Mar 18, 2012, at 11:01 AM, Luther Baker wrote:
> Obj-C and Cocoa don't support "const" because they are older?
More because they weren’t designed around it. And because the way C++ does
‘const’ gets really problematic in a dynamic OOP language like Obj-C.
Say you added ‘const’ object pointe
On Mar 17, 2012, at 10:58 PM, Luther Baker wrote:
> I was ruminating about it more of a (self) documenting angle as opposed to
> runtime enforcement …
Cocoa’s idioms are different. In Cocoa you use mutable vs. immutable container
types to indicate this. So if a method parameter is NSMutableStr
On Mar 18, 2012, at 12:01 PM, Luther Baker wrote:
> Obj-C and Cocoa don't support "const" because they are older?
Const showed up in C in around '89 or '90. Retrofitting const into large
libraries that were designed without it is an absolute nightmare because of the
cascading changes required.
Obj-C and Cocoa don't support "const" because they are older?
On Sun, Mar 18, 2012 at 9:44 AM, Scott Ribe wrote:
> On Mar 17, 2012, at 11:58 PM, Luther Baker wrote:
>
> > I was ruminating about it more of a (self) documenting angle as opposed
> to
> > runtime enforcement ... and indeed, its appl
On Mar 17, 2012, at 11:58 PM, Luther Baker wrote:
> I was ruminating about it more of a (self) documenting angle as opposed to
> runtime enforcement ... and indeed, its application in C++ is what I'm was
> thinking of.
Well that's fine, but Objective-C and Cocoa predate const by many years.
--
That makes sense ... although the compiler sure does a good job of catching
it at compile time :)
I was ruminating about it more of a (self) documenting angle as opposed to
runtime enforcement ... and indeed, its application in C++ is what I'm was
thinking of.
Thanks Jens!
-Luther
On Sun, Mar
On Mar 17, 2012, at 10:12 PM, Luther Baker wrote:
> Just curious for the reasoning as to why some of the API calls like
> [NSDictionary valueForKey:] take an NSString* and not a *const* NSString* ?
‘const’ doesn’t mean anything when applied to Objective-C object pointers.
Unlike C++, the langua
Just curious for the reasoning as to why some of the API calls like
[NSDictionary valueForKey:] take an NSString* and not a *const* NSString* ?
I guess NSStrings are immutable and maybe most runtime built strings are
more commonly not const ... but is everyone simply casting these guys at
API invo
17 matches
Mail list logo