Wednesday, April 15, 2009

Is open source killing Sun?+

Okay. I am going to ask some questions that might sound like heresy to fans of open source, but desperate times call for brutal honesty. We are talking here about a company which changed its stock symbol to the name of their popular but free language, JAVA.

I have always wondered, how does a company make money by producing something that they then give away for free? Of course, they do have their hardware business, but despite that, is it any wonder that Sun is going under when they give away so much for free?

Java: free programming language
NetBeans: free IDE
Star Office: not free, but Open Office version is free
Open Solaris: free Unix OS (which also has to compete against Linux, also free)

In fact, Dave Rosenburg of cnet news recently wrote an article titled "How Linux killed SGI (and is poised to kill Sun)". Amazingly, when talking about Sun, Rosenburg doesn't even mention Java. Java is like a 500 lb gorilla in the room that nobody seems to notice. However, he does say, "There is a vast array of Sun software that costs a lot to maintain but doesn't deliver much revenue. This is arguably the area in which Sun's strategy has been so off the mark." Could this be an indirect reference to Java?

Rosenburg then sites MySQL as Sun's best software, which is humorous since they only acquired MySQL just over a year ago. He says, "With the exception of MySQL, there aren't many Sun software products that generate significant revenue." Say what? Sun's stock has been going down ever since they bought MySQL in early 2008 for $1 Billion. Sun CEO and President Jonathan Schwartz was quoted at the time as saying, "MySQL was clearly the crown jewel of the open source marketplace. As far as we can see there are no higher value assets for us to be acquiring."

However, John C. Dvorak seems to have got it right when he wrote his opinion piece, "The Sun-MySQL deal stinks Commentary: Oracle is the only winner in this deal." John said, "... Sun cannot actually afford to spend a $1 billion on a company producing a mere $60 million in revenue and working outside its core competencies." I guess at the time Sun thought they were doing pretty good with a 4th quarter 2007 profit of $320 Million and could afford to expand, but these days they are in the red. (By the way, John also manages not to mention Java anywhere in his article.)

So, is open source killing Sun? Well, sort of. That and spending huge amounts of money on a stupid merger right before the economy tanked. On top of all this, it would seem that IBM recently offered to save them from the mess they got themselves into by purchasing them, but Sun screwed up that deal too.

Of course, IBM would love to be in control of Java and maybe that wouldn't be such a bad thing. In the wake of Sun falling apart, I can imagine a world where two or three different companies attempt to take over stewardship of Java, which Sun has made open source. It could be like the days when we had AT&T and BSD versions of Unix before Sun made the switch from BSD and everybody standardized on AT&T just before Linux came along to largely replace them all.

In fact, I am wondering... couldn't IBM save a lot of money by forking their own version of Java and letting Sun just die?

Meanwhile, Microsoft does have their own open source strategy, but as Sam Ramji, Microsoft’s Director of Platform Technology Strategy put it in a 2008 interview, "Our focus is getting OSS on top of Windows... And I’m focused on (providing) interoperability between the LAMP (Linux, Apache, MySQL, PHP) and Windows stacks." So, their priority is making sure that people continue using Windows even if they are also using Linux. They are not trying to make money off of open source. (Once again, no mention of Java.)

Honestly, I am not trying to bash (no pun intended) open source. I happen to be using Linux right now. Some companies like Red Hat have made good money selling support for Linux while contributing to its development. Red Hat is doing pretty well. They not only have their Linux but also have acquired JBoss, which they reportedly purchased for $350 Million. Was it really worth that much? I doubt it. However, Red Hat, as I point out, made their fortune on open source whereas Sun did not. So, maybe Red Hat knows what they are doing and won't make the same mistakes Sun has.

New Wine in Old Wine Skins: My First .NET Project

By, "New Wine in Old Wine Skins" I’m not making a techie joke about the “Windows Emulator”. I’m thinking about new projects being created using old technology.

It seems to me there is sometimes an advantage to being new to something. You are not “set in your ways” and have not yet developed bad habits.

Of course, I am new to .NET, but certainly not new to development in general. I may have developed habits developing Java or C++ or working with Unix that may cause me problems with making the transition to .NET. On the other hand, since .NET is all new to me, using its newer features such as WPF, Linq and Ajax should not be anymore difficult to me than learning the old way of doing things which is also new as far as I am concerned.

