OU blog

Personal Blogs

neil

JavaScript

Visible to anyone in the world

After my sad and dreadful crap-out on Saturday I've lain low for a few days. I'd like to say that I've rested but alas my work commitments haven't allowed me much rest. So I did the next best thing—made myself much rice & beans, read a few Jeaves and Wooster novels, tried to get my work life into some type of order and started coding JS again.

We'll deal with said JS stuff here.

I've been working on my testing stuff, progress has been a wee bit glacial, but I think that I've got something done.

The main problem is that JS has a lot of functions that aren't strictly functional, they are the equivalent of IO. How do you run unit-tests on an addEvent function. Or a whole series of these functions interacting?

I think that I can see a way to do this [fireEvent() figures prominently I'm afraid], but I'm going to have to think about this. The main thing that I'm going to have to think about is: do I want to make this for just me, or to be potentially useful to others?

This is a somewhat theological thing—I wanted to take [my?] JS in the direction of Java or C++, where we test things at compile time rather than using reflection at runtime. But I haven't got clue one about the right mix yet.

[Strangely I intensively dislike reflection in Java but I'm more than happy to pseudo-overload etc. in JS.]

There are hard choices to be made here, and whatever choices I make will be wrong for some people. Still it's nice to be faced with them.

Permalink Add your comment
Share post

Comments

ROSIE Rushton-Stone

New comment

Hi Neil,

I think I must have missed your crap-out (sorry).  I'm very pleased you've, erm, crapped-in again? 

Take care, g'night, Rosie

New comment

Hey Neil

Glad you've come through.  Sorry I can't make a comment on the technicalities of your blog comment as I don't have a clue, so it all sounds wonderful to me, and I'm sure it is smile.

Sue

New comment

What Susan just said! smile

New comment

Hi Neil,

I was reading lately about Brendan Eich of Netscape, when he created JavaScript during the browser war days. According to Mr. Eich at least, once you know this language stuff (that's a technical word in programming!), it makes you a better programmer, and you seem to be heading that way what with reflection and all.

regds,

Patrick

neil

New comment

@patrick, learning javascript is something that you should do, but learn it well. You'll need books, here are mine:

  1. The definative
  2. The good
  3. Those who would make it something else of it.

Take care.

@all

I think that I might be recovering, doctors may not be needed...

neo

ROSIE Rushton-Stone

New comment

big grin

New comment

Hi Neil,

have bookmarked all three books on JavaScript, thanks!..just finished MS221 and M255, waiting on results to see if I'll have to resit any exams, just hoping for a pass in MS221, that'll do me fine, but I can honestly say (despite the work) I have enjoyed all the introductory maths courses, and M150 (Data, Computing and info, where we did elementary JavaScript). taking a year off, but looking forward to still reading your (real/nonOU) blog while I am away.

regds,

Patrick

neil

New comment

@patrick

I'm not, and you should be aware that this is religious  issue [with a small r] and would attract multiple flames on regular .comp fora.

I have my views. What's been really good about studying at the OU is that I can now put these views in a way that other programmers can understand. I could be right, doesn't matter if I can't speak the lingo, probably wrong though.

You'll be ok with your exams. Despite being a techie who despises technology I'm essentialy a shamen so I know how these things play out. wink

You take care.

arb

neo