Monday, February 01, 2016

VI - Part 1


The topic of IDE vs plain editor has been beaten to death elsewhere. Here, I’ll talk about why I personally went for Vim.

At a certain point of time in my career, I found myself working on a J2EE application (to use paypal to do billing for a e-commerce site) and a website driven by ASP .Net (a kind of a personality test) simultaneously. I had gotten into these projects because well, I wanted to try something new and people were paying me to get this work done for them. At this point I had no understanding of web application development, the MVC model or any of those things, having been a C programmer.

I used Eclipse for the first and Visual Studio for the second. 

MS Visual Studio made it dead easy to slap together a basic MVC site, with the same basic process you use to create a standard Windows application, and has enough in there to take you all the way through to deployment.

Eclipse and J2EE was a harder bridge to cross for me. I had missed the whole ‘Enterprise Java’ bus, was unfamiliar with the J2EE or with eclipse for that matter. I had studied some Java in college but that was it. With liberal help from google, I was able to import the application in and start writing code. I actually completed this one successfully as well.

Here was the problem (from my perspective). Even though I was able to code, and in the case of the ASP .Net project, actually take the project from start to deployment, I never actually understood how any of this actually worked. The IDEs do an excellent job of protecting you from the details. With some creative keyboard mashing and googling, you can pretty much figure out whatever you need to do to make things “work”. In the case of the J2EE project, for example, my responsibility ended when I could make it work on my local setup. The actual deployment into production was handled by someone else. 

This was very troubling for me. I like to know what’s going on. It is not that I mistrusted my teammates or anything, but I feel out-of-place if I don’t understand how things work.

When I got my next job, I decided that I would not use any IDE of any sort, and do all of my coding with a basic text editor. 
The deployment and development environment in the next job was linux, so I chose VI. So, my “IDE” was vi and grep :)

There was a definite element of luck here;
- I had gotten in on the project right at the beginning, which meant that I didn’t have to understand a massive amount of existing code. A good IDE is awesome for that. 
- I was in a group that let me do this. There was no set of standard tools.
- The project I was working on did not preclude this. If we had been developing, say, a ASP .Net application, I would have been hard-pressed to do my development without MSVS, for example.
- The coding was in python. I had never written code in python before. So, it helped me make a clean break.

So, what did I expect, and what happened
1. It was easier than I had expected. After a while, you don’t rely on auto-complete anymore. You just get used to typing what you need to type. That said, not having autocomplete can get a bit annoying. If it’s code that you have not seen in a while, not knowing the method names means you need to shift up and down through the code, for example.
2. I did not memorize the python language nearly as well as I had expected I would. I had hoped for example, that I would remember the class method names and parameters of most standard python libraries. Turns out I did not. It was all “cached” in my brain. When I was in the middle of intense coding periods, I would remember it and then I would forget. 
3. I got really good at knowing the general outline of most of the code, including code that was not mine. This was invaluable when something broke in production and I had to figure out what was broken. 
4. It improved my logging. With a good IDE, one gets used to using the debugger to figure out code flow and errors. Without an IDE, every time I wrote code, I was forced to think ‘how the hell will I know if this breaks’.
5. I really did feel like I understood how things worked. This was partly because of python. It really let me change a little bit of code, try it out, change something else etc. The turn-around-time to figuring out if the fix would work is a lot shorter. In addition, since I felt like I knew how the code was laid out ‘in the file system’ as it were, I felt a lot more confident making changes and testing the code even if it was not mine.

So, what’s next.
I am again in a place where I need to absorb large amounts code. It is time to rely on something more than just grep :)
The options that I am exploring are :
- Vim as IDE (there are some really interesting vim plugins that I have been trying out)
- Emacs maybe? I had used it in grad school been away from it oh so many years now.
- Actual IDE as IDE (time to join the rest of the world)

Sunday, May 09, 2010

Even gods get back spasms

