Wednesday, November 24, 2010

Static Vs Dynamic Vs Embedded Vs Entity SQL

Structured Query Language (SQL) is a way to communicate with a relational database that lets you define, query, modify, and control the data. Using SQL syntax, you can construct a statement that extracts records according to criteria you specify (I know, you know that). However, there are certain flavors of SQL, which you should be aware of like Static SQL, Dynamic SQL and Embedded SQL, to better understand and apply them, as and when required.

With .NET you would also end up using Entity SQL, which when used with Entities (as in the Entity Framework), could eventually generate dynamic SQL, executing and returning results as entities.

Static SQL: The most commonly used type of SQL, static SQL, as its name implies allows you to fulfill your data access requirements, which might be known to you at design time of your application. Having static SQL queries can lead to better performance, since the queries are not required to be parsed every time before being executed.

Dynamic SQL: There are instances of applications where the data to be processed cannot be determined at the design time of the application. A typical example would be processing of a spreadsheet, which in turn can contain variable number of columns, and the program is needed to process and store the data into the database. Typically, you would generate a string value with the columns and send across the database to process it.

The following points are to be considered:

  • Since the database engine doesn’t have an access plan, it would parse, compile and generate an access plan. Hence dynamic SQL is slower than static SQL.
  • EXECUTE IMMEDIATE statement can be used to execute the dynamic SQL statement, which in turn passes the SQL to database for compilation and execution.
  • The problem with EXECUTE IMMEDIATE is that the database would be executing each of the 5 steps of processing SQL statement and the overhead could be significant for multiple dynamic statements executed at once.
  • Dynamic SQL offers optimization via prepared execution whereby all the host variables are replaced by a question mark (?), known as parameter marker, which can be substituted later with the host value. The PREPARE statement is used by the program to pass the SQL statement to the DBMS for parsing, validation and optimizing the statement. The EXECUTE statement is used instead of the EXECUTE IMMEDIATE statement, and the parameter values are supplied via a special data structure called the SQLDA or SQL Data Area. By having the execute statement and supplying different parameter values, optimization is gained over the EXECUTE IMMEDIATE statement.
  • It is to be noted that PREPARED execution is still slower than static SQL since with static SQL the first 4 steps of processing takes place at compile time, whereas with PREPARED execution, they are still executed at runtime, however, only for the first time.

Embedded SQL: Because SQL does not use variables and control-of-flow statements, it is often used as a database sublanguage that can be added to a program written in a conventional programming language, such as C or COBOL. This is a central idea of embedded SQL: placing SQL statements in a program written in a host programming language.

The following points are to be considered:

  • Embedded SQL is processed by a special SQL precompiler.
  • Host language variables can be used in place of the constants in the SQL statements.
  • To optimize the SQL which returns a single row as a result, singleton SELECT statements are used.
  • Statements that return and require multiple rows are processed using CURSORS.
  • Errors while executing Embedded SQL are reported to the application programs via SQL Communications Area or SQLCA.

Disclaimer: The following does not directly relate to databases and are features specific to the Microsoft .NET Framework.

Typically you would be developing an application to access the data stored in the databases. Relational databases provide specific added advantages and are widely used in the general business applications domain. Microsoft .NET 3.5 SP1 introduced Entity Framework, which in turn allows you to model your database objects as entities, which may or may not be inter related, and provides an abstracted way to process them via Entity SQL or LINQ to Entities.

Entity SQL: Entity SQL is a SQL-like language that enables you to query conceptual models in the Entity Framework. Conceptual models represent data as entities and relationships, and Entity SQL allows you to query those entities and relationships in a format that is familiar to those who have used SQL.

The following points are to be considered:

  • Entity SQL supports conceptual model features like relationships and inheritance.
  • Collections are treated as first class citizens in Entity SQL, hence set operators like UNION, INTERSECT and EXCEPT, work on collections.
  • Everything in Entity SQL is an expression which in turn enables it to be more composable than Transact SQL (the SQL language of Microsoft SQL Server).
  • Entity SQL doesn’t support the * construct, and hence the count(*) statement is invalid, instead use count(0).
  • Entity SQL supports a subset of Transact-SQL's built in functions and operators and does not provide support for DDL in the current version.

LINQ to Entities provides Language-Integrated Query (LINQ) support that enables developers to write queries against the Entity Framework conceptual model using Visual Basic or Visual C#. Queries against the Entity Framework are represented by command tree queries, which execute against the object context. LINQ to Entities converts Language-Integrated Queries (LINQ) queries to command tree queries, executes the queries against the Entity Framework, and returns objects that can be used by both the Entity Framework and LINQ. MSDN

The above mentioned constitutes literally all the typical types of SQL related concepts that you might encounter in your general database (relational) programming tasks day-in-day-out or in any developer centric interview session.

As always, you are welcome to share any ideas or thoughts about any other flavor of SQL, which you might have encountered.

Prepare > Execute!

Monday, November 15, 2010

WPF – An Overview

Ever since Windows Vista (sorry Microsoft, for reminding you of that product again) and .NET Framework 3.0 were released, the Windows client developer (the one who is intentionally unaware and exceedingly pleasured by ignoring JS, HTML, DHTML and other useless irrelevant terms in technology) was puzzled with an (frankly) unwanted choice that never existed for him before: continue using the ultimately productive Windows Forms framework, that has been the cornerstone of Windows client applications ever since Visual Basic (classic), or learn, explore and rewrite the apps in the WPF framework for building (what’s now become an overly exploited term in software development) next generation user experiences.

Microsoft has always assured (many consider it a curse) its developers of continued abundance of options and tooling support for all the major line of business applications that one develops. While this has obvious and much desired advantages, the real problem comes in at the start of the adoption phase of the new technology or framework. The earlier releases of the framework don’t (in almost all cases) provide a complete replacement of the previous technology and there is a very steep learning curve involved, with an exceedingly high cost and risk factor in recreating the missing bits, by extending the not so feature complete releases.

My personal approach while dealing with this new-technology-every-PDC kind of releases is fairly simple:

Version Action

Alpha/Beta/CTP or

Just be aware, a new (yet again awesome, silver bullet kind of) technology has arrived!


Seems interesting, lets look at the real benefits.


Use it (OMG, its actually awesome and the silver bullet for everything a MS developer ever needed)

WPF (codename Avalon) was launched with .NET Framework 3.0 and at its time of release, had a substandard support in terms of tooling. Mr. Reader, be informed, that this is not a WPF tutorial series on how to get started with WPF. The attempt is to dive (as deep as possible) into the architecture of WPF and to understand why things are the way they are in WPF.

Windows & Graphics: The primary technologies behind many Windows-based user interfaces, GDI (graphics device interface) and USER subsystems, were introduced with Windows 1.0 in 1985. The next major support for graphics came with OpenGL (created by Silicon Graphics) in early 1990s for doing advanced 2-D and 3-D graphics on both Windows and non-Windows based systems. In 1995, Microsoft introduced DirectX, for providing a new high performance alternative for 2-D graphics, input, sound, communications and eventually 3-D (with DirectX 2 in 1996). With Windows XP, GDI+ was introduced by adding support for alpha blending and gradient brushes, but ended up being slower due to its complexity and lack of hardware acceleration.

With the release of .NET (and the managed world) in 2002, Windows Forms (built on top of GDI+) became the primary way for a C# or Visual Basic developer, to create rich and compelling user interfaces for Windows based systems. Windows Forms has proved itself as a productive and successful technology, but it still suffers from the limitations of GDI+ and USER subsystems, when it comes to graphics, layouts and rendering.

Major Components of WPF

In the adjoining image, the major code for WPF are highlighted in red, and its interesting to note, that out of the three components (PresentationFramework, PresentationCore and MilCore), only MilCore is unmanaged. Milcore is written in unmanaged code in order to enable tight integration with DirectX. All display in WPF is done through the DirectX engine, allowing for efficient hardware and software rendering. WPF also required fine control over memory and execution. The composition engine in milcore is extremely performance sensitive, and required giving up many advantages of the CLR to gain performance.

The Dispatcher:The DispatcherObject acts as a base class for most objects in WPF and encapsulates the basic constructs for concurrency and threading. The Dispatcher is the messaging system of WPF, which acts similar to the Win32 message pump and uses User32 messages for performing cross thread calls.

Dependency Object and richer Property system: In WPF, properties are preferred over methods or events and this constitutes one of the primary philosophies of the WPF architecture. The property system in WPF is based on the DependencyObject which enables tracking of dependency properties and revalidating values when changes occur. Another feature of properties in WPF is the notion of “attached properties”, which enables composition and component reuse, one of the primary goals of WPF. With attached properties, any object can now specify the properties of other objects, enabling tighter composition.

Routed Events: WPF introduces Routed Events, which from an implementation perspective, is an object backed by an instance of the RoutedEvent class and processed by the event system. From a functional perspective, it is a type of event that can invoke handlers on multiple listeners in an element tree, rather than just on the object that raised the event. Since WPF enables richer composition model, it was essential for the event system to be able to “bubble up” events, generally upward through the element tree, until it reaches the root. It is to be noted that in WPF, literally any control can act as a container control, unlike Windows Forms where container controls inherited from a different base class. To enable routed events, or event bubbling in Windows Forms, you would have to attach the same event to multiple elements, while in WPF, you could do that by attaching them to a single element.

XAML (Xml Application Markup Language): The current trend in programming languages (specifically Microsoft technologies) has been towards declarative rather than imperative, and there are underlying benefits to it. XAML typically allows you to create the entire application declaratively, enabling the decoupling of the UI with the logic, supporting unprecedented designer-developer collaboration.
XAML directly represents the instantiation of objects in a specific set of backing types defined in assemblies. This is unlike most other markup languages, which are typically an interpreted language without such a direct tie to a backing type system. XAML enables a workflow where separate parties can work on the UI and the logic of an application, using potentially different tools.” – MSDN

The intent of this post is to provide a starting point in understanding the complexities and terminologies associated with the WPF architecture. I wish and hope, the initial hesitation associated with moving to and understanding WPF, is eased after going through this post. As with any framework, the best way to learn and leverage it still remains to be writing applications using it!


Tuesday, October 12, 2010

77 Outright Rajinikanth Facts

For those of you who were so unfortunate to not know about the Rajinikanth, here is a tip of the iceberg about him. Of course I understand you were amongst the unfortunate who were exiled to the planet Pluto, (all other planets are aware of Rajinikanth) and couldn’t keep up with the most illusive force on planet Earth.

What follows are 77 outright (an understatement indeed) facts about the man himself that demystifies (more than what Da Vinci did) literally every fact that you have ever known or would ever know. Some of the facts mentioned below are highlighted to do the intended justice.

