ARTICLE

.NET Brings The Fun Back to Programming

Posted by John O Donnell Articles | Articles C# July 11, 2001
Today, we are all comfortable sitting in front of our high powered computers running graphical user interfaces and compiling code in sophisticated development environments.
Reader Level:

Introduction

Let me introduce myself. I have spent the last 13 years working with PCs on both DOS and Windows. I have written code in Assembler, Pascal, C, Microsoft Access, Office VBA, Microsoft Visual Basic, Java and now C#. I remember running DOS 3.3, Windows 286, 386 and then the excitement of loading Windows 3.0 on a 386 PC with 4MB RAM costing roughly 6000 dollars! I also remember logging support calls with Microsoft where the answer was either to be sent an upgraded printer or video driver.

Software development 13 years ago

Today, we are all comfortable sitting in front of our high-powered computers running Graphical User Interfaces and compiling code in sophisticated development environments. Spare a thought then for guys like me who developed on compilers such as Borland's Turbo Pascal. Imagine writing code today and having to write everything yourself. I could not just declare a class and suddenly add in printing functionality. We need to get the printer development tools and write our own code to create printouts. This author even had the pleasure of designing a font specifically for faxing and did it by building his own tools.

Like everything, though, at the time I was sitting in front of my IBM PC XT compatible computer with a 20MB hardcard and 640k Ram thinking "wow I am really a power user now". Strangely enough I had the same thought when I finally got a 286, 386, 486 and so on.

At this point in time Borland was the cool company, IBM was dull and Microsoft was the underdog. To me and my colleagues Borland produced the coolest set of tools like Turbo Pascal and Turbo C and a few more that I can't remember. The point was I could write a 20,000 line Turbo Pascal program and compile it in about two minutes. Of course it didn't matter that to write an application could take months as you spent time writing interfaces or more often than not, menu systems.

In those days of limited computing resources we spent too much time perhaps, trying to gain an extra few bytes here and there and make our code run faster. We agonized over languages like Modula-2 and wondered if switching to compilers from companys like Topspeed would speed up our code. The point was we were working very close to the core of the computer but were paying the price by producing code where every program had a different interface and almost always was written from the ground up rather than utilizing old routines and so on.

From command line to Graphical User Interface (GUI)

My first real taste of Microsoft Windows was really Windows 386. Compared to today's Windows product it looked basic but had some useful functionality. Hands up all those who remember running two programs at the same time and thinking how cool it was.

Of course all the UNIX gurus out there will be thinking so what, we have been multi tasking for years. This may be true but Windows bought multitasking to the masses rather than the techies.

Enter Microsoft Windows 3.0 / 3.1

Windows 3.0 finally was the operating system that really made people go WOW this is cool. It performed well and more importantly looked awesome. All the Macintosh people out there said hey it's just like our OS while we just got on with using it. We were proud DOS users and would never lower ourselves to using a Macintosh.

Notice something here? Now Microsoft was being seen as being a bit cooler than before. If only they produced some good apps. Of course with the release of Microsoft Excel and Microsoft Word they did. Like it or not, Microsoft Excel was an amazing product and even had in later releases a macro language so I could write functions to produce new calculations; wow, I am a Windows programmer ..... well not quite. 

Now I started to hear of Petzold and his C programming book. My company looked long and hard at Borland and thought when will we be able to produce applications under Windows? Time went by and for a long time nothing came out of Borland until the release of Turbo Pascal for Windows. This was a great development system but in reality still meant you needed to do much of the work to make anything happen on the screen. If you were new to GUI's then the idea of writing an application for Windows was almost your worst nightmare. In those days the number of PC computing books could be counted on one hand, unlike today where you could almost run a store just to cater to computer users. So more or less we started using Windows but kept on writing DOS applications as before. 

C versus Pascal

In the old days C programmers were called the "fighter pilots" and Pascal programmers were the "quiche eaters". We didn't care as we coded in Turbo Pascal 4, we could produce code faster and more reliably and that's all that mattered. 

I was not a C programmer and am still not. I guess a background learning to program in Pascal means you like to code in a certain way and C programmers like to code in other ways.

 Enter Visual Basic

For non C programmers Visual Basic was a miracle. Here I was, a non C coder and I could not create a Windows application in a matter of minutes. Okay so the first applications didn't look good since we didn't bother to read the Microsoft Windows design guide but at last we were Windows programmers. Again not quite; with Microsoft Visual Basic we were given a number of tools like drop down boxes, radio buttons and so on to drag onto our forms but of course when you looked for the tool that you needed to complete you application, Microsoft had not implemented it. In light of this an entire industry sprung up overnight around Visual Basic producing additional tools to use in your applications.

Visual Basic was and still is a strong development system but for my it got you tantalizingly close to creating a Windows app but did not give you enough control when it was needed. 

Microsoft Access and Access Basic

I was developing databases with Borland Paradox when I heard of and got a copy of Microsoft Access 1.0. Here was a powerful database development tool that used SQL as its database query language. It gave me a forms designer, a report writer and queries and it was awesome to work with. You know what, it was even fun to work with and today that is something that's missing. Programming is a creative process and should be treated like writing a book. Up until .Net that seemed to be missing.

Java

How I thought I had finally reached my goal when I heard of Java. True it could run on many platforms and had strong development features like object orientation and so on. However I wanted to produce a full-featured Windows application. Java would let me sort of make a Graphical User Interface but not a full-blown application with all of the Windows features. I walked away frustrated. 

Today's programmers

Today we have programmers of many abilities. We have people who spend all their time writing code in Office VBA to perform mail merges, calculate spreadsheets and much more. You may laugh but they are still programming. Next up we have the hobbyist who likes writing Windows applications with terrible interfaces. Chances are he's using Visual Basic and having lots of fun. 