However, I am helping a friend with a .NET project, and I have found that he was less than open to some of these newer technologies. For example, I saw that his database code relied on hard-coded bits of SQL. Having worked with Hibernate in the Java world, I suggested that he use ORM (object relational mapping).

After a little research on my own, I found it would be fairly easy to generate C# classes that are mapped directly to tables. I started out with the Access database my friend had provided me. To get this process to work, I first had to import the database into Sql Server. This turned out to be easy.

Then I generated DLinq mappings using SqlMetal. The result was an xml file and matching cs file. SqlMetal doesn't work with access files, which is why I had to get the tables into Sql Server. I ran the SqlMetal command below from a cmd prompt sitting in my App_Code folder:


"c:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SqlMetal.exe" /map:Mappings.xml /code:Mappings.cs "C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\XXX_Data.mdf"


… where XXX was the name of the database.

For some reason, after importing I had to take down Sql Server and bring it back up before it would work. I am not sure if I was doing something wrong. Of course, the express version of Sql Server doesn't give you much of a UI to work with.

Also, trying to build the project after adding these files I get the following error...


Error 1 The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) C:\Documents and Settings\greg\My Documents\Visual Studio 2008\WebSites\FindEngine\App_Code\Mappings.cs 16 19 C:\...\FindEngine\


I found out I could fix this as follows by adding the following to web.config after the the line for System.Data.DataSetExtensions...

<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=xxxxx">


where the public key token is the same as that used to sign System.Data.DataSetExtensions

I did not actually try using the mappings yet, but wanted to share my work with my friend. When I sent it to him he replied: “I admire your learning DLinq, and applying it here, but I'm pretty sure it won't work, since I'm storing column names as strings and using them to generate parameters for the queries. It's kind of moving the opposite way from LINQ, since you can't do strongly typed in-line queries that way.”

He then supplied some examples from his code. Here it is with some of the names changed…

Here is an example from WidgetObject.cs that I believe is incompatible with the LINQ concept:

    public void Delete(int ID)
    {
        Db.Execute("DELETE FROM " + _type + " WHERE ID = @ID", ID);
    }
Here's another example from WidgetStuff.cs:

    public override DataTable GetList(int ParentID)
    {
        string whereClause = "";
        List<param> paramList = new List<param>();
        if (ParentID > 0)
        {
            whereClause = " WHERE CategoryID = @ParentID";
            paramList.Add(Param.Int("ParentID", ParentID));
        }
        return Db.GetDataTable(string.Concat(
            "SELECT ID, '' AS ChildType, Name AS Name, Description",
            " FROM Stuff", whereClause, " ORDER BY Name"), paramList);
    }