Disclaimer: All the following facts, incidents or individuals involved are real and any resemblance to any person, living or dead is purely intentional.

  1. Rajinikanth killed the Dead Sea.
  2. When Rajinikanth does push-ups, he isn't lifting himself up. He is pushing the earth down.
  3. There is no such thing as evolution; it's just a list of creatures that Rajinikanth allowed to live.
  4. Rajinikanth gave Mona Lisa that smile.
  5. Rajinikanth can divide by zero.
  6. Rajinikanth can judge a book by its cover.
  7. Rajinikanth can drown a fish.
  8. Rajinikanth can delete the Recycle Bin.
  9. Rajinikanth once got into a fight with a VCR player. Now it plays DVDs.
  10. Rajinikanth can slam a revolving door.
  11. Rajinikanth once kicked a horse in the chin. Its descendants are today called giraffes.
  12. Rajinikanth once ordered a plate of Idli in McDonald's, and got it.
  13. Rajinikanth can win at Solitaire with only 18 cards.
  14. The Bermuda Triangle used to be the Bermuda Square, until Rajinikanth kicked one of the corners off.
  15. Rajinikanth can strangle you with a cordless phone.
  16. Rajinikanth destroyed the periodic table, because he only recognizes the element of surprise.
  17. Rajinikanth can watch the show 60 minutes in 20 minutes.
  18. Rajinikanth has counted to infinity, twice.
  19. Rajinikanth will attain separate statehood in 2013.
  20. Rajinikanth did in fact, build Rome in a day.
  21. Rajinikanth once got into a knife-fight. The knife lost.
  22. Rajinikanth can play the violin with a piano.
  23. Rajinikanth never wet his bed as a child. The bed wet itself in fear.
  24. The only man who ever outsmarted Rajinikanth was Stephen Hawking, and he got what he deserved.
  25. Rajinikanth doesn't breathe. Air hides in his lungs for protection.
  26. There are no weapons of mass destruction in Iraq. Rajinikanth lives in Chennai.
  27. Rajinikanth kills Harry Potter in the eighth book.
  28. Rajinikanth does not own a stove, oven, or microwave, because revenge is a dish best served cold.
  29. Rajinikanth has already been to Mars, that's why there are no signs of life there.
  30. Rajinikanth doesn't move at the speed of light. Light moves at the speed of Rajinikanth.
  31. Water boils faster when Rajinikanth stares at it.
  32. Rajinikanth kills two stones with one bird.
  33. Google won't find Rajinikanth because you don't find Rajinikanth; Rajinikanth finds you.
  34. Rajinikanth gave the Joker those scars.
  35. Rajinikanth leaves messages before the beep.
  36. Rajinikanth electrocuted the Iron Man.
  37. Rajinikanth killed Spiderman using Baygon Anti Bug Spray.
  38. Rajinikanth can make PCs better than the Mac.
  39. Rajinikanth goes to court and sentences the judge.
  40. Rajinikanth can handle the truth.
  41. Rajinikanth can teach old dog new tricks.
  42. Rajinikanth calls Voldemort by his name.
  43. Rajinikanth's calendar goes straight from March 31st to April 2nd, no one fools Rajinikanth.
  44. The last time Rajinikanth killed someone, he slapped himself to do it. The other guy just disintegrated. Resonance.
  45. Rajinikanth is so fast, he can run around the world and punch himself in the back of the head.
  46. Rajinikanth once ate an entire bottle of sleeping pills. They made him blink.
  47. Rajinikanth does not get frostbite. Rajinikanth bites frost.
  48. Rajinikanth doesn't wear a watch. He decides what time it is.
  49. Rajinikanth got his driver’s license at the age of 16 seconds.
  50. When you say "no one is perfect", Rajinikanth takes this as a personal insult.
  51. In an average living room there are 1,242 objects Rajinikanth could use to kill you, including the room itself.
  52. Words like awesomeness, brilliance, legendary etc. were added to the dictionary in the year 1949. That was the year Rajinikanth was born.
  53. The statement "nobody can cheat death” is a personal insult to Rajinikanth. He cheats and fools death every day.
  54. When Rajinikanth is asked to kill someone he doesn't know, he shoots the bullet and directs it the day he finds out.
  55. Rajinikanth can double click 2 icons at the same time.
  56. Rajinikanth doesn't answer nature's call; nature answers Rajinikanth's call.
  57. Rajinikanth house has no doors, only walls that he walks through.
  58. Rajinikanth is the only man to ever defeat a brick wall in a game of tennis.
  59. When Rajinikanth plays Monopoly, it affects the actual world economy.
  60. Rajinikanth does not style his hair. It lies perfectly in place out of sheer terror.
  61. Rajinikanth‘s first job was as a bus conductor. There were no survivors.
  62. If at first you don't succeed, you're not Rajinikanth.
  63. We live in an expanding universe. All of it is trying to get away from Rajinikanth.
  64. Once a cobra bit Rajinikanth' leg. After five days of excruciating pain, the cobra died.
  65. There is no such thing as global warming. Rajinikanth was feeling cold, so brought the sun closer to heat the earth up.
  66. Archaeologists unearthed an old English dictionary dating back to the year 1236. It defined "victim" as "one who has encountered Rajinikanth".
  67. Rajinikanth doesn't bowl strikes, he just knocks down one pin and the other nine faint out of fear.
  68. Rajinikanth's every step creates a mini whirlwind. Hurricane Katrina was the result of a morning jog.
  69. Rajinikanth doesn't shower. He only takes blood baths.
  70. Rajinikanth can answer a missed call.
  71. As a child when Rajinikanth had dyslexia, he simply re-scripted the alphabet.
  72. Rajinikanth sneezed only once in his entire life, that's when the tsunami occurred in the Indian Ocean.
  73. Time and tide wait for Rajinikanth.
  74. Rajinikanth knows what women really want.
  75. Rajinikanth can give pain to Painkillers and headache to Anacin.
  76. Rajinikanth has a wax statue of Madame Tussauds in his house!
  77. ‎Once Dinosaurs borrowed money from Rajinikanth and refused to pay him back. That was the last time anyone saw Dinosaurs.

Dare not doubt on any of the above mentioned facts, for they are true to the last bit that stores them on the screen.

The inspiration of the post came from the movie Robot (Endhiran), the mention of which, should indefinitely terminate all the questions that might be jumping on and off your head.

Feel free to contribute any other notable fact about the Rajinikanth (and yes, its Rajini and not Rajni).

Mind it™!

Thursday, September 23, 2010

The Self-Adaptable Software

Indelicately speaking, self-adaptable software is any software (specialized or otherwise) that has the ability to respond to the needs of the users and doesn’t completely depend on the operating environment and is further proficient in dealing with faults, curtailing the chances of partial or complete failures. At its core it’s flexible. With flexibility, comes complexity. But then, we are software developers, and complexity is as native to us, as pointers to C/C++ (no pun intended).

I am a decently mini-pro type of a PC gamer (I am proud of it, even though its mini) and was trying out FIFA 2010 on my PC with an NVidia GeForce 8400GS graphics card installed onto it. As is true for all the recently launched games, on-board graphics simply doesn’t suffice their needs. They humbly need more powerful GPUs to render the superior graphics intensive characters, surroundings and their interactions. On the beautiful start of a weekend (yes I can still recall, it was a beautiful Saturday morning) my graphics card passed away (pardon me for my emotions, but they are as real as the real data-type).

Utterly shattered, with muted curses to everyone including luck, hardware industry, vendors and my by-now torn off warranty card (it had expired 3months ago); I reverted my display onto the onboard graphics display and began lamenting on the lost opportunities of scoring goals (so what if they were virtual). Being a programmer, and the huge belief (read disbelief) I have with fellow programmers, I decided to run FIFA 2010 without a GPU. To be frank, I was curious to see the error message and the entire experience from the user’s point of view. The introductory video played off, and I was certain of it being a video file with absolutely no requirements of the GPU. The menu came up and I loaded my profile and started a fixture.

“Awesome! EA is all that I shouted (I actually did). The game ran on software renderer, the graphics were of lower quality, shadows had vanished, the ground looked pale and the players could never look more than androids (read robots). To sum it up, the game was playable and it had adapted to the software renderer seamlessly. A good deal of animation still persisted while really GPU intensive operations were skipped and that didn’t bother me the least. As a user, I was not deprived of my primary objective of playing the game thanks to the self-adaptive graphics system built into the software (i.e. the game). At the core of everything, I sighed
“Why couldn’t all software self-adapt?”

Most of us, most of the times, skip the process of even thinking (forget developing) adaptable systems either because it’s precisely not in the scope of the SRS or maybe it’s not cost effective enough and doesn’t provide the expected ROI. Not only do we expect users to use the software as we intend, we end up limiting their capabilities and implied rights to have self-correcting systems.

To avoid being misinterpreted I don’t intend to make a LOB application go AI and do crazy stuffs. A common scenario of network related dependency can be cited as an example of the ill-intent to not create self-adaptive software. Network turbulence recursively entails us to go berserk almost every day and we wish (at least I wish) the network dependent, and not merely network connected app, could do and let me do something offline.

The issue is not merely of OCA or occasionally connected applications. There could (and would) be plenty of scenarios where we, as developers, limit the users from experiencing the app in a limited way.

Have you recently encountered any of them?

if ( answer == true )

Happy Adapting!

