Not sure who u will piss off more
Java or Mac fanboi's, i think i can hear their foot steps coming in the distance, no wait its my team lead better start to look busy....
If an El Reg hack can write an iPhone application then anyone can, so we thought we'd have a go and pass on our experience in the hope that others can build something more useful. In proper Web 2.0 fashion we decided to create an application which would achieve nothing and have no commercial potential. Therefore, our …
Perhaps someone at El Reg who does not think that JavaScript is 'an annoying scripting language with aspirations of objecthood' should have attempted this task. This article seems to be a bitter stab at what the author considers a weak language, rather than an insight into builidng iPhone apps.
Having read to the end, it is clear that the author is unwilling or incapable of learning what is in-fact a very powerful language. I've not yet written an iPhone app, but if I did, I'm sure I would not need to use iFrames in my HTML markup, nor worry about page onload events, or the XmlHttpRequestObject. I'd use one of the popular JavaScript frameworks to do the plumbing - JQuery, Prototype, Dojo, and get rid of those global variables and functions.. maybe even use objects.
Bill. Stick to being a journalist. You're clearly not a developer. Mind you, based on this article, I'm not sure which you are worse at
You are most correct my pedantic friend and I stand corrected :) *tongue in check humour, no offence intended* :)
Though they are close enough for me not to particularily like either. Just personal preference though, more a desktop programmer than web, in the immortal words of BG 'it will never catch on' :).
I'm sorry if I'm being a bit of an old school kind of guy, but please someone explain to me how writing a javascript web page being an application which is loaded on to your iphone?
Did the definition of an application change when the IT press monikered web 2.0?
Not that I'm being critical of this little "hack" (again old school reference...)...
Hmm, doesn't know anything about XMLHttpRequest
Doesn't understand that Javascript does have objects and is a powerful prototype based language (although with many issues!)
Uses javascript global variables
Can't write a valid HTML page.
Uses 'old school' event handling
How much do people on this site get paid to write 'web apps'? I can do a lot better than this and I'm pretty woeful :-) Please let me know how much my salary will be
"it is clear that the author is unwilling or incapable of learning what is in-fact a very powerful language."
I reel in shock from the sudden IQ loss. All I have to say about JavaScript is what Joe Buchanan said about Frankenstein's Monster: "It's an abomination in the eyes of God".
Instead of dying as it should have, some wise-crack decided to "mate" the damn thing with Web Services, which were NEVER meant to be used by end-users, but instead for B2B EDI transactions, and create the AJAX "technology". Urggggh...
That said, its a useful app 'coz it blocks "iPhone" and its source code shows how shite the Javascript "language" is!
I prefer server-side Java (J2EE) or even client-side, as it'll run independently of your browser or OS.
> I prefer server-side Java (J2EE) or even client-side, as it'll run independently of your browser or OS.
Right, because I really want to have to load an external VM and suck down huge quantities of memory and CPU cycles just to have a little interactivity on my web forms. On a mobile device even. That'll be sweet.
Seriously, yes Javascript has its fair share of problems - probably more than a lot of other common languages - but if you really think its object model is weak then you're doing it wrong. Go read a book - hell, a web page - and come back when you know something about the subject.
Amen Brother.
The app can't even work consistently across versions of Safari, let alone play nice with IE and Opera!
Do everything server side and render nice HTML. A shame that javascript was never replaced by a client side equivalent of Java or PHP with access to the browser DOM....
Let me emphasise something an earlier commenter mentioned.
Use JQuery.
JQuery.
Don't not use JQuery.
http://jquery.com.
From someone who's happy that JQuery makes Javascript into a language that looks as though it was designed to interact with the DOM (CSS3 selectors, no less), rather than one that looks like Java, which clearly was not designed for this task.
...I don't care.
Your article was, quite frankly, poor. You clearly did NOT research your subject matter before posting, somthing which is becomming more and more prevelant across dead reg.
The code is an abomination, whilst I won't get drawn into the JavaScript is shite debate (it is shite, but I have no need to qualify that statement) you could/should have at least made sure your code works properly. For a start it is possible to do what you have done on ANY half modern browser, any good developer of web based systems knows to make crosss browser capabilities a priority. But, your not a developer.
Once again a register posting that could have been somthing usefull, let down by lazy 'reporters' who have about as much IT knowledge as a cabbage...sort it out or close down.
Believe it or not, Jobs and Co. have actively tried to break any and all hacks letting people install their own software onto their own devices with each new firmware release. Despite Apple fans calling it a smartphone, it is not -- the end user cannot install their own apps. Apple's official method to write apps "for" the iphone is to do javascript, html, ajax, etc.
As for XmlHttpRequest, on paper it's standardized. In practice I keep reading about people having to throw in hacks to make it work properly on various browsers.