Moving up the development ladder we have the professional Visual Basic programmer who maybe works at a bank or some such company. In his hands are a Visual Basic app that can look the same as an app coded in C and I for one am amazed at what some Visual Basic developers can do in a quarter of the time of a C programmer. 

Climbing further up the software development ladder of success we reach the C++ programmer. This guy writes robust code that runs quickly and can put out a great Windows application but takes much longer than the Visual Basic guy. If you are employed as a C++ programmer then you probably think of yourself as a real professional. 

At the very top of the tree from a performance point of view is the C programmer. Even today you can write a complete Windows app in C. In fact if your writing for machines such as a Pocket PC then C is the way to get maximum performance out of it. Using C means you will take much longer than both the C++ and definitely the Visual Basic guy. 

Why are we constantly chasing our tails

Why in today's society are programmers constantly switching technologies to do a job. Instead of learning one language and being able to code all development tasks in that language it now means that you need to look at your latest development task and wonder, okay which language do I need to know now?

Does my next task require me to know C++ or does it need ASP, VBscript or Jscript with a smattering of Java. Wouldn't it be great to use my existing skills or even build on top of them? 

What I want for software development

Over the last 13 years or so I have seen many changes in software development. I have seen attempts to make program development easier and more reliable however what I have not seen is software development being fun again. I have read Microsoft Systems Journal, I really have, but reading C++ code using Microsoft Foundation Classes quite honestly turned me off completely. I could more or less follow the Charles Petzold style of Windows C programming but the time taken to build an application made me walk away.

I also have a dream.....

My dream is I wake up in a perfect world where I can turn on any computer anywhere in the world at any company and be able to write code on it without the necessirty of spending weeks or months learning a new language or a new development library. 

Ahhaa you're saying, learn C since that is the only true portable language. Actually to an extent this is true. You can get a C compiler for probably every computer out there. However the portability fails when you want to start writing code for a graphical user interface. Windows does it one way, Mac does it another and X does it another. 

Okay so what about Java? Well its true that Java gives you lots of graphical functionality, the reality is that Java apps need to be rewritten or hacked around to get them to work because your machines JVM is not as compliant as you thought. If Sun had succeeded with Java then they would not have needed a 100 percent Java certification program.

I loved Java as a language since it was so close to Pascal with a touch of C but it was not quite what I needed. 

I want to be able to write programs that are as sophisticated as the guy writing Petzold style C programs using the Win32 API calls. However I don't want to take years to do it. 

Enter .NET 

Imagine that perfect world. I'm an ex Pascal programmer, you're a C coder, your colleague thinks Visual Basic is cool, his friend actually is quite old and programs in COBOL. 

Can these people ever co-exist in a development environment? They can with .NET.

The idea behind .NET is that you write in what whatever supported language you want and use the same compiler. So I could write in C++ or you could write in Visual Basic but we would run the same code and more or less output the same runtime.

This gets better. Rather than use existing languages, Microsoft has added a new language to the fold and called it C#. This language is like taking Pascal, Java and a smattering of C++ and mixing them in a huge software development pot. The result is a clean, easy to use language and should be considered a next step up from Visual Basic. In fact I would say that C# should be taught in place of where Pascal used to be. 

So imagine this. The next release of Microsoft Windows you install has a new runtime called the .NET CLR or Common Language Runtime. You write your application in either C++, Visual Basic, C#, COBOL or many others and compile to something called the Microsoft Intermediate Language (MSIL) and this is fed through the CLR and produces your app. In fact you can actually look at the resulting MSIL code and see it bears more than a resemblance to Assembler! In fact you could even code an entire application for .NET in MSIL using nothing more sophisticated than Microsoft Notepad. 

Consider this, today if I want to write an app I could write it in VB. If I want to code a web page I will use ASP, if I want to write a Windows NT Service server I will use C or C++. .NET gives me the ability to use the language I am most familiar with.

Good grief, we can all use the same libraries and produce the same output. No longer will the C++ programmer scoff at me because his apps are more powerful. Now I am a C# programmer and nobody kicks sand in my face anymore.

The story doesn't stop here though 

Imagine Microsoft produced their runtime for other platforms.....

Imagine the CLR on Apple OSX, FreeBSD, Linux or Solaris. You're getting the picture? Maybe now we can get to a point where we really can use one language across all computers. 

If you are coding in .Net then perhaps you too are thinking wow this is fun again. Microsoft hs given me a great language and also a rich feature set. I can extract data across the web and analyse it using 10 lines of code.  

All the Java people out there are probably saying, wait a minute, what your talking about is Java. While its true that the promise of Java was great, the execution was lousy. Whether you like it or not millions of programmers create Windows programs. If Sun had wanted Java to succeed they should have made it possible to use Java and all the richness of the Windows OS. What we were stuck with were very basic classes and no chance of producing a rich Windows application in Java. 

I hope that some day I can switch on an Apple Macintosh running OSX, a PC running FreeBSD or Linux and be able to write a C# program just as easily as I can under Windows. 

Conclusions

With .NET Microsoft has created an extremely rich programming environment however Microsoft has a larger opportunity. By now most of you will have seen that Fujitsu has COBOL for .NET. The opportunity for Microsoft is to deliver a programming platform to whoever needs to write a program, not just to the guys writing Windows applications.

I firmly believe that .NET and the CLR is the most exciting technology to have come out of Microsoft and I hope you'll join me in congratulating them on a job very well done. 

Programming just became fun again.  

COMMENT USING

Trending up