[yast-devel] JavaScript.code_quality <> Ruby.code_quality

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@suse.de> 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@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

On Thursday 27 August 2009 11:38:42 J. Daniel Schmidt wrote:
Somehow this feels strange. Focussing on good code on the one side but forgettig about it on the other.
But if checks do not happen automatically or unless we know what makes something high quality and what makes it low quality there is nothing concrete to do about it. If there is a better implementation of that browser check, we can exchange it (I still would require that if it depends on anything, that should be jQuery) -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org

* J. Daniel Schmidt <jdsn@suse.de> [Aug 27. 2009 11:38]:
There's still a difference between writing code oneself and including upstream code ;-) iirc, the browser test was written by someone else who, apparently, didn't have TestSwarm. Btw, TestSwarm (http://testswarm.com/) is open now: http://ejohn.org/blog/test-swarm-alpha-open/ Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (3)
-
Duncan Mac-Vicar Prett
-
J. Daniel Schmidt
-
Klaus Kaempf