(code formatted by http://formatmysourcecode.blogspot.com/)

My friend must be smarter than me, because I don’t pretend to understand exactly what he is doing. However, I get the impression that maybe he is getting carried away with trying to come up with a very general solution where something simpler would suffice. I think I will be puzzling over this for some time. If I figure it out, I will write another blog about it.

Tuesday, April 14, 2009

Cross-platform .NET GUI development

Although both Microsoft and Sun are in business to make money and increase market share to make more money, it would seem that there is a fundamental philosophical difference between the two companies regarding software development. For reasons which should be fairly obvious to most software developers, Microsoft does not care much for Sun’s “write once, run anywhere” mantra and has designed .NET to run only under Windows.


But what if one wanted to write .NET applications that can run anywhere? Is it even possible?


As it turns out, there are a couple of open source projects which aim to make it possible. One of them is Mono. From their web site: "The Mono Project is an open development initiative sponsored by Novell to develop an open source, UNIX version of the Microsoft .NET development platform."


Mono cannot run WPF applications, but it can run Windows Forms (WinForms). In addition, Mono has it's own Linux-oriented Windowing layer called gtk# which has been ported to Windows. Also, there is wx.NET, a CLI wrapper for wxWidgets.


Mono can also be used to run ASP.NET applications from Apache on a Linux box.


Of course, just because you can do a thing doesn't mean you should. Should one bother trying to write cross-platform .NET? I would say it depends on why you want to do so and how you go about it.


If you’re out to prove how great Linux is, that’s probably not a good reason to write .NET for Linux unless you happen to work for one of Microsoft’s competitors.


If you have an existing .NET application that you want to run under Linux for some other reason, that might be a good reason to use Mono.


It is not uncommon for Java programmers to develop under Windows and then deploy an application to a Linux server. So, why not go the other way? If you just prefer to use Linux but have some need to develop for Window, that might be a good reason to use Mono.


If you want to use Apache to run ASP.NET applications without IIS, possibly under Linux, that might also be a good reason to use Mono. As of April, 2009 Apache has 45.95% of the server market compared to 29.27% for Microsoft IIS according to netcraft.com.


Unfortunately, as with any copy-cat technology, Mono will always be one or two steps behind the latest Microsoft innovations. I already mentioned that Mono cannot do WPF.


Personally, I would not recommend using gtk# (gtkSharp), because it is specific to Mono, and I would not recommend wx.NET because it is an obscure technology.


If you read my previous blogs you know that I don’t like the idea of using obscure technologies and would prefer to spend my time learning skills that are marketable. That’s because I’m a professional software developer. If you’re a hobby programmer, you can pretty much do whatever you want.


That leaves Windows Forms (or ASP.NET if you are writing a web application). However, as a software developer I want to be learning and using the latest technologies. So, that is one negative. I shouldn’t have to limit myself in order to achieve cross-platform compatibility.


Unfortunately, I found that installation of Mono and Monodevelop IDE (the Linux port of SharpDevelop) can be a real pain depending on what distribution of Linux you are using. The Mono and MonoDevelop projects directly support OpenSUSE, but not Ubuntu or Redhat Linux. I am sure that is because both Mono and OpenSUSE are sponsored by Novell. However, this seems like a mistake to me. I found it very difficult to install MonoDevelop on Ubuntu and ended up changing to OpenSUSE instead. However, some people may not have this option. This issue could certainly have a negative impact on the adoption of Mono. This is a glaring example of how Linux applications also do not adhere to Sun’s “write once, run anywhere” philosophy.


And speaking of “write once, run anywhere”, if you look on the discussion forums on the Mono project web site, you will see many complaints of .NET applications working differently under Mono than under the true Microsoft .NET. Not that this is a big surprise. Fortunately, the Mono project supplies a Migration Analyzer tool, but even it is not perfect. However, I am thinking that if you are doing new development targeted for Mono, it would be better to use MonoDevelop under Linux for all your development so you won’t run into a lot of surprises later down the road with minor incompatibilities.

Friday, April 10, 2009

Avoiding Fads and Obscure Technologies

Years ago I had a job working with some structural engineers. They had developed a prototype in Fortran and I had to convert it to C++. These guys had no idea how easy they had it, because the science they were working with had changed little in 50 years. They kept getting paid for doing the same job year after year, but they didn't have to learn much new technology.

By contrast, as a computer science grad my field of expertise is constantly changing. Computer hardware is constantly becoming more powerful and the software is constantly changing.

Although it is always going to be a challenge keeping up with the pace of change, isn't it often worse than it has to be? I mean, some people are constantly re-inventing the wheel and/or chasing the most recent fads.

I currently work for a company that has a habit of creating their own in-house solutions for common problems and/or using obscure technologies. One of those obscure technologies is SwiXML. SwiXML is one of a small crop of frameworks built on top of Java Swing. SwiXML allows you to specify a GUI in XML instead of Java.

Why use SwiXML? I think the idea was to create a richer GUI than could be done with the in-house servlets framework they were using before and to do it in a way that did not require as much testing. Apparently, the architects had already written off Struts as not working well in an Agile environment, and Eclipse/SWT was suggested and also shot down. I am not sure what other alternatives they may have explored.

Unfortunately, SwiXML is so obscure that I wouldn't even call it a niche technology. Ruby and Groovy qualify as niche technologies. If I search on the internet for jobs that require Ruby or Groovy, I can actually find some. However, a recent search on SimplyHired.com turned up exactly zero jobs that asked for SwiXML.

Let's face it. Even if you like learning new stuff, there are only so many hours in a day, and only so many brain cells to devote to learning new things. Our brains aren't any smarter than the ones our stone age ancestors used when the most complicated thing they had to create was flint tools. Evolution is too slow to keep up with science and technology. If we're constantly having new technologies forced on us, isn't that bad for productivity? Won't it cause us to only have a surface knowledge of what we're doing?

I would love to settle comfortably into a technology that I could trust to be around until I retire, like those structural engineers I mentioned. Is Java going to be around that long? I think so, but there are constantly new open source frameworks and innovations to learn. Spring and Hibernate are a couple that have become just as important to learn as Sun's standard J2EE technologies.

Evidently, .NET developers have less technologies that they need to be proficient at. Learn C# or VB.NET and ASP.NET and you know everything you need to qualify for most of the .NET jobs that are out there. More than likely, the only IDE you will need to learn is Visual Studio.

It seems that these days there are as many .NET jobs out there as Java jobs. A few years ago I heard that 70% of new development was in Java, but I don't think that's true anymore. So, I think .NET is worth exploring for those who want to avoid wasting energy on fads and obscure technologies.

You can download Visual Studio Express editions for free. If you are a Linux fan, it is now possible to run some .NET applications under Linux thanks to a project sponsored by Novell called Mono. If you decide to give that a try, I would recommend using OpenSuse Linux. Since it is also supported by Novell, Mono is designed to work well with OpenSuse.

I have recently started helping a friend with a small .NET project. I don't know if I will ever totally switch from Java to .NET, but there are some jobs that require both. So, in the coming weeks I will be blogging about .NET and related topics. Stay tuned.

The Top 10 Tech Skills?

Reading a recent issue of NETWORKWORLD, I was intigued by an article called "Does a Computer Science Degree Matter Anymore?" In a nutshell, their conclusion was "it depends". Evidently, there are some people that feel that a lack of solid computer science grads could damage America's competitiveness in technical innovation, but, on the other hand, most of the time when companies hire techies, they are looking for specific skills rather than a degree. So, as a side article they included what they think are the current "Top 10 Tech Skills".

I am, by nature, a skeptic, and as one of my professors liked to say, quoting Mark Twain, "There are three kinds of lies: lies, damned lies, and statistics." So, I don't accept such a list as given by NETWORKWORLD or any other "expert source" on face value.

Their numero uno skill is "Business Process Modeling". They say that in the past year pay for these skills are up 10.3%. That's great, but how many people does this affect? Can you actually get one of these jobs? Searching indeed.com for BPM jobs near my zip code, I found a whopping 10 jobs. Woo hoo! By contrast, a search on java turned up 334 jobs and a search for .NET turned up 407. So, here is their complete list with my addition of number of jobs near my zip code using some related job searches (some terms are too broad to search on, such as "database"). Also, note that the numbers I list are the number of jobs for which indeed.com could determine some salary estimate.

1. BPM
"BPM": 10 jobs
"business process modeling": 6 jobs
2. Database
"Microsoft SQL Server": 42 jobs
"Oracle Developer Suite": 0 jobs
"Oracle DBA": 10 jobs
"DBA": 78 jobs
3. Messaging/Communications
"VoIP": 49 jobs
4. IT Architecture
"software architect": 101 jobs
5. IT Security
"it security": 25 jobs
"computer security": 7 jobs
"security analyst": 7 jobs
6. Project Management
"software project manager": 467 jobs
7. Data Mining
"Data Mining": 22 jobs
8. Web Development
"Web Developer": 36 jobs
"Web 2.0": 6 jobs
9. IT Optimization
"IT Optimization": 0 jobs
"virtualization": 27 jobs
"cloud computing": 0 jobs
10. Networking
"cisco certified": 11 jobs
"network engineer": 38 jobs

So, by what standards are these the top 10 skills if their are so few actual jobs in some of these areas? Project managers seem to be in high demand, but I think it would be debatable whether or not this even belongs in a list of "tech skills".

By contrast:
"java": 334 jobs
"j2ee": 108 jobs
"hibernate spring": 51 jobs
"java swing": 19 jobs
".NET": 407 jobs
"c#": 179 jobs
"asp.net": 131 jobs
"visual basic": 83 jobs
"c++": 194 jobs
"cobol": 45 jobs! (there are more jobs for Cobol than for BPM!)
"fortran": 75 jobs!
"groovy": 1 job

Pay is a whole separate issue. Salaries for BPM are going up while salaries for Cobol have gone down since last year. But if you can't even get a job with your skill, what's the point?