Sunday, August 1, 2010

Being Numero Uno!

Half a decade into the technology industry, primarily software development, and post working on varied nature projects, with some of the most diligent and unswerving programmers I ever came across, this intends to be a succinct summary of what in essence could assist in being the numero uno in the surroundings we live in. Even though some slices of this post relates to the Information Technology landscape, this could easily map to any other industry or sector you recognize.

Irrespective of the organizations I worked for, there always were few elite professionals that stood apart right from the inception. It was surprising to observe that they just excelled at a quantum pace while all others seem to have had trouble placing their foot in place. There were some common characteristics that could be discovered from their conduct and their supremacy in their relevant world.

Listed below are some of the base (deriving from my programming background in OOPS) characteristics that I came across which might propel you to the right track of being the chosen one (the Matrix effect):

  • Professionally yours: If you are one of the types who choose to dabble into the tasks assigned, you will wind up with a dabbled life. There'll be no satisfaction in it because there will be no real production you can be proud of. Society does not emphasize the importance of professionalism, so people tend to believe that amateur work is normal. Even businesses accept sub-standard results, but that shouldn’t ever be consumed as an excuse for being unprofessional in whatever you do. Our professional careers are a long and the most significant journey of our lives. Think twice before compromising on the output you contribute, the impact could be everlasting!

  • Evaluate feasibility not possibility: A common behavior exhibited by most software developers is to jump straight into the problem domain and declare or decide on its possibility. The elite are seldom concerned about the possibility of the solutions. Their seasoned experience and confidence allows them to leverage that advantage. What sets them apart is the ability to peek into the future and evaluate the scenarios that may curtail future existence of the business domain they are working in and contributing to. A practice that every software developer must inculcate is to consider himself/herself as a consultant and not an ordinary employee of an organization. Irrespective of the role you play, expand your horizon by placing yourself as a consultant to the client, the results would mostly be positive and obvious.

  • Context switching abilities: No matter where you work, and irrespective of the size of the team and the environment you are in, the key to understanding and infusing trust and confidence among fellow developer colleagues is to put yourself into their shoes before even distantly deciding to criticize their actions or doings. Very few amongst us have this unique and most wanted characteristic of being able to switch contexts and place ourselves in other’s place before deciding on issues relating to them. Conveying a mistake is way dissimilar than blaming it upon and most of the elite people I come across had a chiseled way of conveying the mistakes I kept constructing and it was more of learning than embarrassment.

  • Passion is the key: Long term success or real success is hard to achieve than short term or virtual success. And there is a very simple and almost overlooked reason for that. There are difficult times in the journey to real success when you feel like you are working for nothing, that you don’t get anything in return for all your effort. In such difficult times, only passion can keep you moving forward! The beauty of being passionate about the things you do is that it will show up in your work without you having to put that extra tiring effort.

  • Clearly defined goals: A pre-requisite to success and an omnipresent quality in the elite group of people, clear goals ensure and increase the chances to succeed by manifolds. Its importance can never be over-emphasized. While most of us compromise for short term goals, it is surprising to note that the top-notch pros compromise and adjust keeping in view the primary long term ones.

All of us have an innate desire to succeed and lead the space we exist in, either professionally or personally and the list above could well contribute in focusing on the more relevant spheres leading to our relevant destinations.

The motivation for this post came from a very small and surprisingly truthful and influential quote I read on success, which for me, answered approximately 90% of the questions I had left unanswered to myself:

“deserve before you desire!”

Saturday, July 17, 2010

Theme Up!

With the dawn of the last decade, user-centered design and end-user customization of literally every fragment of an application (web, client or phone) has taken a quantum leap. It has virtually become quintessential to have multiple ways of allowing end users to customize their experience with the software. With the advent of graphics cards and graphics accelerated hardware, pixels literally lit up, giving a whole new dimension to user experience and enabling creation of stunning user interfaces.
Abstraction, which is the dominantly prevailing concept, in every software methodology or framework today, impacted the design process as well, and what once was limited to selection of colors, got somewhat abstracted to selection of themes, even though the underlying idea was to only change the colors and at times, background graphics.
For business application (smart client or desktop) developers, the change was almost forced by popular applications like browsers, instant messaging tools and utility applications. It was amusing to note that even Antivirus applications themed their UI to better present their functionalities. The nail was hit by Microsoft’s Office suite v2007, when Office applications allowed users to select a theme for its UI.
Office 2007 themes
Once Office themed up, jinx, if any, that existed, preventing business apps from looking attractive was broken. It almost made it conventional for business applications to expose sleek interface that enabled innovative user experiences, irrespective of the type of application. Also, it enabled data entry applications to look far less tedious and cumbersome; a snap from them Dynamics CRM follows.
 Dynamics CRM data entry
The following is a list of some popular applications along with the associated resources to theme them. The list was never meant to be exhaustive, besides care has been exercised not to list untrusted sites to the extent possible.
Disclaimer: Users are informed to exercise caution before downloading third party extensions, themes and similar add-ons from untrusted sources.
  • Windows 7 – Prior to Windows 7, Microsoft didn’t provide an active support for themes to the earlier versions of Windows, primarily XP (and yes I almost forgot there was Vista too). The support was mostly commercial in nature from vendors, mostly Microsoft Partners. With Windows 7, a change in strategy implied better and newer themes for end-users thanks to the Themes gallery.
  • Visual Studio 2010 – Having a brand new code editor and huge chunks of it’s codebase in WPF enabled the extension developers of Visual Studio 2010 to incorporate themes into the most popular (I don’t care if you disagree) IDE of all times. Visual Studio color theme editor comes in with pre-defined themes and allows you to customize or create new themes.
  • Mozilla Firefox – The leading (again who cares if you disagree) open source browser incorporated and provided themes right from its early versions and an active community meant Firefox users never faced any scarcities in terms of themes. However, with Personas, a graduated project of Mozilla Labs, themes became lighter and somewhat better.
  • Twitter clients – The ever expanding universe of twitter clients is more of an amusing for me considering the fact that twitter is just slightly older than a toddler. Seesmic Desktop and MetroTwit surely standup for a mention with theme enabled sleek user interface.
  • Mobile Phone Themes: I regularly use themes from Zedge for my Nokia phone (5800 XpressMusic), and have found some certificate issues with the themes they list. Hence, exercise your judicious half before installing or even downloading any themes on your mobile phones.
  • WPF applications: As a WPF (Windows Presentation Foundation) developer, a good collection of themes is available from Codeplex.
  • Blogger themes: If you are like me and are overly uninterested by the default themes provided by blogger you may visit bTemplates for refreshing and mostly free blogger templates/themes.
  • Website themes: Looking for free website themes for general usage? Try OSWD.

The above mentioned are just some of the common popular apps that enable you to theme up the experience.

