8 ms·
Java Was Strongly Influenced by Objective-C
- gilgoomesh 14y agoWhich is why Objective-C++ is so much fun to have available in your Mac/iOS programming toolbelt: it's the best and worst of two completely different C-derived object-oriented language lineages in one schizophrenic package.
- deleted 14y ago[deleted]
- Moto7451 14y agoMy personal best/favorite use of Objective C++ was using it for code reuse between an iOS app and a WPF Windows desktop app. I was building a horribly boring CRUD app that used google Maps (basically a work order management program) and doing something a little outside of the normal helped make the project fun.
- cageface 14y agoIt's a terrible Frankenstein monster but it can be pretty useful. My most popular iOS app is a synthesizer with a UI in Obj-C and a DSP core in pure C++. Interfacing the two is pretty trivial thanks to Obj-C++. I've been considering a port to Android but all the JNI boilerplate I'd have to write is putting me off.
- asveikau 14y agoI'll agree that JNI is inelegant, but having recently written a small amount of JNI glue with the NDK for a hobby/side project, I have to say, once you get going it won't be a big deal. If that's really the only barrier to an Android port, I say bite the bullet, sit down and do it.
- cageface 14y agoI need to do it anyway. I'm taking on more and more Android work and I know sooner or later I'm going to have to dig into the native layer. Thanks for the words of encouragement.
- scrumper 14y agoSo's mine (and we both have Futura-heavy UI's. :]) I looked into an Android port and walked away very quickly: there's no Core Audio, not even a HAL. Most devices have unusably high audio latency, too. It's a nightmare.
- cageface 14y agoIt's unfortunate really. Philosophically I'm much more aligned with Android and overall I prefer the Android API but music apps are my passion and Android is so far behind there it's not even funny. Cool synth, by the way. I'd like to see more of these kinds of experimental instruments on the iPad.
- scrumper 14y agoThanks, likewise. Been meaning to try out some grain stuff, now I have an excuse.
- cageface 14y agoActually the app name is kind of misnomer. It started out as a grain synth but wound up as a straight subtractive but I was kind of committed to the name already. I should probably change the name actually.
- timthorn 14y agoFascinating that this snippet is from comp.sys.newton. I've forgotten all my NewtonScript, but do remember the richness of the Newton programming model.
- rayiner 14y agoWell Objective-C was influenced by Smalltalk, and nearly every modern OOP language was also heavily influenced by Smalltalk. And of course there has been over the years a lot of cross-pollination between Smalltalk and Java. Hotspot was written by the team that had originally marketed a Smalltalk VM, Gilad Bracha co-authored the JVM 2.0 specification and was also involved in the Strongtalk Smalltalk implementation, and of course one of the key developers of Hotspot, Lars Bak, is now working on Dart which is basically Smalltalk with Javascript syntax.
- nikster 14y agoI can't help but think that ARC has pretty much killed garbage collection. Why use garbage collection at all when you have a static equivalent that works just as well?
- mikeash 14y agoIt doesn't work nearly as well. ARC doesn't handle cycles at all, which makes it substantially more painful to use than a garbage collector. Don't get me wrong. ARC is great compared to the previous situation, but it's simply not a substitute for a real GC. Automatic reference counting dates back to probably the 1950s. If it "works just as well" as garbage collection, don't you think it would have won by now?
- seanmcdirmid 14y agoOne day a student came to Moon and said, "I understand how to make a better garbage collector. We must keep a reference count of the pointers to each cons." Moon patiently told the student the following story - "One day a student came to Moon and said, "I understand how to make a better garbage collector... http://www.csd.uwo.ca/staff/magi/personal/humour/Computer_Folklore/The%20Garbage%20Collection%20Koan.html http://www.csd.uwo.ca/staff/magi/personal/humour/Computer_Fo...
- mikeash 14y agoThis makes me paranoid that you can read my thoughts.
- nikster 14y agoThat might explain its complicated syntax. Better than obj-c but worse than nice languages like Ruby or Python. Also, if they were influenced by Obj-C then why on earth didn't they bring over the by far most useful feature of the language, caegories?! Or maybe categories were a later addition? I have been developing Java for 15 years and ObjC only for two but categories are seriously the best thing since sliced bread. Anything missing in the libraries? Just add it!
- mikeash 14y agoJust make sure you prefix your category methods. Somebody at Apple might have the same idea you have, and if the two implementations aren't perfectly compatible, you're in a world of hurt.
- MaxGabriel 14y agoI wouldn't know how much the convention is enforced, but doesn't Apple prefix private API with an underscore? Edit: this is from the Apple naming guidelines, but it doesn't clarify that they always follow that convention for private methods: Avoid the use of the underscore character as a prefix meaning private in method names (using an underscore character as a prefix for an instance variable name is allowed). Apple reserves the use of this convention. Use by third parties could result in name-space collisions; they might unwittingly override an existing private method with one of their own, with disastrous consequences. See “Private Methods” for suggestions on conventions to follow for private API.
- hboon 14y agoThey most definitely have private functions that do not have prefix. The iOS Three20 framework used to have a bug where you tap on a tab bar button a second time and it crashed because a cateogry method had the same name as an existing private method.
- mikeash 14y agoThe new method could be public.
- sippndipp 14y agoSo how comes that they missing out all the cool features like "performSelector", "respondsToSelector"? Sure the whole OOP part may comes from Objective-C (SmallTalk to be precise) but the dynamic parts were poorly executed.
- malbs 14y agoNot to mention the fact that they completely ignored class methods. No, static methods do not count.
- i386 14y agoOut of curiosity, why do statics not count for class methods?
- malbs 14y agoclass methods are virtual
- hboon 14y agoThey are closer to global functions that are attached to classes and don't support inheritance the same way as instance methods. e.g. if a subclass implements a static function with the same signature as its parent, and you call it with the parent class, it invokes the parent class version instead of the subclass version. Class-side methods in Smalltalk are inherited, working with classes (as an object) is analogous to how instance-side methods work with instances (also objects). So e.g implementing and using factory methods are simpler in Smalltalk and similar languages. Edit: grammer and typos.
- jcampbell1 14y agoThe only difference I know of is that you can override inherited class methods, but not in Java. Is that really an important feature that you use? I suppose you could use it to do "factory" stuff, without an actual factory class.
- 14y ago
- zackzackzack 14y agoI'm twenty-one and the email referenced something called "Excited Live". Can anybody explain what that was? Google hasn't been much help.
- georgemcbay 14y agoExcite Live! was one of the many services (circa ~1996) offered by Excite, which was kinda-sorta like Yahoo (search, web site directory, etc, etc) but is mostly remembered today as the company that could have bought Google for pennies but passed on it. http://en.wikipedia.org/wiki/Excite http://en.wikipedia.org/wiki/Excite http://www.excite.com http://www.excite.com I briefly worked for Excite entirely by accident, but my tenure there was pretty brief due to an odd situation. I was originally hired by Novo Media Group who at the time was in the final stages of a merger with McKinley (known for the Magellan search engine), and McKinley's Sausalito offices were closer to my home (Novo was in SF and I was living in Marin) so I was located in that office under the assumption that both offices would soon be serving the same company but the deal with Novo fell through, Excite bought McKinley and things got weird and I left.
- deleted 14y ago[deleted]
- darknoon 14y agoShit I feel old.
- happycube 14y agoI remember what the @home jingle ~2000-2001 should've been: "I don't wanna grow, I wanna buy a crappy web portal..."
- SeanLuke 14y agoWow, a pointer to an old page of mine, that's weird to see on HN. This post was originally from comp.sys.newton.misc, back when I was a PhD student. Here was the thread: https://groups.google.com/d/topic/comp.sys.newton.misc/Kb0JoVv2ljA/discussion https://groups.google.com/d/topic/comp.sys.newton.misc/Kb0Jo... The discussion was originally about Java on the Newton, and someone had made the goofy suggestion that Java was based on NewtonScript. Patrick Naughton jumping in was an interesting ending to the thread. As a side note: four years later I actually wound up writing the only version of Java released on the Newton (Waba). http://cs.gmu.edu/~sean/projects/newton/waba/ http://cs.gmu.edu/~sean/projects/newton/waba/
- huherto 14y agoMay be this time you can fit here your proof that P == NP.
- seanmcdirmid 14y agoThat is quite cool! I wrote a JVM for the PalmPilot in 1998: http://www.cs.utah.edu/~mcdirmid/ghost/ http://www.cs.utah.edu/~mcdirmid/ghost/ Lots of fun fitting the 1.0.2 class libraries into 180K (out of 256K available, needed some space to run in!).