Mailinglist Archive: yast-devel (246 mails)

< Previous Next >
[yast-devel] JavaScript.code_quality <> Ruby.code_quality
  • From: "J. Daniel Schmidt" <jdsn@xxxxxxx>
  • Date: Thu, 27 Aug 2009 11:38:42 +0200
  • Message-id: <200908271138.43397.jdsn@xxxxxxx>
Hi WebYaST hackers,

Yesterday I fixed this JavaScript browser detection bug:
https://bugzilla.novell.com/show_bug.cgi?id=529931
and just wanted to tell you my observations.

We spend a lot of time writing good, clean, DRY, easily readable ruby code and
even have tools like Flog, Flay and Heckle(1) to check its quality. All this
is great, sure.
But on the other hand we just dump JavaScript code into the users browser to
do some magic but don't care for quality there.

The bug above was just 4 tests if a variable had a value.
Here's a diff snippet:

- window.G_vmlCanvasManager.init_(document);
+ if (window.G_vmlCanvasManager) {
+ window.G_vmlCanvasManager.init_(document);
+ }

My JavaScript debugger(2) still gets flooded with warnings about the code that
we run in the users browser. So there might arise other stuff in the future.

Somehow this feels strange. Focussing on good code on the one side but
forgettig about it on the other.


(1)
http://ruby.sadi.st/Ruby_Sadist.html

(2)
Web Developer plugin for Firefox:
https://addons.mozilla.org/en-US/firefox/addon/60
I also recommend Firebug:
https://addons.mozilla.org/en-US/firefox/addon/1843


Ciao,
Daniel

--
J. Daniel Schmidt <jdsn@xxxxxxx> SUSE Linux Products GmbH
Research & Development Maxfeldstr. 5
GF: Markus Rex, HRB 16746 (AG Nürnberg) D-90409 Nürnberg
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >