Couldn't say it better than Web Teacher so I won't bother:
Head First JavaScript by Michael Morrison (O’Reilly, 2008) may not ring up five stars for everyone, but I like the Head First books
so much so that it'll be going on my "strongly recommended" (short) list of core texts for "Web Technologies" next year.
Tuesday, February 12, 2008
Head First JavaScript (O'Reilly)
Friday, February 08, 2008
Thursday, January 17, 2008
Hallelujah
I'm totally with this RYS post:
I love (platonically, you understand!) the student that works and deserves the grade they get, even if they're not the most academically gifted (there's a real thrill in working with the student who suddenly "gets it" after some hard graft). I do my damnedest, & consider it my job, to make sure that they all get the grade they deserve, includingNot all students act horribly...and it's those students I worry most about. When Paula Plagiarist gets a C because she whined to a faculty-hating administrator about her F, what does that do to Marvin Mediocre who actually earned his C by performing with a basic level of competency? When Big-Mouth Barry bombs a class, bitches his way through a grade grievance and is awarded a C just to go away, what does that do to Sally the C-Student, who had some health problems and earned a C because she came to the final exam with a sinus infection?
- Whining William and his endless set of excuses,
- Cheating Charlene and her group of plagiarists who paid "some bloke off the internet" to do their project,
- Loophole Larry who thinks that exerting effort getting around the regulations is academically-equivalent to doing the work,
- Mike the Muppet whose idea of catching-up after a prolonged (genuine, mit. circ. style) absence is to copy a pile of work off the internet etc.
Bare-faced cheek
Today was final assessment day for this year's Web Technologies module: A Questionmark Perception test and short JavaScript assignment. Sadly the start to the test malfunctioned and I was forced to remove the Blackboard setting that restricted students to one attempt at the test. Happily Perception gives easy access to all attempts by every student (something Blackboard does not, easily anyway); unhappily, in hindsight, I should have restricted them to a few attempts rather than unlimited...
Amusingly, one student assumed I wouldn't check and he used this lapse to attempt the assessment over-and-over until his time ran out, utilising the fact that the assessment showed the marks to gain an unfair advantage. Happily I did check and so we'll be enacting the relevant part of the "Cheating in Assessment" regulations on his behalf. What a waste of time!!
And the bare faced cheek
? He had the chutzpah to complain at the end of the test (before I'd discovered his perfidy) that he'd arrived late & unfairly lost time. This fell on my unsympathetic ears -- no good excuse => no extra time. Tough monkeys! But cheeky, nonetheless...
Wednesday, December 05, 2007
JavaScript tips
You know how occasionally you read a tip and have a "wow" or "lighbulb" moment? Well, this collection of seven JS techniques from Dustin Diaz contained six such events for me (seriously: I read them over several days and had a "ding!" moment from all six code tips -- nice!)
Wednesday, November 28, 2007
Possum Death Spree!
they've been frozen in the permafrost ... now global warming has set them freeand:
- Dying cop:
They killed the dinosaurs?
- Handcuffed scientist-guy
No, they killed half the dinosaurs; they made the other half watch!
Wednesday, November 21, 2007
@media AJAX 07 final thoughts
It was a great conference, with a good mix between "techy" and some "designy" stuff from some really world-leading presenters. Well done Patrick :-) If I can get the funding I'll be back for @media 2008.
(& my reason for the over-long, verbose summaries of the talks was to give some flavour of the conference to my students.)
@mediaAjax day 2.6: Wrap-up discussion panel
The final session of @mediAjax was a discussion panel, starring Brendan Eich [BE], Stuart Langridge [SL], Alex Russell [AR] and Douglas Crockford [DC], ably chaired by Jeremy Keith (so Patrick & Jeremy made up, which is nice) and it ran with JK posing questions submitted by the audience and moderating the discussion:
- Mobile & JS:
- [Nobody mentioned Cameron Moll-style mobile user-centred design.]
- Not much impact other than [BE] report from Opera regarding eBay, use of
evalfor self-modifying code and its impact on battery life. - Libraries:
- No consensus other than [SL]
use what works with you/your team
and use libraries to level the DOM playing field. - WCAG2 & JS?
- Dojo and ARIA are interim measures.
- Standardise libraries?
- Not necessary but combine forces for a common voice.
- Can JS ever be secure?
- [DC] No, we need a secure dialect, but there are things we can do to help.
- [BE] Things like mashups are the killer problem & there is no silver bullet.
- [AR] Google Gears, "trust domain", Open Ajax Alliance.
- [BE] Gears' "worker pools" excellent & might end up in Firefox.
- [AR] Must remember that in life
risks are mitigated not solved
, only Internet gives the false impression that it’s 100% solvable. (Mentioned "Capability Models"? see "Confused deputy" by Norm Hardy.) - JS2 = Java?
- [BE] No, JS2 class is for integrity not Java-like object model. JS2 is not fixed & they’d welcome feedback but class & receive/dispatch methods are needed.
- [DC] Standpoint is don’t add syntax.
- [AR] All of the toolkits do this stuff so JS2 should follow if it’s needed.
- Is proprietary a hindrance? (Silverlight, Air, Flash, Gears?)
- [AR] If the
text on the wire
is lost, lots of collateral benefits will be go (spidering etc.) - [BE] Tension! Proprietary gives better control but Open Source encourages competition, both benefits.
To be honest, the discussion panel was a bit disappointing and JK rounded it up with a bland "we've made progress from the WASP DOM Task Force days", but it was a tough conference to sum-up and there were obvious tensions between the panel-members.
I guess they needed my special question so it was a shame I'd not gotten around to asking it! Here it is: What skills do employers of web developers want in graduates? What should educational institutions teach for workers in the modern web? Comments welcome...
@mediaAjax day 2.5: JavaScript: The Good Parts
Douglas Crockford's title and opening remarks were complimentary to JS, emphasising that there are very good parts to the language, as evidenced by the range of users, from computer science graduates to cut'n'paste coders. JavaScript is succeeding in an environment where Java failed.
Good things include prototype inheritance, 1st class functions (lambda) and loose typing. Closures work because of lambdas and garbage collection and is the best thing in programming languages
.
Bad things are:
- globals (particularly user-defined and overwritable)
- semicolon insertion
typeof object==typeof array==typeof null!- with/eval
use of eval is a cry for help
phony arrays
(performance)- type coercion (==)
- too many negatives (
null, undefined, false, NaN) why? E.g.object[name]==nullis commonly used but gives false +ve with0, null, ''property values – must useobject[name]===undefined. - C heritage, optional braces + permitted empty statements.
- Use of IEEE floats whereby 0.1+0.2 !== 0.3
- Dense constructions like ++ and –-
- Switch/case fall-through
new– forget it and assignments overwrite the constructor
These are mainly things that can have disastrous consequences from minor typos but oftentimes seem useful.
Advocated JSLint.com and the professional subset
of JS that it permits but warned JSLint will hurt your feelings
and unlearning is hard
.
Style isn’t subjective
, e.g.return {
ok: true
}
vsreturn
{
ok :true
}
;-insertion means the second returns null, ok is a label and produces no syntax error and the braces wrap an empty statement that does nothing but is permitted…
Douglas’ perspective is to make JS more like JS should be
. Deprecate the worst features, don't break the syntax, keep it simple, keep it safe
(a subtle LOTR reference ;-). Add JSON.stringify, JSON.parse, safe/restricted eval, add a "don’t enumerate" flag to objects, no experimental features
(hard to remove), no radical changes & no new syntax. More languages: two small languages are better then one large language
.
More security but that would break current JS syntax. JSLint "ad safe" mode c.f. Google Caja (Caja allows this; JSLint does not.)
(This is a long post as lots of it was using notation I'm familiar with, hence my notes were legible and concise, but personally I'm with the JS2 pack: I teach students who learn Java first so if I can use Java-like syntax, so much the better, but DC's arguments are worth paying attention to.)
@mediaAjax day 2.4: Dojo 1.0: great experiences for everyone
The enthusiasm of Alex Russell, the speaker for the fourth session of the second day of @mediaAjax, was apparent instantly -- he spoke almost continuously, rapidly and coherently for the full hour of his talk: quite an achievement! He opened by listing "Maslow's hierarchy of needs" and relating them to the web, but there was so much new information contained in this part of his talk that I couldn't take it all in. I did remember a few choice quotes, such as:
The idea that we'll continue to limp along using Java is laughable given languages like Python, Ruby, Erlang
Not caring that it's broken is our best weapon on the open web... if we had to care about everything that was broken we'd never get anything done.
The HTML/JS/CSS stack is wickedly hard to learn
(because of bugs and interactions -- the basic stuff was easy for basic sites in the 1990s).HTTP is one of the best things to happen to mankind … compound interest, penicillin, the wheel and HTTP!
LOL!- And the most important for understanding the rest of his talk was:
Good semantics allow you to say what you mean and get what you want.
(But at the moment we only have one or the other -- HTML/CSS are currently liabilities, e.g. menu, tree, video, column...)
As for Dojo, the mantra was "build with (dojo), not on", which I hope I remember correctly was meant to imply that there Dojo team want to work closely with developers, and developers, so is the talk it doesn't do what you want then ask!
Dojo's approach is obviously different from jQuery, not only because they supply widgets and are committed to accessibility (whereas jQuery is low level and leaves the consideration of accessibility to the developer), but also in action because they use custom attributes within the HTML markup. Alex gave as an example a simple lightbox widget that used something like the following markup:
<img src="img1.png" dojoType="dojox.image.lightbox" group="a" />
<img src="img1.png" dojoType="dojox.image.lightbox" group="a" />
which Dojo and converts into a lightbox slideshow.
Alex also emphasised their commitment to WAI ARIA "states and roles", their enthusiasm about HTML 5 and how they look forward to browsers implementing HTML 5 so that they can ditch all of the extra code that it would make redundant.
(It was a great talk but information-packed talk and I'm sure I've missed stuff...)
