Creating a Color Meter Using Cocoa
Subject:   Reply to thebod's posts, and correction
Date:   2001-06-17 21:28:13
From:   thebod
Response to: Reply to thebod's posts, and correction

I finally got the program to build without any problems. Turns out that when I copied and pasted the code for updateColor, some hidden characters must gotten thrown into the source file. After actually typing out the code for the function the program built without any problems.

My big problem with Objective-C is the syntax. It is so foreign to me. For example:
object.function(param1, param2);

is a lot more intuitive to me than:

[object function:param1 p2:param2];

I think you said in one of your articles that you like the fact that you have to identify the parameter with the value it is being set to in the parameter list when sending a message to an object. (i.e. parameter p2 is getting set to param2 in the example above) Your claim was this made the code more "self documenting." If a programmer names his variables properly, this language feature only adds redundancy and causes a lot of excessive typing. Not to mention making for really long lines of code that are likely to wrap around to the next line making it more difficult to read... but that's a minor issue.

The features I use most in C++ are operator overloading, and templates. I may be wrong, but neither Objective-C nor Java support this. (I think there may be an effort underway to get these features included into the Java language.)

Basically everything I know about Objective-C I have learned from reading your articles. So I am sure my ignorance is shining through. Hopefully as I become more familiar with Objective-C my opinion will change. :)

I have heard some rumblings about Apple releasing an Objective-C++ compiler. Does anybody know anything about this?

Mike, keep up the good work. I look forward to reading your articles. I only wish they were a little more frequent. :)