Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
I haven't read any other replies yet but I think Burrito deserved a response.
Burrito wrote:but you can hardly blame the language itself for people using or 'mis-using' it. It's also not fair to paint a negative picture of it based on people's implementation of it...flashy or not. I agree that there is a lot of poorly written javascript code, but I've seen some horrendous php code as well.
Oh yes plenty of poor PHP. But poor JS is more annoying. Anyway I'm not saying this poor code is JS's fault just that, that is one of the reasons why it has a bad reputation.
while I agree that the cross browser (standardization...or lack thereof), is frustrating, I still don't think it's fair to peg javascript as 'shoddy'. Fingers need to be pointed at browser developers and even there, I wouldn't point too hard....here's why:
while IE has their own way of doing things, a lot of those things are revolutionary to the whole internet browsing experience. As far as I know (and I could very well be wrong), IE introduced the 'display' property in CSS which is now a must use tool to have in your back pocket for DHTML...I remember the days of 'visibility'...yuck! I DO know for a fact that MS introduced the XMLHttp object so this thread wouldn't even be happening had that not happend. I don't want this to turn into a IE flamewar so I'll leave it at that and get back on topic.
Microsoft introduced innerHTML which a lot of people live by as well. I have no problem with MS putting in their own features but, for gods sake implement the standards correctly and completely first!
I asked the question of why people were afraid to learn javascript and you responded indicating that it's a sub-par language and their fears could therefore be justified. So far I don't see any concrete examples / reasons as to why it is sub-par. The examples you've provided are the fact that it's being poorly used, but they have no bearing on the language itself.
Hmmm...JS is obviously a scripting language in a browser environment. If JS is sub-par then it is purely because of the browsers. ECMAScript is a fine language. JS in FF is superb like I said.
Someone made a point about how that all AJAX should degrade. Was it 98%? Hmm
Anyway what I want to say is that: a lot of development shops would greatly relish the idea of not having to write JS that degrades. Yeah, you've got to do server-side validation and other stuff server-side for the purpose of security but completely degradable JS implies that you write everything twice, in two different languages.
In my tickers with JS I did this: In fact I can show you on my horribly out of date website portfolio. Click the images or use the arrows and JS caches the next and previous image making it seem very fast. You can look at the source, it wasn't very difficult to write. Then disable JS, refresh the browser and the portfolio continues to operate with PHP.
So yes it is degradable, and yes I'm glad I did it, but it did mean I had to write it twice and took (almost) double as long. Someone running a business would seriously have to consider the baseline of doing such a thing. When you have a project estimated at 200 manhours are you really prepared to almost double it for degradability? Faced with that decision I would have to go the 90% server-side with JS sprinkles route, which is how I've always done it. Interestingly, that usually at doesn't involve any AJAX.
This might be a dumb question, but along with my other question above Ole's responses, can javascript be hidden(i know it can from old browsers) but is there a way beside include a .js script that you can hide your code? I know javascript can scramble source code(at least I was under the impression it could, by scramble I mean encode by some means) any ideas?
You know how you can view source code and see JS, I was just wondering if there is anyone to completely block that, I imagine there is I just don't know it.. Maybe put some sort of CHMOD block on source code(probably wrong)? But if not that something like it?
No.
JavaScript is executed on the browser, which means the browser has to be able to see it. Like any other data, the second it leaves the server you have no control over it, really.
basically, frameworks are a set of code that attempts to organize & simplify the most common components of application architecture, so you don't have to write it over and over every time you build an application. Things like session handling, page controllers, form handling, etc. are usually encorperated into a framework
The majority of them are completely object-oriented.. so you need to understand OOP concepts first. I recommend Zend Framework... although it's not finished yet, I really like it a lot.
The Ninja Space Goat wrote:The majority of them are completely object-oriented.. so you need to understand OOP concepts first. I recommend Zend Framework... although it's not finished yet, I really like it a lot.
I agree with that
Although I haven't tried any of the others. I've heard that cake is radically different.
Well, i've been thinking about this quite often the last couple of years.. And i guess i can live with JavaScript on the web.. As long as it's done well... Throughout the years i've found this article about unobtrusive Javascript an very good starting place to do it well