eerolanguage / eero

Eero was a fully binary- and header-compatible dialect of Objective-C, implemented with a modified version of the Apple-sponsored LLVM/clang open-source compiler. It featured a streamlined syntax, Python-like indentation, and other features that improve readability and code safety. It was inspired by languages such as Smalltalk, Python, and Ruby.
https://web.archive.org/web/20171101134337/http://eerolanguage.org/
288 stars 7 forks source link

Consider changing class and interface declaration terms #32

Closed mbaltaks closed 11 years ago

mbaltaks commented 12 years ago

This might be a silly idea, but I'll raise it anyway. I recently watched a WWDC video where Blaine Garst (WWDC 2010 Session 113 "Working Effectively with Objective-C on iPhone OS" at around 23:30) lamented the fact that because "@interface" is already used to declare a class, it is not available for declaring interfaces, which are therefore declared as "@protocol".

A new syntax for Objective-C might be the opportune place to let people declare a class with "class", and an interface with "interface". I'm not sure whether this would create less, or more confusion for existing Obj-C developers, but it would be very likely to be better for developers from any other language. Which audience is eero more targeted at?

Or there might be technical reasons that this is a bad idea.

pcperini commented 12 years ago

This feels weird to me, as @interfaces are indeed interfaces and @protocols are indeed protocols.

This is mostly because they're effectively the same thing, and so it's just a matter of picking a paradigm and sticking with it. In C, of which Objective-C is a superset, the common way to provide function declarations and reliable communication mechanisms is through header files. Objective-C naturally inherits this behavior and utilizes it as a means for objective-oriented interfacing.

That makes interfaces and protocols pretty technically similar, and they really only differ in use - not functionality. Since Java and other OOP languages often don't have a concept of headers, they only require direct implementations and implementation-less "protocols", which Java calls interfaces. To switch the names would really just be making Objective-C more Java-esque for the sake of making it more Java-esque.

That being said, if eero was intended to be more familiar to other OOP programmers, then it might be the right move, but I'm unsure.

andyarvanitis commented 12 years ago

It's a good question, but would propagate into many areas that I wouldn't necessarily want to change (including terminology for all the existing frameworks).

As for eero's target audience, it has definitely been current objc users. But interestingly, it has gotten some attention from those wishing to go from other languages (like Python or Ruby) to native Mac/iOS programming, but not entirely up to learning objc. I can't say if eero would help them, but it is kind of intriguing.