Archive
What if you don’t like JVM garbage collection?
At a technical interview recently, I was asked:
What if you don’t like Java’s garbage collection, what would you do? How would you manage memory?
You can carve a large array of bytes on the JVM heap, implement your own memory on that array and manage it yourself, kind of a virtual-machine-over-virtual-machine system; but I don’t see very good reasons to do that. Well-informed engineers have worked over a decade to get the JVM garbage collection right – so if you have to dump all that work and cook up your own scheme, you better have very good reasons. I told as much to the interviewer – I would imagine that it can be done, but I don’t know of any situation where I would recommend it.
Dear readers, do you know a good answer to this question? Do you know any situation where you would recommend this? If you come across such a situation, what would your solution be?
BG quote on Lines of Code
I was reading through the Wikipedia entry on source lines of code and noticed this quote from Bill Gates:
Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
Good one!
Liquid Coding
Business World’s Great Places To Work 2006 survey places my employer, Tavant Technologies, at #17! Congrats to self!
From their writeup on Tavant.
Who is a liquid coding champion? A crack coder at Tavant Technologies. For those who think coding is the stuff spy stories are made of, well, it is the backbone of a software programme. In any IT solutions business, when a client gives a specification for a certain programme, it seldom stays what it started out as. A good coder will keep this in mind and ensure his work is flexible from day one. That way, he doesn’t have to start all over again when the specifications change.
Liquid Coding was a programing competition held for programmers at Tavant Technologies. It is a 3-hour competition and one can pair up with another person. At the start of the first hour, you would get a set of requirements. At the end of the first hour, you get some more requirements and further some more at the end of the second hour too. Each requirement is specified as one or more executable unit tests, and they carry certain number of points based on their complexity.
The crux of the competition is to write code to match requirements under extreme time pressure, and write it in such a way that it is extensible enough when further requirements are to be implemented.
I paired with Vineeth for this competition, and we came first in the tech lead category. The experience was intense and real fun. It is one of the best prizes I have ever got; and definitely the one that I am most proud about.
Web presence for small businesses
Internet is getting popular in India. I don’t have any statistics about it, but my guess is that most people and businesses in India don’t have an internet presence yet. Putting information about a business on the internet is useful for both the internet community and the business themselves.
Seth Godin writes:
What should my local chiropractor do? Or the acupuncturist? Or the pet store? What about that small church or mosque?
The web has changed the game for a lot of organizations, but for the local business, it’s more of a threat and a quandary than an asset. My doctor went to a seminar yesterday ($100+) where the ‘expert’ was busy selling her on buying a domain name, hiring a designer, using web development software, understanding site maps and navigation and keywords and metatags and servers…
These are businesses that have trouble dealing with the Yellow Pages. Too much trouble, too much time, way too expensive. So, should local micro-businesses just ignore the web? Or should they become experts in the art of building and maintaining a website
…
I think there’s a third way, one that gets them just about everything they need, takes an hour or two a month and costs about $60 a year.
The advice Seth gives is brilliant for its simplicity! Highly recommended.
Most readers of this blog might not have any trouble managing a web server and a few web sites. But if you know someone running a small local business who likes to have a web presence but would not like to be bothered with the hassles, I recommend pitching Seth’s idea to them.
What programing languages should one know
Today I came across the article What Programming Languages Should You Know? by David Chisnall. David’s list of essential programming languages include C, Smalltalk, Lisp, Erlang, Haskell and Prolog.
Of these, I know only Lisp (Scheme, to be precise). Eric S. Raymond’s famous quote (David also quotes it):
Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.
influenced me to try the language. Reading SICP and EoPL was useful. I also worked through most parts of PCL also.
I did some C during college, but I never learned the language well enough (I know enough to know that I don’t know it well enough)
. Tom Drake, who works as a senior architect with Tavant, once advised me that learning C is important whatever language you actually work with. Tom should know – he has worked with lots of different languages and systems in his career. I haven’t followed that advise so far, largely because you don’t come across articles saying “How C cured cancer!” on reddit.
One these days, I should go learn some C, I guess.
I am trying to learn Haskell – I have been following tutorials on the web, and have been making some progress. A friend who is returning from US is bringing a copy of Programming in Haskell, and I should get it by next month. I had worked through a draft copy of the book, and I found it lot more approachable than other tutorials I found – so I am looking forward to reading the actual book. Erlang also looks to be an interesting language, and I am curious to understand what all the cool kids are talking about its concurrency primitives. I haven’t read much about Smalltalk and Prolog (except some videos I watched about the Seaside web framework in Smalltalk).
It amuses me to note that both programing languages I have used extensively in my professional career – Java and JavaScript – do not make the list. But things I have learned in other languages had helped me understand these two languages better. Knowing Lisp, in particular, has helped me understand JavaScript. I have briefly dabbled with Ruby, Python and Groovy too. I have to agree with David on:
The more languages you learn, the easier it is to pick up a new one. Eventually, you start thinking of every new language as just a set of modifications to a language you know already.
So, what are the languages have you learned or are planning to learn?
SICP Indian Edition
I was not aware of this before, but an Indian edition of Structure and Interpretation of Computer Programs (2nd ed) is available now. Thanks and congratulations to Universities Press for bringing this classic out in India.
Career Advice
Via Reddit – couldn’t resist link jacking.
I used to do interviews for hiring students from campus. One question I often tried to ask folks from branches that don’t involve programing is “Now that you have chosen to go into a programing career, how did you arrive at this decision? What did you do to prepare yourselves for it?”. Very few students I have interviewed have given a convincing answer to that question – I have got the impression that many people choose the programing career because everyone else is doing it.
I wish they had the above image as the cover of some text book.
Should my JavaScript-heavy enterprise application support IE?
At work we are developing an application that makes heavy use of JavaScript (yeah, like everyone else these days!:). The application is still under development, but we have made some alpha releases for our sales folks to demonstrate it to potential customers. The application, right now, is sluggish and has memory leaks in IE – in FF it works beautifully well!
Sales, QA and business analysts use IE, but developers use Firefox. Firefox respects CSS, it has a fast JavaScript runtime and supports better development tools (Firebug, in particular, is god send!). IE6 is sluggish and has quirky CSS support.
Within the development team we often joke that we might have to show a splash screen with “Detected IE; launching in slow-mode” when a user launches the application on IE. But Giles Bowkett’s post “The Business Case For Firefox” had me thinking seriously – should we really support IE?
Our application is targeted at businesses; a fixed number of users (employees of our customers and their customers) would be using it daily to get their job done. Productivity is very important under this circumstance, so any sluggishness in the user interface is not acceptable. Speed of the application, as perceived by the user, is much dependent on the speed of execution of JavaScript. I admit that we can definitely tune our JavaScript code to run faster – but shouldn’t we also be looking at getting a faster runtime too?
Since the users of our application are a captive audience, we might also be able to convince them to use a particular browser – you can take the stance that “this website, viewed with this browser is the application“! Will this work in practice? Would we be able to convince our customers to switch (if they are not already using it) to Firefox?
The development effort has budget considerations too. The project stakeholders need to be aware that supporting IE properly is an activity that is going to take some cost – do they really care to have it, or will they like some other feature in the application instead. Giles make some excellent arguments on this, and I think I should be making them to my bosses too; let them be aware at the least.
PS: I don’t have any experimental data to prove that the IE JScript runtime is sluggish. I have that empirical impression from my experience using IE. Please drop me a comment if you have data for or against my conjecture.
What are others reading/planning to read
From Reddit, What books are on your wish list?. The discussion points out some interesting books.
