6 ms·
> The most interesting possiblility would be that this is the start of Apple’s evolution away from Objective-C into promoting a higher-level language for their
by kybernetyk 13y ago
> The most interesting possiblility would be that this is the start of Apple’s evolution away from Objective-C into promoting a higher-level language for their platform
The thing is: Why would they want to transform away? As it is now Obj-C is pretty sane. The memory management is now a non-brainer so that even people who come from managed languages can grasp it. GCD is great for concurrency. And using C and C++ based 3rd party libraries is trivial.
The existing developer base is fine with Obj-C.
So maybe Apple wants to attract new developers? But why now? If they really wanted to attract new developers to their platform they would have chosen a different language for the iPhone SDK back when they released it first. But nowadays Apple's platforms have more than enough developers.
Also: Why JavaScript? JS itself is a terrible language with many inconsistencies and is unfit for larger projects - which most native applications are. There are far better and saner languages to base a new SDK upon.
- seivan 13y agoI agree, there is something very special about OBJ-C these days. With subscripts, literals and even in the past with Protocols doing service objects were a breeze. GCD is amazing and I use it more than NSOperation for easy quick off stuff. That being said, I can see how this would be useful for gamedevelopers who wanna keep their scripts in JS/CoffeeScript instead of LUA :-)
- jfb 13y agoMaybe I've just swallowed the Kool-Aid, but I don't see the putative benefits of Apple's switching platforms. I'm also not clear on how many people there are who a) can write non-trivial software and b) can't learn a C derivative language who c) would actually write software for Apple's platforms. It just seems like a pretty small set. And, if Apple were to switch, why would they pick a language as shitty as Javascript?
- caycep 13y agoBut it has Good Parts(tm)!
- jfb 13y agoI remain skeptical.
- u2328 13y agoHave you ever written any significant amount of JavaScript?
- jfb 13y agoEnough to not want to do any more.
- u2328 13y agoI take that as a "no." I grew up as a programmer through C++ and Java, and the first time I ever worked on a JavaScript project, I hated it, and I said the same thing about JavaScript as you did. That's because I was thinking like a Java programmer, and not just a programmer. As I worked more and more with JavaScript, I've grown to love. It has it's pitfalls, sure, but there's just so much flexibility in JavaScript than languages like Java or C++. Nowadays, I prefer it to Java or C++. Even for server-side programming. I get the feeling that you don't really know enough to know what you're missing.
- jfb 13y agoI don't write Java or C++.
- deleted 13y ago[deleted]
- bobwaycott 13y agoIt is advisable to taboo your practice of taking any thing X that differs from your viewpoint as a "no". It is also advisable to taboo projecting your own experience/thoughts onto another, as if that is his/her experience/thoughts, as well. That you love JavaScript, even for server-side programming, has absolutely zero significance in evaluating whether jfb (or anyone else, for that matter) knows enough to know what s/he is missing.
- zackbloom 13y agoClosures + Lexical Scoping + Prototypical Inheritance makes for a pretty great language IMHO.
- ldh 13y agoThose things are indeed nice, but they can't defend against the other insanities that come in the box with them.
- gcr 13y agoOnly a subset of Javascript is useful, just like how only a subset of C++ is useful, just like how only a subset of Objective-C is useful, just like how only a subset of Haskell is useful, ...
- yen223 13y agoWasn't there a saying: "90% of everything is crap"?
- coldtea 13y agoAll languages have crap. C? Buffer overflows, manual memory management, header files, severely lacking standard libraries, crap support for most modern idioms, etc etc. C++? Tons of edge cases, template madness, unbelievable large language spec, etc etc. Python? Python 2 - 3 dichotomy, crappy concurrency / parallelism support, , strict on whitespace, standard libs in various stages of cruft and abandonment, no proper closures, CPU bound for lots of interesting problems necessitating bilingual development with C extensions or the use of hacks such as Cython etc. You can find a similar list for everything, from Lisp to Haskell. Javascript "insanities" are no big deal. People have been creating large apps (including porting stuff like THE WHOLE BLOODY QT TOOLKIT to it) in it with no problems. Once you know them, you can work around them. A huge install base, huge number of programmers, easy syntax, powering the internet, lispy-flexibility, and the fastest interpreters this side of the JVM are enough benefits to counter some crappy coercion rules and FP only math bizarreness.
- pi18n 13y ago
- Arelius 13y agoI actually like Javascript. Sure it has some warts. But it has an elegance I've really only seen in Javascript, Lua, and Lisp.
- drtse4 13y agoYou last sentence is a bit far-fetched.
- stcredzero 13y agoThe referred sentence is a matter of opinion, so it's a bit far-fetched to say it's a bit far-fetched, IMO. From what I know of Lua, it's fairly tiny, and it has ready access to its own meta-level -- to the point where there can be a blurring of programming and meta-programming. Instead of everything "being an Object," everything is in a table. Just rename "table" to "object" and call it a prototypical day.
- drtse4 13y agoNo it's not, jokes aside, implicitly comparing Javascript to Lisp from the point of view of elegance is simply incorrect, for many definitions of "elegance".
- stcredzero 13y agoAnd for how many definitions of "comparable?" Lose a point for careless reading.
- CodeCube 13y agoIt is an elegant weapon, for a more civilized age
- mmariani 13y agoIf you want to shoot your own foot sure!
- 13y ago
- reeses 13y agoWait, don't you remember Steve's original announcement about the great development opportunities on iPhone, where you could use HTML and Javascript? You won't be able to use undocumented APIs because you won't be able to get to them.
- phawk 13y agoI think it's less a specific shift to JS, but more a shift to HTML5 and CSS3. That would probably be a better reason to allow people to write JS apps.
- jfb 13y agoThat's even less explicable.
- marknutter 13y agoNo, your language is shitty!
- ojr 13y agolast time I check a) javascript is a c derivative language and b) it is used for "non-trivial software" c) there will be developers believe it or not that would be able to create maintainable apps that maybe won't be good enough to your standards but I have a small feeling the average consumer will not care, my advice: http://alwaysbetonjs.com/ http://alwaysbetonjs.com/ Apple's on board
- wwweston 13y ago> a) can write non-trivial software and b) can't learn a C derivative language who c) would actually write software for Apple's platforms. It just seems like a pretty small set. Funny. I've sometimes similarly speculated in the past that the set of developers who (a) struggle with JavaScript as a tool for in-browser apps and (b) would actually be genuinely productive with some other dynamic scripting language (Ruby, Python, CoffeeScript) in the same context is pretty small too. But the truth is probably that whether or not someone can develop non-trivial software with any roughly equivalent language is mostly a function of available time to ramp up vs spend on other things. So, sure, Obj C and JS are close enough that anybody who can develop non-trivial software in one can probably do it in the other... but it's still going to be a time investment while you learn how things are done in the language and various associated APIs. I don't know if Apple particularly cares if they're pulling in more developers. If they do, though, adding another language that many developers already know makes sense. It reduces the friction involved. > And, if Apple were to switch, why would they pick a language as shitty as Javascript? On top of the widespread at-least-shallow familiarity, not everyone shares this opinion. Also, this is unlikely to be a "switch." It's more likely to be a gateway.
- wamatt 13y ago>And, if Apple were to switch, why would they pick a language as shitty as Javascript? That seems to be a fairly popular dismissal for a language designed in 10 days, and perhaps rightly so. JavaScript probably classifies as mediocre language compared to the wealth of sanely designed choices we have available today. That said, have you taken a recent look at the next generation of JavaScript aka ES6/Harmony?[1] - Modules? Yup - Maps and Sets? You bet. - Tail call optimizations? Sure - Classes? Finally! etc That's not to suggest that a single iteration will magically fix all of its quirks and shortcomings. However, one possibility could be that Apple picked JS, not on it's checkered history, or the fact that it is popular amongst web developers today, but where it is headed tomorrow and how it could be adopted and adapted. [1] https://wiki.mozilla.org/ES6_plans* https://wiki.mozilla.org/ES6_plans*
- javis 13y ago> Why JavaScript? Because it's popular.
- CmonNoReg 13y agoProbably the same reason Microsoft is also promoting C++ and JavaScript (both are utterly ugly when compared to C#/F#) for Windows 8 - to expand developer base.
- kcase 13y agoRather than this being the start of an evolution away from Objective C (which to me seems both unlikely and terrible), I wonder if it could be the start of an evolution away from AppleScript towards a user-scripting language that is easier to sandbox, more portable, and is familiar to a lot more script writers?
- purplelobster 13y agoPersonally, I'm developing a fairly advanced web app. Since I'm the only developer, I can't afford to split my time between web, iOS and android development. If a JavaScript bridge allows me to reuse all the logic from my web app, but replace the UI with a snappier native one, that would save me a buttload of time. Maybe Apple out of the goodness in their heart decided to make this easier, but I'm skeptical.
- invisible 13y ago> Why JavaScript? Because websites (and thus JavaScript, in some form) are the future of programming at this point in time. JavaScript just happens to be the primary programming language for interacting with HTML5 and a lot of people happen to know it pretty well. Plus, JavaScript is not a terrible language but it does take a lot of knowledge to work with it cross-browser and use browser APIs (these browser APIs tend to suck).
- shock-value 13y agoJavaScript is not the future of programming. It is the past, present, and (most likely) future of client-side web programming, but that's all.
- invisible 13y agoI don't know why I bother to post on HN... I said websites are the future of programming. So yes, JavaScript is the client-side portion of that in which I was referring to in my previous post that you had to retort in some manner. Of course, you can use JavaScript, Ruby, Python, PHP for the server-side, but regardless that is a moot point when the article is about client-side programming on OS X.