The missus and I went to see Mark Knopfler. I'd been gushing about the concert to her for a while now. Kogi Kaishakunin had rounded up tickets for a few of us last year. However, due to a pressing engagement (something about riding a white mare in the footsteps of dawn) KK was quite unable to make it. The others were basically lazy bums.

Thus it came to pass that it was just the missus and I in a row of empty seats. The day had started pretty miserably for me (I was in my car 6 hours before I got to work and then another hour and a half's drive before I got home). The traffic demons were clearly in the mood for mischief. So, we finally got to the theater a little late, for the last two songs of the opening band, Pieta Brown and a dude in a white cowboy hat. It was just a 2 person show. Pieta on vocals and guitar and cowboy dude on guitar. It was quite pleasant actually, kinda bluesy.

Then, of course, it was time for the main show. The Man himself. And he was sitting on a chair this time. Turns out he had a back spasm of some sort. Couldn't really bend or move. Having had some experience in the area, I know how much that sucks. But, except for the fact that someone had to help him with the guitars and off the stage, you couldn't tell. It was all there. The chilled out guitaring, the Sultans of Swing, the Romeo and Juliet, the Coyote, the Brothers in Arms, the So Far Away, the Sailing to Philadelphia, Telegraph Road, and finished up quite nicely with Piper to the End. The cool thing about Knopfler is that he doesn't make a big deal about his old or his new music, like certain artists. There's no 'ohh, the audience want me to play So Far Away again? I've grown so much since then'. Oh no, he plays it, everyone sings along, has fun and that's that.

I have lost track of the number of times I have said it, and will say it in the future too. The guy is way too cool. Effortless mastery, relaxed presence and spectacular skill. Quite predictably, I have been on a youtube binge of knopfler. The thing is, the guy hasn't lost a bit of his skill. Just seems to keep going from strength to strength. There's so much variety in his music and just what he chooses to sing about.

I am basically waiting for the next chance to see him in concert :-)

Tuesday, June 02, 2009

A new Curd-rice kayaker

..where there is neither curd-rice, nor kayaking. and our valiant protoganists are set upon by wild-animals and come through unscathed...

Frequent readers of this blog (all the two of you) would know that on occasion, I do enjoy a bit of kayaking and camping. All of my kayak-camping has happened on the Delaware river. It's not an accident. It's well-served by canoe outfitters, the water is not risky or high, paddle-in campsites are easily available and it's not too far.

S. had been kayaking once before, never been camping or canoeing. So, it was with a mixture of anticipation and 'I hope this dude knows what the hell is doing' that she agreed to the plan.

We got to the outfitter's only at 4pm, having decided to go camping at 12:30, and with a brief detour to get some frozen parathas and chutney for dinner. It was decided to do the 16 mile trip from the Bushkill access to the Delaware Water Gap. We put in at 5:00 pm.

It was a pleasant evening. The river was high and somewhat fast, so we didn't have to paddle too hard. The campsites came on pretty fast, in less than an hour. We pulled in to a camp site and setup camp in an hour or so, while it was still light. This is something of a record for me, thus far having setup a tent only after the sun had gone down completely. Somehow, I always seem to be late getting to the campsites :) We hauled the canoe up the somewhat steep bank just in case the river rose at night and took the canoe with it.


Made chai, Setup the tent, collected some wood, got a fire going and had dinner (parathas and coriander chutney) by 9. Turned in by 10. Something about the cold (it had turned much colder than the balmy 75, probably down to 50-45) that makes you want to curl up and go to sleep. Made sure what remained of our food (fruits) was in the canoe, which was across the fire from us.

I was woken up maybe around 1 am by S., with a whispered 'hey there's something out there'. Sure enough, there was the distinct sound of something rustling through the plastic cover in the canoe. Hmm. Discretion being the better part of valour, and cowardliness the better part of discretion and we decided not to challenge this interloper to our campsite. We couldn't quite make out what it was, and it didn't really sound like a big animal. So, we figured, if it wanted some fruits, hey, athithi devo bhava and all that sort of thing. The sounds stopped after a few minutes. Then, much later, around daybreak, there was the sound of deer walking around the campsite. We woke up in the morning to find deer hoofprints around the campsite, I could see where it had bedded down for the night. The deer had chewed up our apples. So much for breakfast.

