Google Android and the CLI

Today morning I was reading about Brad AdamsGoing Google and ruminating about what he wanted to do there when several earlier articles I had read suddenly came together and I had an inspiration that I thought I’d blog.

It would by really cool if Brad and Tim Bray (who recently left Sun and joined Google Android) get together and implement the CLI on the Android OS.

Brad is one of the architects of the CLI and has been one of the main driving forces behind the development of the .NET framework and it’s adoption. He is currently looking at what he wants to do when he starts at Google. He mentioned that he thinks the cloud plus devices is one of the dominant trends of the future and I agree.

I think the Android OS is an important part of this future and currently I am frustrated that there is only Java support for developing in it. Tim shares my frustrations and he is looking at getting other languages supported in the Android OS.  He is looking at Ruby right now – it’s open source and a dynamic language and it makes sense . But I feel the CLI (which is an open ECMA specification) is a great fit for the Android OS because it can be used to as a basis to quickly support a lot of languages.  Besides as a .NET developer myself, I think that having the capability to develop Android applications in C# or IronPython is a far more palatable proposition than doing it in Java :-)

I saw this article by Miguel de Icaza where he puts out an idea to incorporate the CLI into the browser engine so that we could use languages other than Javascript in our client-side scripting (my take on that is here). It occurs to me that it should be similarly possible to bring it into the Android OS as well.  There are currently efforts to port Mono that could be used as a starting point.

So what say guys – can we get the .NET CLI in Google Android ?  Become the opposite of the Apple iPhone and embrace developers instead of driving them away :-)

Commented code is a bad code smell

This is a rant about commented code.

Have you ever seen projects with many thousands of line of code that have a significant portion of the code commented out ? I am not talking about descriptive or explanatory comments about what the code does – I mean where the code block itself is commented …

Leaving the commented code in an application lowers the readability of code in the application. Today, source control systems are ubiquitous in software projects – so why do people still comment code and leave it rather than deleting it completely? It simply serves no purpose other than increasing code bloat.

We all do it of course – usually while debugging or understanding code. To discover if a piece of code is used in the application – it is sometimes easy to simply comment the code and let the compiler tell you where it is called from.

But, once we finish we should ether delete the commented code or un-comment it. Commenting code is, at best, a stop gap measure and IMHO a rank code smell indicating that you should probably create a code branch for your code for your experimentation.

It is quite tedious and frustrating to have to pick out the blocks of actual code from between the often, vast stretches, of commented code. Let us, as professional developers, develop the habit of never leaving any such code cruft in anything that we check in to a project !

, ,

Quietube – Readability for videos

I was thinking a few weeks back, while wading though yet another banner ad heavy website to get to a video, about asking the folks behind Readability for something similar for videos. I filed away the thought for later and soon forgot about it (I think this is why I am not a millionaire ;-)).  Anyway, while going through other blog posts on Readability the other day I came across this one from a fellow Readability enthusiast from Brazil – right at the bottom was the link to this gem.  Et´ Voila ! Solution found – this is why I love the internet :-)

Quietube is exactly what I was thinking about – its Readability for internet videos !
Even the installation is similar -

  1. Go to the Quietube installation page.
  2. Drag the bookmarklet on to your bookmarks toolbar or add it to your bookmarks.
  3. When you are in a one of the big internet video websites (YouTube, BBC iPlayer, Viddler, and Vimeo are supported) – click on the bookmarklet and you can see the video without any of the comments and distracting fluff.
  4. A link is also available at the bottom of the page enabling you to send this view of the video to a friend or save it for further viewing.

The tool is built by BookTwo and from the blog post it seems its a side project inspired by Readability. The tool is currently limited, in that it does not detect embedded videos in other websites (and the error message seems a bit cheeky ;-)) but they are working on improving this. Another problem is that there seems to be no mechanism to report issues to the group like Readability. On the whole this seem to be a useful tool for those who want to quietly watch a video without all the bells and whistles :-)

, , , ,

Readability – Transform the way you read on the web !

I love reading – I read books, articles, magazines, circulars, just about anything I can lay my eyes on… Naturally, I am a voracious reader in the Internet as well – I have subscribed to a huge number of RSS feeds, and  have a constant stream of Twitter tweets on articles to read.

The problem, I face when reading on the internet is, eye fatigue – I have astigmatism and the varying fonts faces, sizes and colors is a strain – even to normal people with perfect sight ! Couple this with the increasing number of advertising on the top and on the side of articles and you have a situation where the actual content is increasingly obscured. Font sizes are getting smaller and smaller and content is getting squeezed more and more by advertising and marketing clutter.

Of late, I have been using a tool that I found on the web (I saw it on Twitter but I have unfortunately been unable to track who sent it to me :-( ) that has literally transformed my reading experience. It was created by a company called Arc90 and is a Bookmarklet which can dragged onto your browser bookmarks. When you click on it – it  reloads the current page loaded in your browser stripped all extraneous fluff.  Simply the content of the page is shown.

As a web-developer and general internet addict ;-), I have seen a lot of tools and gadgets and I like to think I have a good idea of what works – as soon as I saw this tool I knew this would be awesome. The concept is simple, powerful – elegant.  It is one of those things
that seem so obvious  – when you feel that way – you know you are seeing a work of genius.

