Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Talking effectively about code

332 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Talking effectively about code

  1. 1. Talking effectively about code Peeling the onion with minimum tears ! ! Poornima Venkatakrishnan
  2. 2. ! ! ! • Buddy coding • Peer reviews • Technical presentations
  3. 3. Organize your thoughts… • Context: What is the problem you are trying to solve • Design: What do you understand about the existing system • Impact: What moving parts do you think the change you are making will affect
  4. 4. Deep Dive! Explain : • What you are trying to accomplish • Moving parts that are impacted • your changes/ proposal (top down approach) (+/-) • Parts that you don’t understand as you understand it.
  5. 5. Example: Content shows up in development mode but does not in production mode. • Context: Want to be able to translate some service data in the controllers before rendering a view. • Design: App, Service wrapper, Makara • Impact: Need to add the content into data that is fed into res.render(view, data), so it will impact just the rendering of that view. • Problem: Sometimes the content was missing when page rendered…. and the problem was incorrect handling of async.
  6. 6. iff you are curious … //in the controller server.get('/bar', function(req, res) { async.waterfall([ function reqDataFromService(next) { //....... ! ! }); ! ! req.data = serviceData; next(); ! ! }, function translateServiceData(next) { mapContent('propFile', req); next(); } ], function() { //..... res.render('barView', req.data); }); function mapContent(file, req) { //....... ! //in the controller server.get('/bar', function(req, res) { async.waterfall([ function reqDataFromService(next) { //....... content.loadContentBundle(file, locale, function(err, bundle) { if (!err) { var bundleRoot = bundle.get('foo'); req.data.bar = bundleRoot[req.data.bar]; } ! }); ! ! req.data = serviceData; next(); }, function translateServiceData(next) { mapContent('propFile', req, function() { next(); }); } ], function() { //..... res.render('barView', req.data); }); function mapContent(file, req, cb) { //....... ! ! content.loadContentBundle(file, locale, function(err, bundle) { if (!err) { var bundleRoot = bundle.get('foo'); req.data.bar = bundleRoot[req.data.bar]; } cb(); }); } }); }
  7. 7. Keep it simple
  8. 8. Rules of thumb • If you are asking: Say more • If you are answering: Ask more • If you are presenting: Simplify
  9. 9. Lost in translation ? ! ! ! ! • Best unifying language is the programming language • Share your code to demonstrate what you are trying to do…. easy!!

×