Ok nerds, get me up to speed on the new web tech. - by SubJeff
Al_B on 29/3/2011 at 21:45
Quote Posted by deathshadow
You'll find I'm a bit opinionated on the subject
No kidding.... but I actually agree with you on many points (a few I don't are below). There are many bad practices on the internet (particularly code examples in my experience) but ultimately, you need to start somewhere to get a general foundation before being able to understand the full context.
Quote Posted by deathshadow
The only thing you can learn from jquery is how not to program javascript. It's also not jquery OR javascript, since jquery IS NOTHING MORE than a fat bloated convoluted steaming pile of manure javascript library.
This, is probably the biggest point I disagree with. Yes, it's easy to get sucked into adding more and more plugins without thinking about what you're doing, but that isn't a problem with the library itself. Being able to reduce the number of browser hacks you need to employ is a
major advantage. Heck, you need to (
http://blog.coderlab.us/2006/04/18/the-textcontent-and-innertext-properties/) go through hoops just to change the text of an element on your page. That's not a flashy animation effect or something that you can do with CSS.
Using jQuery doesn't have to lead to massive webpages either. Use a CDN and the core library is probably cached on your computer anyway.
Quote Posted by deathshadow
... and in all three cases you can usually write a smaller/more efficient/faster javascript without it.
I've never noticed any slowdown from using it - but I don't change thousands of elements at once. In my experience there are far bigger fish to fry such as optimising server-side delivery and database interactions.
Quote Posted by deathshadow
Oh, and some advice on tools... If you need ANYTHING more complex than a flat text editor, you've already screwed the pooch.
The one thing a pure text editor won't give you is the ability to debug server side code. Client side javascript can be debugged with firebug reasonably well in Firefox (my preference for development when coupled with other plugins such as (
https://addons.mozilla.org/en-us/firefox/addon/web-developer/) Web Developer and (
https://addons.mozilla.org/en-us/firefox/addon/html-validator/) HTML Validator. I haven't found an ideal server side debugger, however (at least for PHP) so I'm being slightly hypocritical for bringing this point up.
Quote Posted by deathshadow
For uploading, use filezilla -- SERIOUSLY. Do not trust the FTP built into some crappy IDE/RAD, do NOT waste your money on "smartFTP" or any other client. Filezilla is free, compatible, efficient -- What more do you need?
Proper version control. For starting out or very small projects using FTP (SFTP or similar for preference) uploading files manually is fine. However, don't knock being able to use version control software you can synchronise between your development machine and live system. It makes it much easier to deploy and roll-back if necessary.
Quote Posted by deathshadow
You don't even need to waste $$$ on a graphics program.
Not disagreeing (at all) but in addition to your recommendations, it's worth checking out (
http://inkscape.org/) inkscape and (
http://www.getpaint.net/) paint.net. Neither are perfect. I've known the former can crash a little too often on modern systems and the latter is definitely underpowered compared to the gimp. However, both have their place and are perfectly decent.
SubJeff on 29/3/2011 at 22:59
Well I'm already keen on separating content and presentation, I don't like tons of fancy crap on the page, I already use syntax highlighters (I have Notepad+ and HTMLBeauty), FileZilla and GIMP.
The only thing I do that you may not agree with, deathshadow, is CSS + divs for layout. I like having a title div (with the title, home link and perhaps a few other links) a "nav" div with my site wide menus (implemented with PHP or JavaScript if I have no PHP) and a content div for the main site content.
And sometimes I like using a JavaScript to allow content switching thus:
Code:
function change(name){
var formArray = new Array(
"form0",
"form1",
"form2",
"form3",
"form4",
"form5",
"form6"
);
for (var i=0; i******Array.length; i++){
if (formArray
== name){
document.getElementById(name).style.display='block';
}
else{
document.getElementById(formArray).style.display='none';
}
}Yes, I know you can't use the back button but it's a simple way to allow users to flip between small bits of info. I'll probably sack it off for some Ajax when I get around to it.
Going back to Java - I'm about halfway through "Teach Yourself Java in 24hrs" and I've been reading about
extends when creating object inheritance on the web. What's the deal with this "extends is evil" crew?
addink on 30/3/2011 at 07:58
Quote Posted by Subjective Effect
Yes, I know you can't use the back button but it's a simple way to allow users to flip between small bits of info. I'll probably sack it off for some Ajax when I get around to it.
Ajax won't fix the back button issue, ajax just allows you to get fresh data of the server without a page refresh. The back button issue can be solved by using the hash of the location for keeping track of which dynamic content is to be shown.
deathshadow on 30/3/2011 at 08:02
Quote Posted by Subjective Effect
The only thing I do that you may not agree with, deathshadow, is CSS + divs for layout.
I don't mind DIV when they serve a purpose -- like a content area wrapper, a sidebar wrapper, a footer wrapper... a page wrapper since you can't trust setting width on body -- etc, etc... Grouping tags together...
I just dislike when it's slapped around a H1 for no good reason, or around a UL (like the menu) for no good reason -- you've already got a perfectly good SEMANTIC block level container, what's the extra div for? So often I see people open five or even ten DIV before they even get to actual content -- on a page that just needs one DIV followed by a H1.
Quote Posted by Subjective Effect
And sometimes I like using a JavaScript to allow content switching thus:
Miserable accessibility /FAIL/ -- not only as you mentioned does in neuter the back button, it prevents people from direct linking to the sub content, depending on the complexity of the script can prevent search engines from seeing that content, screen readers will have no clue what's going on, and have you tried that stuff on a handheld?
Much less all the people who don't have javascript, or even don't WANT javascript. (see all the folks who downloaded the 'noscript' plugin for FF). If you are going to use scripting, Include a way to do the same thing when scripting is not present -- otherwise /FAIL/ at the point of javascript for most things; enhancing functionality, NOT supplanting it.
You know -- progressive enhancement gives graceful degradation?
Buddy of mine called Ajax the new framesets -- he wasn't joking, and no, that wasn't a compliment either. For every useful Ajax application (google maps, google docs) there are hundreds of miserable accessibility /FAIL/ filled with bloated pointless "scripting for nothing"... see how most EVERY online mail client (gmail, hotmail, yahoo) are flushing themselves down the toilet with crap that takes MORE bandwidth and doesn't work as well as the old half-assed HTML 3.2 they were using a decade ago... and yet have SOMEHOW convinced themselves it's more efficient. RIGHT.
AJAX for nothing and your scripts for free, that ain't workin', that's NOT how you do it. Lemme tell ya, these guys ARE dumb. Maybe get a blister on their typing finger, maybe get a boil on their bum. We got to install Debian Linux, custom server, delivery... We got to config postfix and apache... we got to config php....
I want my, I want my, I want my PHP...Quote Posted by Subjective Effect
Going back to Java - I'm about halfway through "Teach Yourself Java in 24hrs" and I've been reading about
extends when creating object inheritance on the web. What's the deal with this "extends is evil" crew?
Not sure since all I know about Java is I'm not DUMB ENOUGH to even allow that buggy security-hole inducing pile of manure to be installed in the first place -- but if that's anything like "extends" in other object oriented C family languages I don't know where the "evil" part would come into play -- extensibility, commonality and re-usability is the POINT of using objects!
Though with people now slapping EVERYTHING in objects for no good reason like it was a sick fad... (even when it's a total waste of code) I'd not be surprised if you can put "extend is evil" into the "I can't figure out how it works so we have to demonize it" category.
Though honestly, trying to use objects in any C legacy language drives me batty... My bad for learning Smalltalk, Modula and Object Pascal FIRST... you know, where objects make SENSE?
SubJeff on 30/3/2011 at 08:52
Quote Posted by deathshadow
Miserable accessibility /FAIL/ -- not only as you mentioned does in neuter the back button, it prevents people from direct linking to the sub content, depending on the complexity of the script can prevent search engines from seeing that content, screen readers will have no clue what's going on, and have you tried that stuff on a handheld?
Much less all the people who don't have javascript, or even don't WANT javascript.
Works fine on every handheld I've seen my stuff on. I only use this script for small amounts of info, like instructions, never for entire pages of content. And I'm not a fan of the "what if they don't want javascript?" pov since there is no reason to have it off apart from "I want". Might as well ask "what if they don't have a new browser?" or "what if they don't have a computer huuurr?".
Quote Posted by deathshadow
Not sure since all I know about Java is I'm not DUMB ENOUGH to even allow that buggy security-hole inducing pile of manure to be installed in the first place
Show me the non-"dumb" way to create Android Apps then.
PS. Regarding Java and JavaScript. As I said I'm only halfway through this book. Am I correct in thinking that classes in Java are essentially functions in JavaScript?
Al_B on 30/3/2011 at 18:48
Quote Posted by Subjective Effect
I only use this script for small amounts of info, like instructions, never for entire pages of content. And I'm not a fan of the "what if they don't want javascript?" pov since there is no reason to have it off apart from "I want". Might as well ask "what if they don't have a new browser?" or "what if they don't have a computer huuurr?".
As deathshadow says the problem is "accessibility". If someone is blind and using a screen reader I'd assume (not having used one) that it will make it a nightmare to navigate the content driven by javascript.
However, I've used a similar technique in places myself for things such as providing small instructional text which can make a page more cluttered if present at all times. My approach has been to make all content available and visible by default. Then, using javascript when the document has loaded the elements I don't want visible are hidden. People without javascript, search engines and screen readers will have no problem seeing the content.
Quote Posted by Subjective Effect
Am I correct in thinking that classes in Java are essentially functions in JavaScript?
Hmmm... they're not
equivalent in any sense of the word and if you'd asked, for example, if they were equivalent to functions in C then you'd be way off the mark. As javascript supports closures you can simulate some aspects of traditional classes but they're very different animals.
How much object orientated programming experience do you have? If you've not had much then a general introduction would be beneficial. I agree with deathshadow that not
everything should be an object but used correctly they can make code much more manageable.
addink on 30/3/2011 at 19:18
Quote Posted by Al_B
As deathshadow says the problem is "accessibility". If someone is blind and using a screen reader I'd assume (not having used one) that it will make it a nightmare to navigate the content driven by javascript.
Screen readers for the blind have long been able to run javascript. That the official standards for accessibility still require a scriptless page, has more to do with structuring information, making sure that even without styling and dynamic behavior the page content makes sense. The cool -and not unimportant- 'side effect' is that the generally script-inept spiders/crawlers of search engines can make more sense of the page.
Al_B on 30/3/2011 at 19:48
That's interesting - have you had experience of using them yourself (I'm genuinely interested)?
My thoughts were not whether they'd be able to trigger javascript but whether the page location of the content that is dynamically shown would make sense to a screen reader. I did work for blind people years ago who used DOS application screen readers (for things such as Wordperfect) and although they worked they could be frustrating at times. I dread to think what they're like these days with advert ridden, complicated, dynamic web sites.
(Actually - I should just try one for myself...)
SubJeff on 30/3/2011 at 20:19
Tbh nothing I'm ever going to make is going to be any use to blind people. And if I did I'd make it as simple as possible without any scripting or flashiness just in case.
addink on 30/3/2011 at 20:43
Quote Posted by Al_B
That's interesting - have you had experience of using them yourself (I'm genuinely interested)?
No, five years ago I worked on a large online shop that we were converting to a single page interface enhanced by javascript and ajax if available. There was a blind guy that did all the accessibility testing for that site, he basically said that all the official requirements to get the site certified as accessible were horrendously outdated and that his screen reader would happily process javascript.
However, since his input was still basically one line (or a few - I don't remember) at a time, keeping the structure of the content of the page as simple as possible would be beneficial.
One thing I try to do ever since, is see what the page will look like with all the styling removed. That gives a rough impression of what the screen reader will
show read.