What you need to do to get this gadget is  -

  1. Go to the Readability installation page
  2. Choose from the simple options given there how you want your content to be displayed – the options are simple and straightforward giving you a choice of reading style, font size and margin width (I chose eBook style, large size and narrow margin). A sample text is shown with the formatting you choose so you can play with the options.
  3. Once you are satisfied, simply drag the big button marked “Readability” onto your bookmark toolbar (or you can right click the link and choose the bookmark option) and your done !
  4. Next time you are on a web-page with a compelling article being obscured by garish ads and decorations, simply click on the Bookmarklet and the page reloads with the content formatted exactly as you want it.

When I first installed it they had fewer options and every once in awhile it would not work – but they have been going from strength to strength with new options and it’s rare to see it not work.

This tool has certainly transformed how I read on the web – I can’t recommend this tool enough!!  So what are you waiting for – go get it !! :-)

PS: It won the NY Times Pogy award for best idea of 2009

, , , ,

Visual Studio .NET 2003 and Windows 7 can get along – Seriously…

I know, I know – VS.NET 2003 is not supported on Windows Vista and above.  In fact Microsoft in their all-knowing wisdom went ahead and supported Visual Studio 6.0 on Vista, but not VS.NET 2003 !!

I don’t know if this speaks to the crappy nature of the VS.NET 2003 product or to weird resource constraints or some other theory (insert favorite MS conspiracy theory here) . The list of supported versions of the Visual Studio product line are AFAIK as follows-

  • Visual Studio 6.0 – Supported on Windows 7
  • Visual Studio 2002 – Not supported on Windows 7
  • Visual Studio 2003 – Not supported on Windows 7
  • Visual Studio 2005 SP 1- Supported on Windows 7
  • Visual Studio 2008 – Supported on Windows 7

So VS.NET 2003 and Window 7 are officially not on speaking terms – but the fact remains I need VS.NET 2003 for my job. Just because MS does not support it – I can’t NOT use it so despite all the warnings we went ahead and installed the darn thing and you know what – it installs – and runs (after a fashion)!  The annoying dialog declaring that the program is not supported is easily dismissed – there is a check box allowing you to block it from appearing again.  Debugging needs you to run in administrator mode – you can set this by right-clicking the shortcut choosing properties and then the compatibility sub-tab – there is a check-box to always run the program as administrator.

The next challenge was VS.NET 2003 refused to load my web projects so I went about looking for a way to set this up…  I opened up the IIS manager and boy let me tell you the IIS manager for IIS 7 is totally different from the IIS 5.0 and IIS 6.0 managers. You can configure everything down to the individual web.config files with this thing. Luckily running ASP.NET 1.1 on IIS7 is supported even though VS.NET 2003 is not so MS provided some helpful articles on IIS.NET – I found this article whose instructions I followed. There were some further gotchas that I encountered that you might be interested in knowing about -

  • I installed VS.NET 2003 SP1 to overcome a compilation problem. Apparently SP1 addresses these issues that occur when you have solutions with a large number of projects.
  • A weird thing is that sometimes the client scripts that are installed with ASP.NET 1.1 do not get properly installed – you need to run “aspnet_regiis” utility with the “-c” option from the command line to ensure it is properly installed.
  • I needed to install “Directory Browsing” from “Control Panel -> Programs -> Turn Windows Features On and Off ” and then switch on directory browsing for the main web-root (theoretically you can over-ride the web-root setting in the individual web project using the web.config files but ASP.NET 1.1 project web.config files are not supported apparently). You need directory browsing to be available in order to add the web-project to your solution from VS.NET 2003
  • You need to be part of the debugger users group on your computer in order to be able to do F5 debugging of your web project.
  • If you want to search across a project or a solution  to work then you need to tweak the compatibility settings . You can do this by right clicking the shortcut to launch VS.NET 2003 and selecting properties, choosing the “Compatibility” sub-tab and then checking “Disable Desktop Compositing” as well as “Disable Visual Themes” .(I got this tip from an answer to a question I posted on Stack Overflow).
  • If you partition your hard drive, make sure you allocate at least double what you used to allocate for the system (C:) drive when you were running on windows – not only is Windows 7 bigger, it needs more RAM and consequently your pagefile is bigger as well. Not to mention you will inevitably install VS.NET 2008 as well as VS.NET 2003 (after all that is the future right) and all the other goodies you had ;-)

Once you have done all this, things are more or less OK – performance is not much better or worse than XP but that’s probably more VS.NET 2003 than Windows 7.  So despite all the warnings and recommendations to use XP in a virtual machine (with 2 GB of RAM at my disposal – yeah right!!) here I am running VS.NET 2003 on Windows 7.  Overall, I think Windows 7 is a cool OS but the experience for me is marred due to reality of having to coax it to work with VS.NET 2003. In my firm – moving everything (and there is a LOT)  to a newer version of .NET is quite understandably a low priority given the economic climate – besides by the time we discuss and negotiate and decide to move MS has already come out with a newer version of everything ;-).

Well HTH  :-)

Take care y’all and be good ;-)

Update: Another blog entry you might be interested in is here.

,