Opinion poll.

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.

Moderator: General Moderators

With AJAX's possibilities, is learning javascript a nessesary evil for the programmer of our day?

Yes
10
77%
No
3
23%
No, but this is. (list what is on forum)
0
No votes
 
Total votes: 13

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Sorry triple post, just remembered this and sorry again, its a PDF.
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What do you mean by hidden?
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

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?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.

Keep the comp.lang.javascript FAQ handy for all your JS questions.
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

:( i didn' think so..

Thanks for the response Ole.

Do you know (in php) what exactly are the frameworks(cakephp) and others like it, when does one implement them, and what do they do?

Thanks for anyone who knows the answer.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

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
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

Oh sweet, thanks for the explaination Ninja, I hadn't a clue.

I'm sure I have no need for it with my minimal skillset, but when I do require one would you advocate any one over the others?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

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.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

As far as Zen network is concerned, do I need to pay for that? or any framework for that matter. I know Cakephp is free, or so says the site.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

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 :)
Post Reply