To conclude, I would like to mention some apps that I wish had themes, the sooner the better:

  • Internet Explorer – The most arrogant software ever sent to production tops my wish list for theme enabled apps. When the entire world embraced tabbed browsing, MS IE was arrogant enough to wait until v7 with undoubtedly the slowest implementation of tab switching. Continuing with its tradition, even now, with v8, it’s incapable of providing a simple downloads management snap-in. Microsoft has time and again ended up being complacent and literally handed over its market share to its competitors.
  • SQL Server Management Studio – Like every other Microsoft technology enthusiast, the legitimate next step with Management Studio seems to be a T-SQL IDE based on WPF and then following up with themes. Awaiting SQL Server 2012 may be (who knows?). There surely wouldn’t be Office 2013, so SQL Server 2013 seems unlikely too.

Please feel free to enlist any application that you use which already provides support for themes or should provide them at the earliest!

The list above only limits to the applications I use to ease out my work/good life.

Theme Up!

Sunday, June 27, 2010

Reacting to Exceptions

While preparing my slides for the Community Tech Days at Kolkata, I encountered a very interesting exceptional situation. Just to sync you up, I was evaluating Office 2010, specifically PowerPoint 2010. The very first slide had an effect exclusive to the 2010 version of PowerPoint. Just to check the compatibility I ran the slides on another system with PowerPoint 2007 version installed. To my amazement, the slides ran without any effects. No messages or warnings whatsoever! I went berserk (and FYI when I go berserk, that ends up into a new blog post).

The immediate question that spring up was: shouldn’t PowerPoint protest about missing effects? Should it just skip the problem-causing effect, and continue with the show (and prove itself to be robust) or at least caution the user about something that did go wrong at execution or runtime? This spawns up a simple yet important question for us developers: how should we react to exceptions that we don’t predominantly expect and when should we completely disregard them?

Missing effects in a PowerPoint show is surely not a consistent exception. In my personal view (and that’s what this blog is all about), the Office team has full rights to expect a v12 presentation to be opened with v12 of PowerPoint. When I ship an app’s v2 version and supposedly I have a custom document type registered with my application (say .vaibhav or .vaibhavx, to better match the document format trends), I surely would expect a v2 file to be opened by v2 of my app. If the user attempts to open my custom document with an earlier version, I would simply penalize the user for not using the most recent version of my app by throwing an exception, and maybe (I do this for fun) shutting the application. This, I believe is a common trail that most (if not all) of us take when determining on similar problems (saves time and heaps of code, trust me). But then, where exactly does app compatibility fit in?

Software is backwards or downwards compatible when it can work with input generated by an older version. If software designed for the new standard can receive, read, view or play older standards or formats, then the software is said to be backwards-compatible. Forward compatibility or upwards compatibility (sometimes confused with extensibility) is the ability of software to gracefully accept input intended for later versions of itself. The introduction of a forward compatible software technology implies that old software partly can understand data generated by new version of itself. A forward-compatible system is expected to "gracefully" handle input which is intended for a newer version, by ignoring the unknowns and selecting the known subset of the data that the system is capable of handling. Forward compatibility is harder to achieve than backward compatibility because a system needs to cope gracefully with an unknown future data format or requests for unknown future features.

The keyword above (for me at least) is graceful. But, should I leave the user in an indecisive status by removing the obtrusive exception messages? Will that tantamount to a tolerable UX (user experience)? Wouldn’t it be better if I could inform the user, what the problem was, and what its probable solution would (could) be?

How would you resolve a similar situation?

And in the meantime, let me continue to discipline my users with beautiful dialog boxes with subsequent calls to Application.Exit()

Happy Coding!

Saturday, June 5, 2010

Heard it somewhere!

