Like.com

Thanks to Scoble, I’m clued into the latest, geekest development onthe web. google introduced the much refineed version of searching that is synonomous wiht, well, search. Google’s oversight was that it searched text  (ie. filenames, titles, etc). Even the image search.

Like.com, however, searches the image itself for other similar items. For an alpha release its increbibly sophisticated, allowing you to fine tune the search according to color, shape and pattern You can choose the color you want. You can also toggle how important each charecteristic of the item is for your search.

This will do wonders for my bank balance. And the simple reason is: it works. While tags do go a certain way to describing an item, article ir webpage, the visual aspect is far more powerful. They say a picture is worth a thousand words – this proves it.

The facinating part of all this is that back end. Exactly what software its running on i’m not sure. but the hardware is impressive enough. 250 servers with 4 processors each and 20 gigs of RAM.  While the number of categories you can search may seem rather samll compared to the hardware arrayed for the task, using like.com and seeing its sophistication makes you see why.  

I’d love to see the code for this ;). Something tells me thats not gonna happen.

The idea is simple, buy mudersly complex in exectution. I’m not into image manipulation this far in my course, but getting the computer to think is a big enough job.

I hope the set of seaches expands in the near future. They are tweaking and testing and trying to wring every extra processor cycle out of the program. I know the drill.

 I just hope that a web service comes out of this. I already have an idea. Combine like.com with google maps ( or Windows Live Local) to show the nearest store you can buy the item from. That would be cool.

Anyway Scoble has a few titbits:

Some stories about Like.com.

1) The URL cost him $100,000. In the interview he explains how they bought it. It involved finding the guy who owned it, jumping a fence, and leaving a bottle of wine with a note on it (he wouldn’t answer his email).
2) Riya was pretty close to being sold to Google. If it had been, they never would have worked on this search engine. So, by getting turned down by Google Riya came back with a much better business.
3) Just the jewelry set takes 20GB of RAM.
4) Munjal still believes in blogs, but for this launch Riya talked with fashion bloggers, and journalists outside the tech world like at People magazine. Why? Well, this site — in its current incarnation — will be most interesting to women and non-geeks. If you’ve looked at who participates here, it’s heavily male.
5) Why not keep working on face detection? Because they learned through user testing that they’d never be able to make it good enough. They found that by focusing on visual image searches they can get a much more satisfied user base.

More  here and here.

Programming Rules of Thumb – On Comments

Duncan Merrion, the original author of the seven rules, left a comment on my previous post :

The secret to investing is “buy low, sell high”. (Also, the secret to carpentry is “measure twice, cut once” ) – this doesn’t mean if you only do this you will be a successful investor (or carpenter) but rather that if you are a successful investor (or carpenter) you will do this as a habit.

This is what i was aiming for with the 7 secrets article – although much subsequent reading (it was written about 5 years ago) has convinced me that hungarian notation is not a good thing at all, and the comment often, comment well paragraph needs to be rewritten but I still stand by the article as a whole.

Ok. I’m sure we can all find somthing to trash about  someone else’s philisophy, specially when it comes to programming. I myself prefer doing the user interface first. That gives me a clear idea of how my how my data structures will work.Not that ialwyas do that. The UI and the data classes usually evolve at the some time. I find a probelem i one that requires a twaek in the other. Not everyone would agree with that. Some would have it that as a process: one does the data, the other does the UI and still another ties it all together.  So esentially we al have our own philosphy. This can and oes change moving programming language. Visual Basic 2005 is nearly english. All you have to do is pick the right variable and function names and you’re most of the way to self documenting code. C/C++ and even C# to an extent have different syntax to Vb2005 and require more commenting. But on the whole, comments are extremely useful. There are times when a function or a procedure is simply too complex. This is especially the prblem in C/C++ as the amount of things you can do on a simgle line is far greater than VB. In VB you van have a series of function calls that return data to the next function

i.e x= Function1(function2(function3())).

Not that that is the best way of doing it. But that is what sometimes happens. If you change it to sothing more readable. I’ll take Pythagoras as an example :

 a = calculatedistance(Squarepoints(getpointsBC()))

