Sohan's Blog

Things I'm Learning

Care Driven Development: Javascript

There is * Driven Development, where they listed “all possible thing” driven development and dedicated a whole website to it! Well, I am adding one more to the list, “Care Driven Development”, with an emphasis to Javascript coding.

Javascript coding, do you care enough?
CSS is the most hairy spagetti piece of almost any web project. And its not leading by a far distance to it’s first cousin; Javascript. But, the good thing is, it just takes a little care to clean the bush out of Javascript and make it pretty.

Do you care enough not to use the following ever again?

  • $(‘#deep_under_the_ocean’).parent().parent().hide()?
  • $.ajax(url: ‘bank_accounts/transfer_money’, amount: 500…)
  • $(‘#eiffel_tower’).height($(‘#paris’).height() +  $(‘#eiffel_tower base’).height() + $(‘#eiffel_tower tower’).height() + …)
  • populateNewYork(‘east’, ‘north’, 50, 100, 23, …)
  • $(‘.shark’).click(function(){$(‘.small_fish’).attacked(function(){…})})
  • parseInt($(‘.selected’).id().split(‘-‘).last())
I am compiling a list of such careless JS coding examples and this is just a start. If you have a few to add to this list, please keep sending!