The world it seems, is moving towards an age where an intellectual person will be judged based on the blog posts per week he writes, the tweets he generates (or regenerates) per day, the number of new jargons demystified or created by him per minute and the number of questions he answers per second on (think before you rule out the possibility of such a world in near future). To validate myself as a deserving citizen of that world (as and when it comes to existence), I went ahead to demystify certain words and phrases which the gigantic personas of technology in general (credit for the inspiration of this post should go to Erik Meijer, Anders Hejlsberg, Scott Hanselman, Scott Guthrie and so many more who couldn't be declared for genuine space constraints), often use without even considering the fact that some of their audience (read me and only me) have no idea of what that word or phrase corresponds to.
This is an attempt to collate certain phrases which most of us have heard numerous times but haven't essentially researched our way into understanding them comprehensively.
  • Domain Specific Language (DSL): It's a programming or specification language dedicated to a particular problem domain or a particular problem representation technique. The concept isn't new—special-purpose programming languages and all kinds of modeling/specification languages have always existed, but the term has become more popular due to the rise of domain-specific modeling. Examples of domain-specific languages include Logo for children, spreadsheet formulas and macros, SQL for relational database queries, YACC grammars for creating parsers, regular expressions for specifying lexers.
  • Mashup (Web application hybrid): In web development, a mashup is a web page or application that uses or combines data or functionality from two or many more external sources to create a new service. The term implies easy, fast integration, frequently using open APIs and data sources to produce enriching results that were not necessarily the original reason for producing the raw source data. In the past years, more and more web applications provide APIs that enable software developers to easily integrate data and functions instead of building it themselves. Mashups can be considered to have an active role in the evolution of social software and Web 2.0. The term mashup is also used to describe a remix of digital data.
  • Cloud computing: It is Internet-based computing, whereby shared resources, software and information are provided to computers and other devices on-demand. It is a paradigm shift following the shift from mainframe to client–server that preceded it in the early 1980s. Details are abstracted from the users who no longer have need of expertise in, or control over the technology infrastructure "in the cloud" that supports them. Cloud computing describes a new supplement, consumption and delivery model for IT services based on the Internet, and it typically involves the provision of dynamically scalable and often virtualized resources as a service over the Internet. It is a byproduct and consequence of the ease-of-access to remote computing sites provided by the Internet.
    The term "cloud" is used as a metaphor for the Internet, based on the cloud drawing used in the past to represent the telephone network, and later to depict the Internet in computer network diagrams as an abstraction of the underlying infrastructure it represents. Typical cloud computing providers deliver common business applications online which are accessed from another web service or software like a web browser, while the software and data are stored on servers.
  • Atom: It is an alternate XML format for easily sharing content, much like RSS Really Simple Syndication (format). Blogs for example, publish Atom feeds. Atom and RSS have very similar uses; the motivation behind Atom sprang from a desire to add improvements to the RSS specification. Apparently the keeper of the RSS specification froze the spec (declaring that RSS 2.0 would be the last version) and so the authors of Atom felt that a new format was necessary.
  • OAuth and OpenId: OAuth is a simple way to publish and interact with protected data. OAuth attempts to provide a standard way for developers to offer their services via an API without forcing their users to expose their passwords (and other credentials). OAuth is not an OpenID extension and at the specification level, shares only few things with OpenID – some common authors and the fact both are open specification in the realm of authentication and access control. If OAuth depended on OpenID, only OpenID services would be able to use it, and while OpenID is great, there are many applications where it is not suitable or desired. OAuth talks about getting users to grant access while OpenID talks about making sure the users are really who they say they are.
  • OData: The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. The protocol emerged from experiences implementing AtomPub clients and servers in a variety of products over the past several years.  OData is being used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites.
  • Mixin: In object-oriented programming languages, a mixin is a class that provides a certain functionality to be inherited by a subclass, while not meant for instantiation (the generation of objects of that class). Inheriting from a mixin is not a form of specialization but is rather a means of collecting functionality. A class may inherit most or all of its functionality from one or more mixins through multiple inheritance. Mixins encourage code reuse and avoid well-known pathologies associated with multiple inheritance. However, mixins introduce their own set of compromises. A mixin can also be viewed as an interface with implemented methods. When a class includes a mixin, the class implements the interface and includes, rather than inherits, all the mixin's attributes and methods. They become part of the class during compilation. Interestingly enough, mixins don't need to implement an interface. The advantage of implementing an interface is that instances of the class may be passed as parameters to methods requiring that interface. A mixin can defer definition and binding of methods until runtime, though attributes and instantiation parameters are still defined at compile time. This differs from the most widely-used approach, which originated in the programming language Simula, of defining all attributes, methods and initialization at compile time.
  • Monads: A monad is a construction that, given an underlying type system, embeds a corresponding type system (called the monadic type system) into it (that is, each monadic type acts as the underlying type). This monadic type system preserves all significant aspects of the underlying type system, while adding features particular to the monad. In functional programming, a monad is a kind of abstract data type used to represent computations (instead of data in the domain model). Monads allow the programmer to chain actions together to build a pipeline, in which each action is decorated with additional processing rules provided by the monad. Programs written in functional style can make use of monads to structure procedures that include sequenced operations, or to define arbitrary control flows (like handling concurrency, continuations, or exceptions). Formally, a monad is constructed by defining two operations (bind and return) and a type constructor M that must fulfill several properties to allow the correct composition of monadic functions (i.e. functions that use values from the monad as their arguments). The return operation takes a value from a plain type and puts it into a monadic container of type M. The bind operation performs the reverse process, extracting the original value from the container and passing it to the associated next function in the pipeline.
  • Type Safety: In computer science, type safety is the extent to which a programming language discourages or prevents type errors. A type error is erroneous or undesirable program behaviour caused by a discrepancy between differing data types. Type safety is sometimes alternatively considered to be a property of a computer program rather than the language in which that program is written; that is, some languages have type-safe facilities that can be circumvented by programmers who adopt practices that exhibit poor type safety. The formal type-theoretic definition of type safety is considerably stronger than what is understood by most programmers. Type enforcement can be static, catching potential errors at compile time, or dynamic, associating type information with values at run time and consulting them as needed to detect imminent errors, or a combination of both. Type safety is closely linked to memory safety, a restriction on the ability to copy arbitrary bit patterns from one memory location to another. For instance, in an implementation of a language that has some type t, such that some sequence of bits (of the appropriate length) does not represent a legitimate member of t, if that language allows data to be copied into a variable of type t, then it is not type-safe because such an operation might assign a non-t value to that variable. Conversely, if the language is type-unsafe to the extent of allowing an arbitrary integer to be used as a pointer, then it is clearly not memory-safe.
  • Immutable Objects: In object-oriented and functional programming, an immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created. An object can be either entirely immutable or some attributes in the object may be declared immutable; for example, using the const member data attribute in the C++ programming language. In some cases, an object is considered immutable even if some internally used attributes change but the object's state appears to be unchanging from an external point of view. For example, an object that uses memoization to cache the results of expensive computations could still be considered an immutable object. The initial state of an immutable object is usually set at its inception, but can also be set before actual use of the object. Immutable objects are often useful because some costly operations for copying and comparing can be omitted, simplifying the program code and speeding execution. However, making an object immutable is usually inappropriate if the object contains a large amount of changeable data. Because of this, many languages allow for both immutable and mutable objects.
  • Thread safety is a computer programming concept applicable in the context of multi-threaded programs. A piece of code is thread-safe if it functions correctly during simultaneous execution by multiple threads.
    Thread safety is a key challenge in multi-threaded programming. It was not a concern of most application programmers but since the late 1990s has become a commonplace issue. In a multi-threaded program, several threads execute simultaneously in a shared address space. Every thread has access to virtually all the memory of every other thread. Thus the flow of control and the sequence of accesses to data often have little relation to what would be reasonably expected by looking at the text of the program, violating the principle of least astonishment. Thread safety is a property aimed at minimizing surprising behavior by re-establishing some of the correspondences between the actual flow of control and the text of the program.
  • Metaprogramming is the writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at compile time that would otherwise be done at runtime. In many cases, this allows programmers to get more done in the same amount of time as they would take to write all the code manually, or it gives programs greater flexibility to efficiently handle new situations without recompilation.
    The language in which the metaprogram is written is called the metalanguage. The language of the programs that are manipulated is called the object language. The ability of a programming language to be its own metalanguage is called reflection or reflexivity.
    Reflection is a valuable language feature to facilitate metaprogramming. Having the programming language itself as a first-class data type (as in Lisp, Forth or Rebol) is also very useful. Generic programming invokes a metaprogramming facility within a language, in those languages supporting it.
    Metaprogramming usually works in one of two ways. The first way is to expose the internals of the run-time engine to the programming code through application programming interfaces (APIs). The second approach is dynamic execution of string expressions that contain programming commands. Thus, "programs can write programs". Although both approaches can be used in the same language, most languages tend to lean toward one or the other.
  • Lambda lifting or closure conversion is the process of eliminating free variables from local function definitions from a computer program. The elimination of free variables allows the compiler to hoist local definitions out of their surrounding contexts into a fixed set of top-level functions with an extra parameter replacing each local variable. By eliminating the need for run-time access-links, this may reduce the run-time cost of handling implicit scope. Many functional programming language implementations use lambda lifting during compilation.
    The term lambda lifting was first introduced by Thomas Johnsson around 1982.
As expressed, it was never my intent to demystify all the trendy concepts in technology and programming world. Thanks to the definite source of information, Wikipedia, for assisting in collating the above information.

Hope you find some of it (if not all) useful.

Thanks Mr. Reader for your time! Comments as always, are cherished and welcomed!

    Sunday, April 11, 2010

    Let’s Zune

    As a professional developer (don’t care if you disagree) one thing that has always stayed on my priority list is UX (User eXperience). UX is what makes an ordinary app stand out in the crowd and boost its adoption rate. There has been a sudden upsurge in the resources that are now being directed towards designing and developing effective UX.

    Media players have been there since forever (it almost seems so) and we all have our personal favorites. Our boxes come bundled up with something default which for some cynical reasons never suffices our hunger for the numero uno media experience. And there begins a never ending exploration for the most amazing media player. It’s surprising though, all that a media player (and I am directing my focus on music primarily) is supposed to do is yell out noise (dear music lover, no hard feelings intended), allow repeat, shuffle and essentially play a single song at a time (how many of you play multiple songs in parallel? Try it out, its fun!).

    Developers are always criticized for making simple things complex and that’s indeed true. Media players today have a fortune of features, 90% of which are unknown to lay end users while the remaining 10% of the end users are too busy comparing and contrasting these features with a rival player. With smart media devices rolling out, features like synchronization with the devices and amongst devices, cd ripping and burning from within the player have graduated to become the minimal set of features that a media player must expose to be even considered a decent enough option. When it comes to playing my songs I usually limit down to two players (again, a single player doesn’t simply suffice and I know not why), the primary being Windows Media Player 11 and the secondary being WinAmp, the modest media player for the masses. I stumbled upon Zune Software, the premiere media playing application for the PC primarily targeting Microsoft’s Zune player (aka the iPod killer). For more information about Zune MP3 Player visit here.

    The Zune software is what startled me and my curiosity grew when I read the tag line of the Zune software home page which declared: browse music, not spreadsheets. I like the concept and went ahead and decided to try it out. I might sound like the Indian TV news media, but it was AWESOME! AWESOME! AWESOME! (the words repeated directly correspond to propose the degree of awesomeness experienced). What follows is a quick overview of what looked to me as a really cool (again, I don’t know what this word means but it sounds geeky, so must over use it) media player and let me remind you, I don’t own a Zune MP3 Player and I don’t intend to rip music or buy music online. So I was totally concentrated on playing (offline) music that occupied very precious bits on my HDD.

    The Now Playing view impressed me a lot especially with the innovative UX that it proposed. Have a look at it:


    This single view has colossal amount of functionality and the reason why I love it lies in its unobtrusive UX design. To quickly sync you up with my point, notice the red wave at the bottom center of the window; that’s the visualization, very elegantly forming the part of the player experience. That to me was the Aha! moment. Also notice the basic media player controls and the track bar alongside the play list, completely forming the part of the player but elegantly sidelined for the premiere music playing experience. The player background served the album art of most of the songs that were in my music library (a Windows 7 feature). Hope you notice the back arrow on the top left corner of the window that takes you to the wealth of features that the Zune software supports. Very elegant, more so, mashing up with the general Windows 7 UI experience.

    Next up was the mini view; I had experiences of the mini view(s) of many other media players but this looked cooler (yes, I am sounding biased, but you have to try it out yourself to believe me).


    There were two other major views that looked astounding to me and if you are like me and keep your music organized and updated, editing even the least used tags of the individual MP3 songs you would love what this software has in store for you.

    The collections view looked really simple to me, just displaying enough information as I would need and abstracting away the chores of it. Also, this window links you to all the major functionality of the software. Notice the sign in option that connects you to the world (literally).



    The final screenshot I wanted to share was that of the edit screen which to say the least, lived up to my expectations:




    This post was never intended to be a product review of Zune software, rather it just wanted to express the really innovative, unobtrusive UI design that seems to be taking the threshold now a days with consumer software.

    Leave out your comments (if any) about your experience with the Zune software or any other application that stood out from the rest.

    Must admit, the primary reason that made me inclined to try it out was the fact that it was a WPF application (that’s geeky, but then that’s what the developer in me is).

    Happy listening!

    Sunday, March 28, 2010

    Installing Life or Uninstalling it?

    But now I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth”.

    It’s astonishing to discover how many of us are existing without doing the most imperative thing in our life – living! Bizarre, but true, don’t know if anyone of you have observed it, but we (most of us, if not all) suddenly have become enclosed and to some extent aggrieved by the toxic environment encompassing us. And before you start dwelling into the Go Green initiatives, I must declare, this is not about carbon footprint, greenhouse gases or for that matter, earth hour! We are no longer happy (attempts to inherit virtual happiness have failed time and again).

    The global economic downturn certainly triggered and aggravated it, but to solely blame it and move on would be an under-observation, indisputably leading to a lethal mistake. A quick glance down memory lane would bring back what now has become the epitome of happiness. School and/or college days, once sloppily spent, have now become desperately desired. Most of us would agree, we all were passionate about our to-be jobs. Why are we then loosing what’s called life – the intrinsically simple phenomenon of enjoying atomic moments sans dependencies?

    At the time of inception, happiness, in general was supposed to encompass monetary capacity in general and fulfillment of passion, in particular. Most, if not all of us, have reached a point whereby the monetary fulfillment is somewhat achieved (before you start shouting no ways, ask yourself how much was the first paycheck that you got and how satisfied you were with that and what do you draw today), if not surpassed. What went missing was that flare, that passion which in the first place drew us to what we are into today.

    For you Mr. Reader who is still figuring out what this post is all about, let me decompile the above LIL (Life Intermediate Language) code for you. It’s about our (you are allowed to exclude yourself if you so consider) inadequacy to achieve something simple, something atomic – a sensation called happiness! Every other disremembered friend I encounter nowadays seems to have a problem (the dictionary meaning of which is a state of difficulty that needs to be resolved). And regardless of the gravity of his problem, he simply wishes to resolve it! The keyword here is wish (the dictionary defines it as an expression of some desire or inclination), and also consider that one is wishing for the problem to be resolved and not making earnest attempts to do the same. My intent here is to express the undeclared, catastrophic phenomenon that is taking away life as it exists in the purest acceptable form, from most of us.

    What follows might be considered a litmus check that attempts to compute whether you are missing life or living it.

    If you don’t find yourself reacting yes to most of the points below, then must say
    Houston! We have a problem!”

    1. Do you like your company? (Intellisense suggests like as find enjoyable or agreeable)
    2. Do you like to work with your immediate superior?
    3. Do you like the people adjacent to you?
    4. Do you like your day-to-day work?
    5. Do you have time for yourself at the end of the day?
    6. Do you spend adequate time with your family?
    7. Do you have a private domain to cater to? (no Intellisense for this)
    8. Do you think your current professional step would lead you to your esteemed destination?
    9. Do you consider yourself to be adequately skilled and improving on a routine basis towards your desired level of expertise?
    10. Do you believe in yourself and your aptitude to change the tide in your favor?

    Shout out your Yes scores in the comments section, would be prodigious to know!

    The programmer in me couldn’t resist myself from injecting some code (dependency injection?) into this post, so here we go.

    The LINQ query for the above resulting questions could look something like this:

    var query = from Moments in Life
    where LifeTime != Timespan.Future
    select Moments
    order by gravity descending; //vital criteria appears first
    query, in this case would be an IOrderedQueryable<Life> and not an IQueryable<Life> (I am just venturing into LINQ, so do bring out the compilation errors and/or warnings in the code above).

    Happy living and for that, Happy coding too!

    Sunday, March 14, 2010

    Awaiting .NET 4

    The .NET Framework version 4.0 is slated for release in April 2010 and everyone seems to be excited about it (everyone by definition includes everyone, so me too). Being the next big release of the framework, there exists number of enhancements and fusion of several new ways of writing old and new smart applications.
    I sat down searching for what’s in it for me, the conventional (it’s the most reputable word I could afford for myself, corollary to calling bugs as exceptions) .NET developer for whom writing .NET code is not only about developing cool new smart applications (hardly get to do it thanks to the huge number of legacy and combo apps we need to upgrade day-in day-out) but also write that enlightening code quickly and smartly.
    I have made an honest (as if honesty still exists?) attempt to compile what I felt was just so super cool changes to the framework or language in general. Let me #warn you not to expect the entire v4 enhancements from the lines that follow. That won’t ever happen (if I could do that MSDN would be hosted at my local desktop, right?).

    1. StringBuilder.Clear(): I was surprised to see this as an addition to the v4 version, as all this time I had expected this member function to be omnipresent in the StringBuilder class (going by the superior and smart design of the .NET framework). Just recently while using it for dynamic html generation (I was using VB9 and still didn’t use VB XML Literals for some bizarre reason, which is indeed classified), I found the absence of this method. The workaround was setting the Length property to 0 which would then clear the contents of the StringBuilder object.
    2. String.IsNullOrWhiteSpace(): As is eminent from the name of the method, it checks not only the Null or Empty content of the string object but also helps avoid the use of the Trim() method to make certain we don’t end up with a string of precious whitespaces. An authentic admittance though, I already had added my own extension method in my v3.5 extension methods repository that did verify the absence of both Null and Whitespaces before performing any further string operations and was aptly named String.HasValue(). I am indeed smart (I always knew this, but formally broadcasting it on this DateTime.Now).
    3. ServiceProcessInstaller.DelayedAutoStart: While developing Smart Client applications it is a very common requirement to register the application to launch on Windows startup. However, as is eminent, too many applications loading on startup will upsurge the boot time significantly deteriorating the end user experience. This feature comes to the rescue by delaying the start of the application until all other auto-start services have already started.
    4. SMTP Client enhancements: Some of the enhancements include enabling SSL mode in application configuration files, specifying heading encoding and most importantly, multiple replying to addresses through MailMessage.ReplyToList().
    5. Guid.TryParse(): The TryParse method has now been added to the Guid, Version and Enum types and behaves exactly as its counterparts in other types.
    6. 64Bit enhancements: Recognising the mainstream adoption of 64 bit systems the Environment class has been decorated with: Environment.Is64BitProcess and Environment.Is64BitOperatingSystem.
    7. IEnumerable<T> everywhere: New overloads of String.Concat() and String.Join() now support IEnumerable elements so that you don’t have to convert them to strings prior to performing Join or Concat operations on them. Also enhanced are several System.IO members like the new File.ReadLines() which returns an IEnumerable<String> rather than a string array. This in turn gives superior performance benefits as its always (read mostly) desirable to read a file one line at time rather than loading the entire content in memory as in File.ReadAllLines().
    8. Corrupted State Exceptions: How many times have I written the following?
    // Something that should fail, or else why did i incur this try cost, right?
    catch(Exception ex)
    // Never do anything here. Let them come back to me for fixes (guarantees job security)
    In .NET 4.0, corrupted state exceptions will never be caught even if you specify a try… catch block. Even though this is a huge obstacle (a setback or even a crisis) on my attempts towards my job security, yet I welcome it as it encourages writing more stable (in theory) code. Before you start depreciating your intentions to upgrade to .NET 4 for this particular reason, there is a switch that allows you to get the old behavior back by setting the following attribute LegacyCorruptedStateExceptionsPolicy=true in the config file.
    This behavior can also be enabled on individual methods with the following attribute:
    9. System.Data.OracleClient: Before you plunge into thinking why MS shelled it’s resources to enhance OracleClient, instead of their own franchise SQL Server, there is a surprise awaiting you. OracleClient is available in .NET 4 but marked as deprecated. Don’t believe me? No need to, just help yourself by visiting .
    10. VB Auto Implemented Properties and C# Named and Optional Parameters: These are some of the language specific enhancements essentially following Microsoft’s strategy of co-evolving the two languages.
    VB now has auto implemented properties thereby reducing the amount of code generated significantly (I hated VB Dev Center for not introducing it in VB9).
    C# developers now stand equal by having named and optional parameters (which to me should have been there at least since v2 of the language).  

    The list above was never meant to be exhaustive, it does not even attempt to touch the Parallel computing extensions and dynamic (or functional) enhancements to the framework, but it surely addresses most of us, the conventional .NET developers, writing managed code that manages our company, our clients and primarily us!

    Happy Coding!

    Sunday, January 31, 2010

    Truth be told

    The IT industry in particular has been guilty of over using (read misusing) acronyms and phrases, the
    real meaning of which is not known to many, in and outside the industry. The following is an honest attempt for people at large to get to know or revive their knowledge about few such phrases.

    Certain terms or phrases used are developer centric but I still believe you would have over heard it while walking past a cluster of developers talking to themselves. The list was never meant to be exhaustive, so inject your own and help educate the people at large (the good people who aren’t part of this typical industry).

    • Alpha – a synonym often used in place of the disclaimer clause in relation to software

    • Beta – the deliberate act of making people dependant on software that you know doesn’t work the way it is supposed to.

    • Unit Testing – It’s taking responsibility for the subsequent ill effects of the code you wrote.

    • Integration Testing – the act of shifting the responsibility above to some other person or module.

    • Dependency Injection – the art of writing code that you know will crash, but making sure you alone can fix it. In current scenario, this is the only way to have  job security in the software development industry.

    • Community Technology Preview (CTP) – the only way whereby a company gets testers for free.

    • Release Candidate (RC) – the difference between a CTP and a working release of software.

    • Project Manager (PM) – A mysterious organism over engrossed in excel whole day long, meetings for whom marks the coolest way to chill out.

    Post in your comments and assist in carrying this list to the next level (Beta 2 to be specific).

    Happy Coding!