And viola: readable code. And to an extent, self documenting. What are the points being retunrned. What distance is it getting. Why? All this can be put into the comments. The code surrounding this line might well explin it. so its a 50/50 solution that changes from programmer to programmer. It might be helpful siomply to add comments once the program is completed for others to read ( or for you to read come maintanence time).

Duncan metions some of this in his post that he reffered me to. So, as he puts all the above:

Additionally the source code is only self-documenting to someone who has a good knowledge of the programming language that the source code is written in. However it is often the case that the person who has the best understanding of the problem space (be they a business analyst, end client or whatever) does not have sufficient developer experience to be able to read the code itself.

A good comment states the intent of the code to which it applies in the language of the problem domain but does not describe the computation operations being performed.

I completely forgot the other reason he gives for comments. The fact that the expert in the problem sapce, as he puts it, needs tro be able to understand what the code is doing, rather than the code itself. A Mathematitian would express Pythagoras as a(squared) = b(squared)+ c(squared). Although the function names above are descriptive ( since the function names are there to remind us of the job they are doing, rather than their internal workings), the above mentioned math geek would have to be told that htta’s what this line of code is doing- commets. Thus a mathematitiance would undersand Pythagoras as:

a^2 + b^2 = c^2. \, 

The math geek is happy becuase he knows whats going on and can make sure the function works .

All the seven Rules needs is a title change and a change of perspective: they are tips, not royal decrees (or NFL rules). The article highlights seven areas that programmers find helpful in certain situations. We could go into enormous detail about the ins and outs of progrgramming and turning out good code. But, with alittle updataing ( the article is five years old), it’ll do the article a world of a difference.

Programming Rules of Thumb (Updated)

The facts is there arn’t any, as I found in this excellent post. Kudos to WordPress (again) for their dashboard which directed me to this post.

Back to the post. I can’t agree more with it. The reply to The Seven Secrets of Sucessful Programmers is nothing short of a no brainer. All the seven Rules needs is a title change and a change of perspective: they are tips, not royal decrees (or NFL rules).The Seven rants highlights this differnce of perspective.

The Seven Rants post is rather good, condensing and updating the gist of Code Complete.

Don’t take me wrong. I don’t think there’s anything evil in trying to convey hard won lessons in little capsules. Otherwise, i wouldn’t be writing these musings in the first place. It’s just that i dislike oversimplifications; they go hand in hand with the notion that programming is just something to be done by underpaid coding monkeys, or that it should be as easy as clicking around with a mouse.

Which is, belive it or not, somthing that most people outside the programming world think. I’ll ask around and get more on this but, thats generally it. The truth is the total opposite of that. Programming is far, far from easy. Found that out myself last year. Both my projects for Semester 2 had so many bugs in them that I couldn’t bother fixing them. The programs should have worked like dreams ( one of them did, nearly) but didin’t for no reason I could ever figure out.

I was wondering myself about commenting. Self documenting code gets even easier to write in Visual Basic 2005. Why bother commenting?

In my experience, the need to explain what a snippet of code is doing with a comment is a sure indication of bad coding. Good code is self-explanatory and needs few, if any, comments. Otherwise, you did something wrong, be it bad naming or poor function breakdown. Not to mention the issue of keeping comments and code synchronized during rewrites. So here’s my secret number 2: comment seldom, write self-documenting code instead. This will make your programs not only easier to understand and maintain, but of better quality.

Of course, aside from naming variables and bad code, Visual Basic takes care of most of this for you. Indenting is automatic by default. Exceptions are easy to handle. Scope is done by default. Its pretty good. Its the coding part that brings you up short time and time again. Even for the simplest subroutines it can take a while. I once wrote a Pythagoras Function ( to work out return right angles). I had to get my high school textbooks out and give WikiPedia a look. It took time to get the code right to work in all cases.

Pure programming is a rare thing. Programmers work with real world concepts ( abstracted, maybe)  and getting computers to do the same is essentially our job. And we need every good tool that we can get our hands on .

Another blog to add to my blogroll.

Update: Here