Made some more tea/coffee (of course, I say made coffee/dinner, but it was the S. who took care of the cooking bit. I suppose there are some benefits to marriage :)). We were on the river in short order, rolling down the river.

Now, the section a few miles before the Smithfield Beach takeout is really annoying. The river is nice and wide, so, it runs slow. And the winds blow straight upstream. This makes for pretty slow going. On the other hand, it did give me some time to take some photos.


We took about an hour's break at Smithfield, to umm, perform ablutions. Then, on it was to the Water Gap. The Delaware Water Gap is this massive gap in the mountains through which the river travels. It's got some very nice steep cliffs. Very pretty. But to get to it, we had to go through some more wide, slow and wind-against-the-face type paddling, until we crossed the Shawnee Island. After that, things get pretty reasonable, though still slow. The boredom was telling on S. a bit at this point. Right around this time, I caught sight of a bald eagle. It was a nice specimen and the photo does not really do it justice.

As soon as you cross Shawnee, there are these bridge pillars (which always bring to my mind Rauros from middle earth, despite being absolutely nothing like that). Once you get to this point, the river picks up speed, and there are some riffles to give some excitement. It's a bit more fun in a kayak, since you get splashed, but, the canoe does keep you and yours dry :)

Before we knew it, we were at the takeout at the water gap, famished, bedraggled, but happy.

In all, an interesting trip, a good way to get S. involved in this whole outdoors business. Delaware river is rather good for people just trying out multi-day trips and canoe camping. The plus is that the river is friendly with hardly any rapids. The minus is the flip side of the same feature, the river is wide, and slow, and in stretches can get on people's nerves.

As it turned out, we did have curd-rice after all, but after we got home..

Saturday, March 21, 2009

Bushi no Ichibun (Love and Honour)

This is the third movie in Yoji Yamada's series of samurai movies. The other two being Twilight Samurai and The Hidden Blade .

In Love and Honour, Shinnojo a young samurai, who is the official taster for the daimyo is blinded after eating poisoned food. This puts him at the threat of losing his stipend and driving him into penury. His family pressures his wife Kayo to try and convince a high official who she has a passing acquaintance with to intercede on his behalf. The movie deals with the repurcussions of that action.

The movie follows in the style and tone of the other two. The focus is on the couple and their relationship. Shinnojo, like the protoganists of the other two movies, is not terribly enamoured with the samurai lifestyle. He would like to open a school so that children of all castes, not just samurai can learn swordsmanship.

Even though the three movies have no story arc joining them, they are stylistically connected. They all follow lives of "ordinary" samurai, and focus on their relationships. They are not about pomp and ceremony, like say Ran, or Throne of Blood or swashbucklers like Yojimbo or Sanjuro. The heroes are undemonstrative anti-Mifunes and there are no scenery-chewing histrionics.

The movies are shot with great care and adhere to using authentic period clothing, utensils and activities. The director composes some shots like photographs. Just letting it linger for a few more moments than might be considered strictly necessary. There are scenes (like Iguchi Seibei eating breakfast before going out for the day) which are again, not really required for the story but really adds to the mood. The movies and the heroes project a feeling of quiet and calm. The music is pretty good and really goes along with the action.

I guess it is pretty obvious by now that I utterly enjoyed all the movies. I very highly recommend them.

Friday, October 17, 2008

The other man on the podium

During the Mexico Olympics in 1978, two black US athletes protested racial inequality. I had seen that picture before. What I didn't know was that the third guy in the picture, a white australian, had joined in the protest and paid a personal and professional price for it. Very brave.
http://news.bbc.co.uk/2/hi/uk_news/magazine/7674157.stm