<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Shyam &#187; shyam</title>
	<atom:link href="http://theshyam.com/author/Shyam/feed/" rel="self" type="application/rss+xml" />
	<link>http://theshyam.com</link>
	<description>Ramblings from the Real Shyam; You know, unlike those other fake Shyams!</description>
	<lastBuildDate>Sun, 08 Jan 2012 13:07:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Gastronomic Mumbai Journey</title>
		<link>http://theshyam.com/2012/01/a-gastronomic-mumbai-journey/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-gastronomic-mumbai-journey</link>
		<comments>http://theshyam.com/2012/01/a-gastronomic-mumbai-journey/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 13:07:53 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Food]]></category>
		<category><![CDATA[copper chimney]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[koolar]]></category>
		<category><![CDATA[mumbai]]></category>
		<category><![CDATA[restaurants]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=348</guid>
		<description><![CDATA[I was in Mumbai from Jan 1st till the 5th this year, right after a crazy New Year&#8217;s eve at ISB. The fact that I barely made it to Mumbai is a story in itself, but this is not about it. This time in Mumbai, I decided to track every single meal I ate out [...]]]></description>
			<content:encoded><![CDATA[<p>I was in Mumbai from Jan 1st till the 5th this year, right after a crazy New Year&#8217;s eve at ISB. The fact that I barely made it to Mumbai is a story in itself, but this is not about it. This time in Mumbai, I decided to track every single meal I ate out (and some at home), and I realized what an awesome epicurean journey I embarked on.</p>
<p>What followed was four days of varied, awesome and delightful (if somewhat filling) meals, which I have faithfully catalogued. And so I wanted to share some of the awesomeness, and the places where you could find the same if you were ever in Mumbai. Each and every place comes highly recommended!</p>
<h2>Koolar &amp; Co.</h2>
<p>Known to many people just as &#8220;That Irani Cafe at the corner of King&#8217;s Circle, Matunga&#8221;, Koolar is an artifact of times gone by. A quaint little corner cafe at King&#8217;s Circle, it is an Irani Cafe to beat all Irani Cafe&#8217;s. The decor is early 20th century, with newspaper clippings of the titanic and what not gracing its walls. A few small tables and even more uncomfortable chairs grace the place, with nary a place to squeeze by to get to those last few spots&#8230; But despite all this, it has a cozy feel to it.</p>
<div id="attachment_355" class="wp-caption alignleft" style="width: 235px"><a href="http://theshyam.com/wp-content/uploads/2012/01/Outside-Koolar-misty-day-e1326009063960.jpg"><img class="size-medium wp-image-355" title="Outside Koolar, misty day" src="http://theshyam.com/wp-content/uploads/2012/01/Outside-Koolar-misty-day-e1326009063960-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">A misty day outside Koolar</p></div>
<p><a href="http://theshyam.com/wp-content/uploads/2012/01/Koolar-e1326009142485.jpg"><img class="size-medium wp-image-353" title="Koolar" src="http://theshyam.com/wp-content/uploads/2012/01/Koolar-e1326009142485-225x300.jpg" alt="" width="225" height="300" /></a></p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_353" class="wp-caption aligncenter" style="width: 235px;">
<dd class="wp-caption-dd">Koolar, from the outside</dd>
</dl>
</div>
<p>The place is famous in its own right, both due to heritage and its food. Its been featured in a bunch of movies and ads, from Vaastav to <a href="http://www.youtube.com/watch?v=S59gN7bl6As" target="_blank">Coke Ads with Gambhir</a>.</p>
<p>The menu itself has not changed in over a dozen years (and most likely more from what I have heard from regulars). Their omelettes are to die for. <strong>Two egg omelette</strong>, with onions and chillies,nicely fried over a grill and served well done on a plate. This greasy delight is heavenly, especially after for hangovers <img src='http://theshyam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . And you can wash it all down with some brilliant <strong>chai</strong> and <strong>burun maska</strong>. And if you are feeling truly adventurous (or ravenous), I dare you to try and finish their <strong>wrestler omelette</strong> (5 eggs!!!). Lip smacking food, especially early in the day as a pick me up.</p>
<div id="attachment_354" class="wp-caption alignleft" style="width: 190px"><a href="http://theshyam.com/wp-content/uploads/2012/01/Masala-Omelette-e1326009116598.jpg"><img class=" wp-image-354 " title="Masala Omelette" src="http://theshyam.com/wp-content/uploads/2012/01/Masala-Omelette-e1326009116598-225x300.jpg" alt="" width="180" height="240" /></a>   <p class="wp-caption-text">A nice, super yummy Masala Omelette</p></div>
<p><a href="http://theshyam.com/wp-content/uploads/2012/01/Chai-e1326009162786.jpg"><img class=" wp-image-352" title="Chai" src="http://theshyam.com/wp-content/uploads/2012/01/Chai-e1326009162786-225x300.jpg" alt="" width="180" height="240" /></a>      <a href="http://theshyam.com/wp-content/uploads/2012/01/Burun-Maska-e1326009187800.jpg"><img class=" wp-image-351 " title="Burun Maska" src="http://theshyam.com/wp-content/uploads/2012/01/Burun-Maska-e1326009187800-225x300.jpg" alt="" width="180" height="240" /></a></p>
<div class="mceTemp">
<dl id="attachment_351" class="wp-caption alignright" style="width: 190px;">
<dd class="wp-caption-dd">The specialty, Burun Maska! With oodles of butter</dd>
</dl>
</div>
<p>&nbsp;</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_352" class="wp-caption aligncenter" style="width: 235px;">
<dd class="wp-caption-dd">Irani Chai!! </dd>
</dl>
</div>
<p>Of course, a word of warning to people. The place is cozy, but only until you spend less than 10 minutes in the place. After that, the place is <span style="color: #ff0000;"><strong>R-Rated</strong></span>&#8230; The odds then drastically increase that you will encounter (or atleast hear from) the Parsi owner of the place. Now, if you are imagining a nice old parsi uncle who will have a word of advice or a kind ear, think again. You will encounter one of the most foul-mouthed, ever-grumpy and loud parsi owner I have ever seen or met. Your meal will not be finished before he chews out the waiter or calls out the cook, either for verbal or literal bashing. Only the Kaka, the stalwart, old-timer waiter is exempt from his wrath (You&#8217;ll immediately know who Kaka is, you can&#8217;t miss him).</p>
<p>That said, if you don&#8217;t mind an occasional loud curse (or a series of them) along with your food, or if you consider that entertainment, then Koolar is a must-try for anyone visiting Matunga or its whereabouts!</p>
<h2>Copper Chimney</h2>
<p>Ah Copper Chimney. How I love your delectable, finger licking delicious buffet. But this time, I didn&#8217;t visit the buffet Copper Chimney in Worli. No, instead, I visited the Copper Chimney in Phoenix Mills, Parel. They serve Ala carte for lunch, and what a lunch it was.</p>
<p>I went in, hungry and starving, ravenous for some tasty delights. We ended up ordering some soup, a starter that I&#8217;ll get into in a little bit, Kadai Paneer and Dal Makhani. At the end of it all, I felt like a beached whale, and had rarely felt as satisfied, fat or happy <img src='http://theshyam.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_362" class="wp-caption aligncenter" style="width: 310px"><a href="http://theshyam.com/wp-content/uploads/2012/01/CC-Masala-Roomali.jpg"><img class="size-medium wp-image-362" title="CC Masala Roomali" src="http://theshyam.com/wp-content/uploads/2012/01/CC-Masala-Roomali-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Masala Papad + Crisp Roomali Roti = ???</p></div>
<p>The first starter that arrived was the behemoth above. It was recommended by the waiter when we asked for a Masala papad and they said they had this instead. Instead of a papad, they serve the masala on a<strong> crisp roomali roti</strong>. A very interesting and delectable dish I must say.</p>
<p>This was followed by a hot, savory <strong>tomato shorba</strong>, that had little cream but awesome flavor. And of course, the main course of butter roti&#8217;s, <strong>Kadhai Paneer</strong> and <strong>Dal Makhani</strong>. Now if you haven&#8217;t heard about this before, then you really need to get out from under that rock. but Copper Chimney&#8217;s Dal Makhani is to die for. Creamy! Aromatic! Flavored just right, with oodles of makhan. I could just gorge on the dal alone for days at end.</p>
<div id="attachment_364" class="wp-caption alignleft" style="width: 310px"><a href="http://theshyam.com/wp-content/uploads/2012/01/CC-Tomato-Shorba.jpg"><img class="size-medium wp-image-364" title="CC Tomato Shorba" src="http://theshyam.com/wp-content/uploads/2012/01/CC-Tomato-Shorba-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">The savory tomato shorba</p></div>
<div id="attachment_363" class="wp-caption alignright" style="width: 310px"><a href="http://theshyam.com/wp-content/uploads/2012/01/CC-Paneer-Dal.jpg"><img class="size-medium wp-image-363" title="CC Paneer Dal" src="http://theshyam.com/wp-content/uploads/2012/01/CC-Paneer-Dal-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Dal Makhani + Kadhai Paneer + Butter Roti = Satisfied Shyam</p></div>
<p>&nbsp;</p>
<p>Of course, after that meal, all I wanted to do was find the closest bed and hibernate for the next year or two. But sadly, that wasn&#8217;t an option. But if you like great punjabi food, great ambience and just want to have a good time, Copper Chimney is something you should definitely consider at the top of your list.</p>
<p>I&#8217;ll save the other for another post&#8230; Till the next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2012/01/a-gastronomic-mumbai-journey/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Toastmasters Speech 9 &#8211; Persuade with Power</title>
		<link>http://theshyam.com/2011/11/toastmasters-speech-9-persuade-with-power/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=toastmasters-speech-9-persuade-with-power</link>
		<comments>http://theshyam.com/2011/11/toastmasters-speech-9-persuade-with-power/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 07:13:21 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[cc9]]></category>
		<category><![CDATA[speech]]></category>
		<category><![CDATA[toastmasters]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=330</guid>
		<description><![CDATA[For the last few months (ever since I joined ISB to be precise), I have been an active Toastmasters member on campus. Toastmasters is an international organization that allows people to improve their public speaking skills. They have a bunch of projects that help people do this in an organized manner. I have a bunch [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few months (ever since I joined ISB to be precise), I have been an active <strong>Toastmasters member</strong> on campus. Toastmasters is an international organization that allows people to improve their public speaking skills. They have a bunch of projects that help people do this in an organized manner.</p>
<p>I have a bunch of filmed videos, and thought I would start sharing them on my blog.</p>
<p>This one is my most recent, the CC9, whose topic is &#8220;<strong>Persuade with Power</strong>&#8220;. The aim is to convince your audience to adopt your viewpoint on a certain topic of your choice.</p>
<p>In this speech, I take up the argument that come what may, <strong>Everything will work out</strong>. The darkest of nights usually have a dawn following them. And so I provide two examples from my life when I have found this to be true.</p>
<p>Let me know what people think, and how I could have improved it further!</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/BTdUP7ZySsc" frameborder="0" allowfullscreen></iframe></p>
<p>I&#8217;ll share some of my more humorous speeches after this.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2011/11/toastmasters-speech-9-persuade-with-power/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Pyrrhic Victory</title>
		<link>http://theshyam.com/2011/11/the-pyrrhic-victory/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-pyrrhic-victory</link>
		<comments>http://theshyam.com/2011/11/the-pyrrhic-victory/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 10:16:20 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[dramatization]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[isb]]></category>
		<category><![CDATA[kitchen]]></category>
		<category><![CDATA[roaches]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=331</guid>
		<description><![CDATA[The initial skirmishes had died down. There had been a relative, uneasy peace that had been ongoing for the past two months between the two sides. I had adopted a live and let live policy for the most part, with the unsaid agreement being that they would not encroach too much. After all, the place [...]]]></description>
			<content:encoded><![CDATA[<p>The initial skirmishes had died down. There had been a relative, uneasy peace that had been ongoing for the past two months between the two sides. I had adopted a live and let live policy for the most part, with the unsaid agreement being that they would not encroach too much. After all, the place was more than enough for the three of us.</p>
<p>But then, two became three. And three became four. And four became a dozen. And suddenly, it felt as if they were taking advantage of my inherent niceness. What had gone unsaid had been spat in the mud and crapped upon. The underlying tension between us was ratcheting up!</p>
<p>But I let them be. After all, I just had a few more months left. But then, a line was crossed. It might be a very fine line, but crossed it was. My food is mine, and none others!</p>
<p>So I escalated the warfare. I signalled my intent to re-engage hostilities. A few died by my hand. But they proved resistant as well. They started advancing their troops to my dishes, my food and my microwave. I retaliated of course, but they proved hardy. They survived a full minute and a half at maximum blast of my microwave.</p>
<p>I knew then and there that this would not end well. Both sides had dug in, and were refusing to budge. Me because I was paying for the bloody space. They because they were comfortable, had nice dark places and crap loads of places to hide and procreate. But little did I knew how bad the fallout would be.</p>
<div class="wp-caption aligncenter" style="width: 410px"><img title="Those damn roaches!" src="http://i.ehow.com/images/a07/4m/cv/natural-ways-getting-rid-roaches-800x800.jpg" alt="" width="400" height="400" /><p class="wp-caption-text">Pictured Above: Them Damn Roaches!</p></div>
<p style="text-align: left;">A day before a full scale attack, I gave them one last chance. I cleared out my kitchen, removing everything from every shelf and drawer. It was my hope that it would indicate to the miniature roaches of the reckoning that was coming. It turned out to be an eerie premonition of what would be&#8230;</p>
<p style="text-align: left;">But they paid no heed. It was if they couldn&#8217;t believe I would go that far. They believed I was just posturing, that there was no bite to my bark. How little they knew&#8230;</p>
<p>And thus, two days passed, and the roaches rejoiced. They felt they had won the battle, but they did not realize the war was still left. I decided enough was enough. I was done playing the nice guy. I had decided.</p>
<p>If I couldn&#8217;t have the kitchen, then I would make damn sure that they couldn&#8217;t either.</p>
<p>In a move worthy of the great King Pyrrhus who suffered great casualties in defeating the Romans, I decided to order a tactical nuclear strike. Or something just as devastating. Complete and utter pest control.</p>
<p>The pest control guys came, and hosed and dosed my entire kitchen with a white spray. The fumes were obnoxious, but I could not help laugh manically as I could see the roaches floating down the river of white death. But as the spraying came to an end, I couldn&#8217;t help but look upon my devastated kitchen.</p>
<div id="attachment_334" class="wp-caption aligncenter" style="width: 235px"><a href="http://theshyam.com/wp-content/uploads/2011/11/PyrrhicVictory.jpg"><img class="size-medium wp-image-334" title="PyrrhicVictory" src="http://theshyam.com/wp-content/uploads/2011/11/PyrrhicVictory-e1321944154149-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">Afterwards: The Devastated Kitchen</p></div>
<p>It looked like a war zone. A war zone that had just suffered a nuclear attack, and all that was left was the nuclear fallout. I could almost see a tumbleweed blowing through my kitchen.</p>
<div class="wp-caption aligncenter" style="width: 290px"><img title="Tumbleweed through Ghost town" src="http://scrapetv.com/News/News%20Pages/Business/images-2/tumbleweed-through-ghost-town.jpg" alt="" width="280" height="273" /><p class="wp-caption-text">The Ghost-kitchen after the attack</p></div>
<p>As I stared, I wondered about the bloods of thousands (okay, maybe not thousands but 10&#8242;s?) of roaches that stained my hands. I had not killed them personally, but it was my hand that triggered the call. But then, as I ruminated over the devastation, I had a sinking feeling. I thought I had seen a slight movement in the corner, past all the liquid death that had been sprayed.</p>
<p>Could it be? There had been roaches that had survived microwaving. Could there have been one that survived the extermination? I felt a chilly breeze flow through my body, causing me to shiver. I promised that I would always keep an eye on my back, for that one roach who might have survived and is now out for bloody revenge.</p>
<p>But in the here and now, I realized, that the kitchen remained unusable. And the smell permeated through the rest of my rooms that my entire apartment had to be abandoned for a day, left out to air. It was a Pyrrhic victory at its finest!</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2011/11/the-pyrrhic-victory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can MBA&#8217;s count beyond 4?</title>
		<link>http://theshyam.com/2011/11/can-mbas-count-beyond-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=can-mbas-count-beyond-4</link>
		<comments>http://theshyam.com/2011/11/can-mbas-count-beyond-4/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 06:59:40 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=319</guid>
		<description><![CDATA[It took me 7 months to realize and recognize this. For some reason, it had never stood up and demanded its attention till I was recently slogging over the Marketing Research slide decks, valiantly trying to cram in 6 weeks of material into a two hour study session. I turned a slide. And there was [...]]]></description>
			<content:encoded><![CDATA[<p>It took me 7 months to realize and recognize this. For some reason, it had never stood up and demanded its attention till I was recently slogging over the Marketing Research slide decks, valiantly trying to cram in 6 weeks of material into a two hour study session.</p>
<p>I turned a slide. And there was one. I turned a few more pages, and yet another one. And suddenly, it was like my entire ISB life was flashing before my very eyes, smacking me with every flash with a dead fish. There was a moment of dread, of realization dawning and wondering if I had just joined a club that I could never exit.</p>
<p>It was the <strong>trap of 4</strong>. It was as if the entire MBA population, once they entered any MBA school, forgot how to count beyond 4. How else could you explain the fact that any and every graph or concept that the MBA tried to teach me could be represented by a 2 by 2 graph?</p>
<p>Need to figure out how your brand portfolio is doing with regards to your competitors? No issues. Use a 2 by 2 matrix known as the BCG matrix</p>
<p><img class="aligncenter" title="BCG Matrix" src="http://www.maxi-pedia.com/web_files/images/BCG_Matrix.png" alt="Dog, Cow, Star &amp; ?" width="370" height="288" /></p>
<p>Want to figure out if the next big idea you have is going to make you gazillions of money or not? Plot a 2 by 2 matrix with Criticality (High / Low) on one axis, and Discontentment (High / Low) on the other as follows:</p>
<p><a href="http://theshyam.com/wp-content/uploads/2011/11/CD-Matrix.png"><img class="aligncenter size-full wp-image-324" title="CD Matrix" src="http://theshyam.com/wp-content/uploads/2011/11/CD-Matrix.png" alt="" width="179" height="151" /></a>In both cases, you pick a quadrant you want to be in, and try to frame your solution to get to that point. Its an overly simplistic approach that aims at reducing the amount of clutter that we have to deal with in our &#8220;messy&#8221; realities. The buck doesn&#8217;t just stop here though, no!</p>
<ul>
<li>Want to figure out which Marketing Research question types to use? Theres a 2 by 2 matrix for that</li>
<li>Want to compare the nature of service? There&#8217;s a 2 by 2 matrix which plots degree of customization against degree of labor intensity to give you that answer</li>
<li>Want to figure out the types of people in the world? Want to figure out how to scratch an Aardvark&#8217;s back? There&#8217;s probably a 2 by 2 matrix for that too!</li>
</ul>
<p>It doesn&#8217;t stop with 2 by 2 matrices though. Ever heard of SWOT Analysis (Strengths, Weaknesses, Opportunities and Threats)? While represented in a 2 by 2 tabular form, the number of items in in is still 4.</p>
<p>The GE-McKinsey  matrix tried to be novel, unique, prove how much more awesome it is than a simple, trivial BCG matrix. What did it do? Added 1 to each dimension, to give us a 3 by 3 matrix. Literally! Thats their claim to fame! (Well, to be fair, they did change the axis from Market Growth to market attractiveness, but thats about it).</p>
<p>I keep meaning to one up them all, and come up with a 4 by 4 matrix. And then MBA students all over the globe will have a new framework to memorize, and a new person to curse to his eternal doom! The Shyam Matrix. Pure Awesomeness on one axis, and sheer craziness on the other. Deal with that, MBA students!</p>
<p>Now thinking back though, I finally realize why every single person at an MBA school goes gaga over one theory in particular. It is something that is repeatedly used in class after class once it has been introduced to the students.</p>
<h4><strong>Porters 5 Forces</strong>!</h4>
<p>Thats right. I bet the guy is famous for no other reason than the fact that he went beyond MBA&#8217;s traditionally accepted wisdom of students not being able to count beyond 4. He went and established 5 forces. Thats right! And suddenly, students found they were challenged beyond belief. It was as if they were being shown the light after spending years in mediocrity. And the 5 forces (not 4, 5!) became the single biggest rage of MBA&#8217;s.</p>
<p><strong>Disclaimer</strong>: 2 by 2 matrices can actually be useful. There&#8217;s even a book published on the awesomeness of 2 by 2 matrices (Find book <a title="The Power of 2 by 2 matrix" href="http://www.amazon.com/Power-Matrix-Decisions-Jossey-Bass-Management/dp/0787972924" target="_blank">here</a>). But still, there&#8217;s an over-abundance and over-reliance on over-simplifying concepts that might leave you over and out in the ditch. This was just an attempt to remind people of that.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2011/11/can-mbas-count-beyond-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Facebook&#8217;s next big opportunity : Analytics</title>
		<link>http://theshyam.com/2011/11/facebooks-next-big-opportunity-analytics/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=facebooks-next-big-opportunity-analytics</link>
		<comments>http://theshyam.com/2011/11/facebooks-next-big-opportunity-analytics/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 15:18:37 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[ads]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=3</guid>
		<description><![CDATA[In my current term at ISB, I am taking a course on &#8220;Leveraging Social Media and Analytics&#8221;. Very awesome and interesting course, but it also has a project where we take a deep dive into one company&#8217;s Google Adwords, Google Analytics and Facebook Ads data. Now Google analytics is brilliant at allowing users to see who&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>In my current term at ISB, I am taking a course on &#8220;Leveraging Social Media and Analytics&#8221;. Very awesome and interesting course, but it also has a project where we take a deep dive into one company&#8217;s Google Adwords, Google Analytics and Facebook Ads data.</p>
<p>Now Google analytics is brilliant at allowing users to see who&#8217;s visiting their websites, where are they coming from, what they do on it, etc. Its a very powerful tool, and especially since it integrates greatly with Google AdWords, providing a great one two punch for Google and is their big selling point.</p>
<p>Now enter Facebook, with their Ads. The biggest thing lost from FB&#8217;s point of view is data on how useful their ads are, how many conversions you get etc. This is still possible to figure out through correlation between FB&#8217;s ad data and Google Analytics. But is still a huge pain point from FB&#8217;s and FB user&#8217;s point of view. So why doesn&#8217;t Facebook offer something like Google Analytics?</p>
<p>Well, you might say, Google Analytics is the biggest one out there, and people require to put a code snippet in their websites to track usage, and they won&#8217;t do it twice or won&#8217;t take the hassle.</p>
<p>But think about this. Facebook already has their code snippets in most websites, either through their Like buttons, Share to Facebook buttons and who knows what buttons. All it takes is for them to include their tracking and analytic code snippet as part of these buttons. Suddenly, you realize that their tracking code could already be present in a gazillion odd websites, ready for analytics.</p>
<p>All Facebook needs to do is turn it on, and link to Facebook Analytics and voila : Facebook Analytics could have a huge installed base right off the bat!</p>
<p>Now this is all out there, but just a thought I had. Crazy? Logical? What do people think?</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2011/11/facebooks-next-big-opportunity-analytics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Cost of Peace : New fiction short story posted</title>
		<link>http://theshyam.com/2011/02/the-cost-of-peace-new-fiction-short-story-posted/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-cost-of-peace-new-fiction-short-story-posted</link>
		<comments>http://theshyam.com/2011/02/the-cost-of-peace-new-fiction-short-story-posted/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 16:44:35 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=312</guid>
		<description><![CDATA[Finally got some time to write over the past weekend, and to get the creative juices flowing, wrote a quick, self-contained fantasy short that I just posted in the Fiction section of the site. The Cost of Peace is my rambling on what is and is not acceptable in the pursuit of peace, and plays [...]]]></description>
			<content:encoded><![CDATA[<p>Finally got some time to write over the past weekend, and to get the creative juices flowing, wrote a quick, self-contained fantasy short that I just posted in the Fiction section of the site.</p>
<p><a title="The Cost Of Peace" href="http://theshyam.com/fiction/the-cost-of-peace/" target="_blank">The Cost of Peace</a> is my rambling on what is and is not acceptable in the pursuit of peace, and plays out as a dialogue between two characters. I deliberately left the ending open ended, to leave it to the reader to decide which way they supported.</p>
<p>Regarding my technical writings, look for it to make a comeback within the coming month.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2011/02/the-cost-of-peace-new-fiction-short-story-posted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>APIs and what not to do</title>
		<link>http://theshyam.com/2010/04/apis-and-what-not-to-do/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apis-and-what-not-to-do</link>
		<comments>http://theshyam.com/2010/04/apis-and-what-not-to-do/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:41:57 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=301</guid>
		<description><![CDATA[APIs seem to be like opinions. Everyone has one, and no two people have the same concept of what constitutes a good one. An API is supposed to be an interface that is exposed for other programs or programmers to use to interact with your code. Except, each API, like an individual, is unique with [...]]]></description>
			<content:encoded><![CDATA[<p>APIs seem to be like opinions. Everyone has one, and no two people have the same concept of what constitutes a good one. An API is supposed to be an interface that is exposed for other programs or programmers to use to interact with your code. Except, each API, like an individual, is unique with its own flaws and niceties. A great API is one which reduces the amount of code you have to write when you use it. I personally feel amazing if I can get something done with minimal code. That just screams &#8220;GOOD API&#8221; to me.</p>
<p>On the other hand, a bad API leaves you feeling dirty, unclean even, as if you are committing grave sins against nature even by just using it. Here are a few common mistakes which end up leaving that bad taste in your <span style="font-size: 13.3333px;">mouth (with examples, of course!) :</span></p>
<p><strong>Bad APIs</strong></p>
<p>These are the worst offenders, the APIs which are supposedly there to make your life easier, but just end up making it more work to use it than rewriting it from scratch. I faced one of the bigger offenders of this one recently when I was working with GWT. I was trying to create a tree structure to represent a navigation hierarchy when it dawned on me.</p>
<p>A GWT <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Tree.html">Tree</a> is created by creating a Tree object, and then creating a tree item for each node. To append children to each node, you create further tree items and add whatever text or elements you want to it. So to summarize, even if I have a data structure to represent my tree (which in most cases, I do), I will have to traverse it manually, create tree items, tell each one how to render itself and then append it to the correct items. Yuck.</p>
<p>Now consider how JFace creates a <a href="http://www.eclipse.org/articles/Article-TreeViewer/TreeViewerArticle.htm">Tree</a> (which I consider much more powerful and a nicer API altogether). You create a TreeViewer, set its data source / input. Then, you set a content provider which knows how to traverse your data object and get children / parents. You can also set a LabelProvider which tells it how to render its data elements. End result? Nice clean code that I actually feel satisfied about.</p>
<p>Most of these are the end result of rushed / not well thought out design. Having a concrete use case prior to designing it should have been enough to scream out &#8220;Its ugly!!!&#8221;. Suggestion to prevent this : write a test / use case for anything you start designing, so you can get a feel for how it feels in action. That should help you avoid a lot of these.</p>
<p><strong>Not fully thought out APIs</strong></p>
<p>This one is similar to the previous one, but I think it deserves section and example of its own. This happens when you almost nail the API, but fail to consider some common uses of the API. The biggest offender of this one I believe is the Java List API.</p>
<p>The two most common use cases I have in Java when I work with lists are<br />
<span style="font-size: 13.3333px;">1.) Iterating through them to perform some operation and<br />
2.) Filtering the list to get a subset</span></p>
<p><span style="font-size: 13.3333px;">The second operation is so common that I get annoyed now that I have to create an empty list, iterate through each one using a for each and conditionally add elements to the new list. Now I realize that Java doesn&#8217;t make it easy to pass in functions (check my older <a href="http://theshyam.com/2009/11/what-i-miss-in-java/">article</a> about this) as arguments, but what I really really want here is the ability to do myList.filter(predicate) where predicate is a predicate function I decide, which returns the filtered list with elements matching the predicate.</span></p>
<p><span style="font-size: 13.3333px;">There are many more such common operations missing on the List interface, but this is the most egregious one I believe. Javascript also gets this wrong, but <a href="http://documentcloud.github.com/underscore/">underscore</a>, a JS library adds a lot of this which makes working with lists and collections a dream. </span></p>
<p><strong>Misnamed APIs and methods</strong></p>
<p>How many times have you called a method, only to realize that it didn&#8217;t really do what you thought it did? Or look for a method XYZ, only to realize later that it had been named YXZ instead. Raise your hands if you have experienced this. For some reason, an apple for someone almost always turns out to be an orange for someone else.</p>
<p>I&#8217;ll switch to bashing on JS for this one, <a href="http://documentcloud.github.com/underscore/">underscore</a> in particular. For all the amazing methods that underscore provides in JS, they really have a problem with naming. I ended up looking for a collection.contains method, and ended up finding only indexOf, so I initially assumed that they didn&#8217;t have it. I mean, if I look for contains, at best, I will also look for has, hasKey. Browsing through the list of method names, I might have even accepted includes (though it would not have been my first choice). But never in all my life would I have expected it to be include (Yes, that is include, as in singular!). People, what were you thinking????</p>
<p><strong>Liars</strong></p>
<p>The final set of APIs which can annoy (but are easily worked around, just like the previous section) are APIs which lie. These include APIs which don&#8217;t do what the function name suggests it does (no obvious example from the open source land comes to mind, thankfully). The other kind is one which is not done with work even after the object is created. Most times, it is the case of a lurking init / initialize method. And if you ever see an interface called Initializable, run in the opposite direction.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2010/04/apis-and-what-not-to-do/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is Strong Typing really needed?</title>
		<link>http://theshyam.com/2010/03/is-strong-typing-really-needed/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=is-strong-typing-really-needed</link>
		<comments>http://theshyam.com/2010/03/is-strong-typing-really-needed/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 19:36:40 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[dynamic languages]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=282</guid>
		<description><![CDATA[This is something I have been struggling with for the last few months. I have had people argue ardently that all Strong typing is good for is false comfort and lots of unneeded typing. But I was strong. I was undeterred. I dismissed this as the crazy rants of those JS developers, those dynamic language [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">This is something I have been struggling with for the last few months. I have had people argue ardently that all Strong typing is good for is false comfort and lots of unneeded typing. But I was strong. I was undeterred. I dismissed this as the crazy rants of those JS developers, those dynamic language people who believe that obfuscation and compactness is everything, even at the cost of maintainability. I mean, how could a language where you didn&#8217;t even know what was getting passed in in any ways better than something where the APIs are explicit and stop you from making mistakes. A dynamic language could work for a single developer, but definitely not for a team. That was my whole hearted conclusion.</div>
<div id="_mcePaste">Now, I&#8217;m not so sure anymore. Its been 3 weeks since our team made the whole hearted switch. Has it been roses and sunshine? No. But it hasn&#8217;t been as bad as I expected it to be. And there are a few reasons for that. But before that, I&#8217;ll lay down the pros and cons the way I see them from my (assuredly very limited) experience :</div>
<p></p>
<div id="_mcePaste"><strong>Benefits of Strong Typing :</strong></div>
<div>
<ol>
<li><strong>Errors / Warnings in your editor</strong><br />
Simply put, this might just be the single most greatest benefit of strong typing, and the single reason why most java developers (a lot rightly so) will never even consider leaving the safety of strong typing. While compilation support doesn&#8217;t necessarily go hand in hand with strong typing, most people tend to associate Java with it, so lets run with that. Simply put, with Strong typing, your editor can (and should, I mean, if you are not going to get immd. feedback, what&#8217;s the point?) give you immediate feedback when you messed something up. Whether this be using the wrong variable name or trying to call a method that either does not exist or with the wrong parameters. Or if you are trying to use the wrong type of object.</p>
<p>To a Java developer, an IDE like Eclipse or IntelliJ is godsend, as it tells you what is wrong in your world and lets you jump to them, gives you suggestions and autofixes and generally makes your life as painless as it can. And it is brilliant, I can tell you that.</p>
<p>In Javascript (or any other dynamic language), everything is fine and dandy for the first 100 lines. After that, it becomes scarily unmanageable. The only way around this that I have found so far is to be super paranoid and write tests for every single line of code. If you can&#8217;t do that, stay far far away.</li>
<li><strong>Generics (but this is also a negative, in my opinion, which I&#8217;ll get to below)</strong><br />
The idea behind generics is that gives developers some assurances about the types in a collection (or whatever it is you are genericizing). That way, all operations are type safe, without having to convert to and from different types. And you are assured that you will not be surprised suddenly by a different type of object popping up when you least expect it. But there are a lot of issues with them that I&#8217;ll cover in the second section.</li>
<li><strong>Ability to follow a chain and figure out what type of object is required at each step</strong><br />
Now this is something I definitely miss in languages like Javascript and Python. The fact that I can trace (in my IDE, note that part) what the type of each variable / method call in an expression chain is simply amazing, especially when you are working with a new codebase. You never have to wonder what the parameter types of the method you are calling are. You don&#8217;t have to wonder what methods are available or visible. You just know this information (Again, assuming you are using an IDE. If not, god help you)</li>
<li><strong>Refactoring</strong>
<p>The biggest advantage of Strong typing though, in my opinion, is the ability to create IDEs which make refactoring a breeze. Renaming a method / variable? Trivial. Moving or extracting a method? Simple key combination. Stuff which can be extremely tedious and mind numbing are accomplished in a matter of minutes. (Want to know more about these shortcuts? Check out Eclipse shortcuts). This is simply not possible with languages like Python and Javascript.</li>
</ol>
</div>
<div id="_mcePaste"><strong>Disadvantages of Strong typing :</strong></div>
<div>
<ol>
<li><strong>More concise and precise, less typing</strong><br />
Dynamic languages do tend to be more dense, and it is much easier to accomplish in 10 lines what can easily take 50-100 in a language like Java, which is especially verbose. Consider trying to pass in a chunk of code to be executed at the end of a function in both Java and javascript (this is pretty common in web apps and task runners)<br />
<em>Java :</em></p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">interface</span> Function <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; T execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// Optional parameters is not easy here :(</span><br />
<span style="color: #009900;">&#125;</span><br />
taskRunner.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>taskArgument, <span style="color: #000000; font-weight: bold;">new</span> Function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;Success&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p><em>Javascript</em>:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">taskRunner.<span style="color: #660066;">execute</span><span style="color: #009900;">&#40;</span>params<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>response<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Success&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
</li>
<li><strong>No badly implemented generics</strong><br />
This is mostly Java&#8217;s fault of getting generics pretty badly wrong. The idea behind generics is sound, its the implementation that is horribly broken. Here are a few things which are wrong with it :<br />
<em>Type erasure</em> : This basically involves the fact that at runtime, there is no way to differentiate between say, a List&lt;String&gt; and a List&lt;Integer&gt; If you never work with reflection or Guice, then this might not be a problem. But it also is a pain with deeply nested generics and wildcards. I have seen compiling code which blows up at runtime because it cannot differentiate between a Provider&lt;? extends Repository&gt; and Provider&lt;? extends Resource&gt; and neither Resource nor Repository have anything in common. Crazy&#8230;.</p>
<p><em>Verbosity</em> : Map&lt;String, List&lt;String&gt;&gt; myMap = new HashMap&lt;String, List&lt;String&gt;&gt;();. Enuff said.</p>
<p><em>Guice &amp; Reflection </em>: Generics and java.lang.reflect just don&#8217;t mix. They just don&#8217;t. Type erasure blows away all type information, so you are bound to be using stuff like new Entity&lt;?&gt; which totally defeats the purpose. And don&#8217;t get me started on Guice. In guice, normal bindings (non generic classes) look as follows :</p>
<p><em>bind(MyInterface.class).toInstance(instance);</em></p>
<p>With Generics involved, they now look as follows :</p>
<p><em>bind(new TypeLiteral&lt;MyInterface&lt;String&gt;&gt;(){}).toInstance(instance);</em></p>
<p>What the heck just happened there???</li>
<li><strong>Closures / Functions :</strong><br />
Closures are a form of anonymous inner functions which can have an environment of their own, including variables bound to the scope of the function. The inner function has access to the local variables of the outer scope and can change state. But what it does allow is creating functions, as callbacks or for performing some quick little task in a repeated fashion, easily and quickly and pretty darn cheaply.Java has had a few proposals to add it (http://javac.info/) but it has not passed the review committee yet. And probably won&#8217;t for the next few years. So till then, in Java, you are stuck creating interfaces, creating an implementation of it at runtime, passing in variables you need access to in the constructor or through some other mechanism, and generally be in a lot of pain. Thanks, but no thanks.</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2010/03/is-strong-typing-really-needed/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>What I miss in Java</title>
		<link>http://theshyam.com/2009/11/what-i-miss-in-java/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-i-miss-in-java</link>
		<comments>http://theshyam.com/2009/11/what-i-miss-in-java/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:39:02 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[wordy]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=252</guid>
		<description><![CDATA[So I finally got some time to sit down and write, after being knee deep in work the past month or two. And without a doubt, I wanted to write about what has been heckling and annoying me over the past month. I am an ardent defender of Java as a good language, especially defending [...]]]></description>
			<content:encoded><![CDATA[<p>So I finally got some time to sit down and write, after being knee deep in work the past month or two. And without a doubt, I wanted to write about what has been heckling and annoying me over the past month. I am an ardent defender of Java as a good language, especially defending it from Misko day in and day out, but even I will agree that it does suck at times. So today, Java, the gloves are off. I love you, but this is the way things are.</p>
<p>To give some context, I have been working on <a href="http://code.google.com/webtoolkit/" target="_blank">GWT</a> a lot recently, and have done some crazy things with GWT generators (which I might cover in a few posts later). I love GWT, but for all of GWT&#8217;s aims to allow developing modern web apps without losing any of Java&#8217;s tooling support, there are a lot of things which are made easier in javascript. Lets take a look at them one by one, shall we?</p>
<h3>Closures (Abiity to pass around methods)</h3>
<p>So this was the straw that broke the camel&#8217;s back. I had this use case today where I wanted to set some fields through setters on a POJO. Simple enough right? Well, NO, because someone used defensive programming (Don&#8217;t get me started about precondition checks, thats for another post) and so it through a null pointer exception. Ok, since I can&#8217;t change the POJO (since it is in someone else&#8217;s code base), I needed to check for nulls on my side and not call the setter if the value was null. Simple enough, I do a check and call the method conditionally. Except when you have a few 10 odd properties, thats a lot of conditionally crappy code.</p>
<p>Ok, so my other option is write a function which checks that, right? Except in java, you can&#8217;t pass around functions or closures. Ideally, I want to have a closure which takes a value and a function, and let the closure handle the null check and conditional calling. Something like :</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">callConditionally<span style="color: #009900;">&#40;</span>myPojo.<span style="color: #006633;">setValue</span>, actualValue<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Except you can&#8217;t. Not in java. I mean, I could create an interface to wrap it, but that just adds more boilerplate than necessary. I ended up creating a method which uses reflection to find the method by name and calls it, but my point is that it shouldn&#8217;t be necessary. What should be two or three lines of code ended up being a 20 line monstrosity. And yes, before some smart aleck replies that if I wanted closures, I should go to javascript, I will point out that there have multiple proposals to include closures in Java, and Scala, which compiles into java, supports closures as well.</p>
<p>There are multiple JSR&#8217;s and open source libraries which try to implement this for Java, and one of these days, I&#8217;m gonna give it a try. But for those interested, check out <a href="http://javac.info" target="_blank">http://javac.info/</a> and <a href="http://code.google.com/p/lambdaj/" target="_blank">http://code.google.com/p/lambdaj/</a>. Both of them look promising.</p>
<h3>Type inference and General Wordiness</h3>
<p>They say a picture is worth a thousand words. Well, with java, and especially with generics, it seems that even a simple declaration is atleast a thousand words. For example :</p>
<pre>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Map<span style="color: #339933;">&lt;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>, List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;&gt;</span> myMap <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>, List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
</pre>
<p>The above line could be so much shorter and sweeter as :</p>
<pre>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Map<span style="color: #339933;">&lt;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>, List<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;&gt;</span> myMap <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ahashmap+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">HashMap</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
</pre>
<p>There are very few cases when I would want a map of something else when I just declared it of a particular types. Other examples like reading a file, working with regexes abound, all of which require much more syntax than other languages. And I definitely do miss being able to say</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>myValue<span style="color: #009900;">&#41;</span></div></div>
<p>instead of</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>myValue <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span></div></div>
<p>Sigh&#8230; And don&#8217;t even get me started with reflection. Reflection in Java is extremely powerful, but man is it wordy. Not only can you not recurse over the properties of an object directly (like say, in javascript), you also have to worry about exceptions (which I&#8217;ll get to in the next section)</p>
<h3>Checked exceptions</h3>
<p>That brings me to my last and biggest complaint. Checked exceptions in Java. They are just plain evil. I know people swear by them, and some of their arguments even make sense. Sometimes. But the fact remains that they make me write more boilerplate, more code that I don&#8217;t even care about than anything else in Java. The idea behind checked exceptions is sound. Its a great way to declare what the caller of a method needs to worry about. But the thing is, I should have an option other than rethrowing or logging it.</p>
<p>I did a very unscientific data gathering experiment of just looking at code randomly in different code bases (<a href="http://www.google.com/codesearch" target="_blank">Codesearch</a> was especially useful for this). And the majority of catch blocks I found either</p>
<ul>
<li>Logged it using logger or System.err</li>
<li>Rethrew it as a wrapped exception</li>
</ul>
<p>Me personally, I have changed Eclipse to generate all catch clauses for me by wrapping and rethrowing it as a RuntimeException so I don&#8217;t have to worry about adding a throws to my method declaration, when it is a non recoverable exception for the most part.</p>
<p>Furthermore, sometimes Checked exceptions can even lead to clauses which will never ever be executed. Point in case :</p>
<pre>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; java.<span style="color: #006633;">net</span>.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurlencoder+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">URLEncoder</span></a>.<span style="color: #006633;">encode</span><span style="color: #009900;">&#40;</span>myString, <span style="color: #0000ff;">&quot;UTF8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aunsupportedencodingexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">UnsupportedEncodingException</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// Can never be thrown, but I am forced to catch it.</span><br />
&nbsp;<span style="color: #666666; font-style: italic;">// Because its a checked exception!!!</span><br />
<span style="color: #009900;">&#125;</span></div></div>
</pre>
<p>There are many more cases like this, but I think this is enough of a rant for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2009/11/what-i-miss-in-java/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to build a Deeplinking capable Flex / GWT App</title>
		<link>http://theshyam.com/2009/10/how-to-build-a-deeplinking-capable-flex-gwt-app/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-build-a-deeplinking-capable-flex-gwt-app</link>
		<comments>http://theshyam.com/2009/10/how-to-build-a-deeplinking-capable-flex-gwt-app/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 21:19:57 +0000</pubDate>
		<dc:creator>shyam</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[deeplinking]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://theshyam.com/?p=242</guid>
		<description><![CDATA[I have been working extensively with GWT recently, and worked on a flash based webpage before that. And we tried many different approaches before finally settling down on a particular approach that works across all frameworks which are GWT / Flash-like. What do I mean by GWT / Flash-like? Well, these are frameworks which rely [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working extensively with GWT recently, and worked on a flash based webpage before that. And we tried many different approaches before finally settling down on a particular approach that works across all frameworks which are GWT / Flash-like. What do I mean by GWT / Flash-like? Well, these are frameworks which rely on on one page serving the entire content. The state of the page changes, but the web browser does not navigate between pages unlike a traditional website.</p>
<p>And both of these frameworks do not make it easy to provide deeplinking. Oh sure, its easy to add the functionality to hit the Back button in your browser and navigate in both GWT and Flex, its not as trivial to implement a way to provide a URL and browse immediately to the corresponding page without a lot of effort on the part of the developer. And this is where the following structure makes life a little bit easier.</p>
<p>The central concept in either of these is something called a <strong>Workspace</strong>. The workspace in this architecture represents the <strong>truth of the UI</strong>. Whatever the workspace contains is displayed in the UI. It is the backing model of the View. Now, for a mail app, it might represent the current view, like Inbox or Sent mail, and maybe the mails contained in it. And any other information needed to build and display the View. The workspace is also responsible for two more things, firing an event to all the Views saying that it has been updated, and another to a controller to tell it to go fetch data from the backend server.</p>
<p>Now the <strong>Views</strong> themselves are stateless to an extent, other than holding a reference to the Workspace. These would be the Panel classes in GWT. Their only responsibility is in channelling information to and from the workspace. They also listen to events on the Workspace. So whenever a Workspace_Changed event fires, the views go and grab relevant data from the workspace and render it.</p>
<p>The workspace also fires an event whenever a View tells it it needs more information. In that case, the controller goes and fetches the data, stuffs it in the workspace, and the workspace then fires an event to tell the Views that they should now update themselves. So basically, there are two events propagating through the system :</p>
<ul>
<li><strong>UPDATE_VIEWS</strong> : The workspace controller fires these when it has stuffed the information from the server into the workspace. The views listen on this event and update themselves accordingly</li>
<li><strong>UPDATE_WORKSPACE</strong> : The views fire these when it wants more data loaded from the server. The Workspace controller listens on this, and based on the state of the workspace, fetches relevant information. The catch is that it should always be possible to compute what data is needed based on the workspace. When the controller finishes, it fires the <strong>UPDATE_VIEWS</strong> event.</li>
</ul>
<p>Ok, so what does this give us with regards to Deeplinking? Well now, your URL / Token parser should be able to parse the URL or tokens (it is trivial to add a HistoryChangeListener in both GWT and Flex). And based on the parsed tokens, it should just update the workspace with the relevant fields. And go off and fire a UPDATE_WORKSPACE call. This will trigger a server call, get the relevant information, fire an UPDATE_VIEWS event, which tells the Views to go update themselves based on the state of the workspace. Voila, you have a working Deeplinking implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://theshyam.com/2009/10/how-to-build-a-deeplinking-capable-flex-gwt-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

