3 ms·
Method names in Objective-C
- stcredzero 17y agoMethod names in Obj-C are very similar to messages in Smalltalk. They are modeled after Smalltalk messages, in fact. As a Smalltalker of over 10 years, I have to ask, why are we still naming methods with strings? Why are we programming with flat text? I can easily imagine a hypertext programming environment, where method names, variable names, etc, are rich objects, in much the same way that text in a WYSIWYG word processor are rich objects. All of the formatting information is there, but you can see as much of it as you want. Most of the time, it is out of your way so you can just write. The way we program now is like using really old versions of WordPerfect with the formatting characters. Granted, you don't want your programming environment to be buggy like Word, but I see no reason why such an environment couldn't be made rock solid. Note that I am not advocating visual programming. We would be retaining syntactic structures. These would just be augmented with selective information hiding/showing and other automation. (Like type inference?) Current IDEs are trending this way anyhow. With things like code folding, code completion, and highlight-searches, we are part of the way there. Strongtalk uses hyperlinked code browsing, but last time I looked, this was only to aid in navigation/browsing. I suspect that abandoning flat text would enable entirely new ways of programming. I could imagine something that looks like Python or Ruby, but which is statically typed compiled with a Hindley-Milner type inference engine operating in the background. The types would mostly take care of themselves, but you could make them visible for hand-tweaking whenever you wanted. (Like at optimization time in your development cycle, after you've run the profiler!)
- DougBTX 17y ago> where method names, variable names, etc, are rich objects Reminds me of Ctrl+Click to go to method/class definitions using Resharper.
- stcredzero 17y agoWhen you type something ambiguous, why can't the IDE just ask you right then and there for a clarification, which will become part of the (possibly hidden) data for that word in the source code?
- ezy 17y agoWell, I don't think you'd be able to get along without names, but you could see it being less word-centric. I'm still waiting on a programming environment thats well-suited to a tablet. I think it'll necessarily be flat and have names (because it's an interface for humans, after all), but it seems the only reason we aren't using mathematical symbols and juxtaposition (on the page) in our programming languages is not because it's horrible to read .. but because it really annoying to type.
- wlievens 17y agoWhat you propose is part of the Language Workbench [Fowler] or Intentional Programming ideas [Simonyi].