Showing posts with label Scott Gu. Show all posts
Showing posts with label Scott Gu. Show all posts

Monday, December 13, 2010

Separating from Concerns - Stop Using Visual Studio Is One Option


The MVC cheerleaders and Scott "THE DOT" GU make a big deal out of separation of concerns like this is some great break through. This is nothing new or anything to get excited about we have been easily pulling this off in Visual FoxPro for years through N-TIER and so has rails through MVC.

Now some of you maybe thinking VFP wasn't a web-tool, actually it can be used for web development which is out side the scope of this blog post but I used the same VFP middle tier classes in classic asp applications and in desktop lan applications. But more importantly if you understand design patterns then you would realize, it should NOT matter what the UI is, who cares, if it is a webform, winform, a service or mobile device. It is Microsoft's inability to build a productive tool which is the only reason this is a concern.

If Soma and the boys at Microsoft would have followed an N-TIER thought process and included a "HEAVY DUTY" class browser and focused developers on building a code repository that could be used across any UI seamlessly with VS containing an open source code generation layer that handled all the plumbing code NOW that would have been a "GREAT" tool.

The part that frustrates me, yes even more than standing next to an Indian at a public defecation pool with a bad case of diarrhea, is how close FOXRPO was to accomplishing this feat. If they would have added a form base class of type webform it would have worked. I actually often thought of doing just that and have it churn out the HTML and CSS based on classes. Damn I should have Soma's job lol.

Instead Soma and Microsoft got off on this tangent of composite UI controls and never ending layers of bloat, combined with bastardized paradigms that require a vast amount of "more" work then legacy Visual FoxPro did to "separate concerns" which is highly concerning.

I believe MVC separation of concerns is based more upon a flaw/lack of understanding with regards to Webforms, competing with ruby and implementing a "new" but copied design pattern then really "FIXING" the design pattern problem which is deeply rooted in Visual Studio and .BLOAT.

I will get off my soapbox and further explore Visual Studio's MVC separation of concerns.

N-TIER patterns are one way developers could "truly" separate concerns, here is a quick refresher on how this works.

The UI Layer - Handles user input and sends and retrieves data to the business layer.
The Business Rules Layer - Validates information, performs processing and connects to the data access layer to send and retrieve information.
The Data Access Layer - Is responsible for connecting to the data source. In some cases this is a base class for the business rule class or can be a separate layer in the event we need the ability to use different back-end databases such as My Sql, FoxPro, Sql Server, Oracle etc...
The Database - This is merely My Sql, SQL Server, Oracle, Access, FoxPro etc...

N-TIER is linear: UI hits the middle tier and the middle tier hits the data tier.

With MVC the tiers are triangular, views hits the controller and model and the controller hits the model. Even thou it is a triangular pattern that still doesn't mean we should not be concerned with code reuse.




In Visual FoxPro given it had a "functioning class browser" it was very easy to assemble these layers and setup a class "tree" hierarchy. Developers only had to concern themselves with application code and there was a "true" separation of concerns. Fox developers weren't not concerned with writing plumbing code or dealing with framework syntax that is more bizarre then crossing an intersection at rush hour in India.

With Visual Studio the class browser is mainly a nice looking UI plumbing code template generator that functionally does absolutely nothing mentionable. The VS class browser is unable to visually subclass UI controls amongst other things, in short, it is just about as fast to build your Visual Studio classes by hand in notepad.

If you want a more in depth comparison here is a link regarding the UI layer and class browser with code samples. When I went back and reread that post it is amazing how consistent I am which is more then I can say for some cheerleaders.

Now that we have a basic understanding of how concerns can be separated and the difference between VFP'S class browser and Visual Studio's want-a-bee class browser implementation lets explore what happens in an MVC application.

In the UI Layer of MVC we end up with some nice HTML, if we are good little coders. Next we have to inject the data access, business rules and validation to make the html do something productive, unless of course we are Scott "THE DOT" Glue then making it do anything that may reveal the truth of how messy VS MVC is, well, lets just say is out side the scope of his specs.

In most "GOOD" applications when the user tabs out of a field we should give some feedback to let the user know if their input is not valid. This is where separation of concerns falls apart with Microsoft's MVC implementation. In MVC field level validation is pulled off by using Javascript, Jquery and alligator script syntax etc... bloating the hell out of our NICE html or we could use the the range attribute property of EF (which I discussed in a prior post). If you are sharp, you should immediately see we have already lost our separation of concerns and the code is "NO LONGER" dry.





Despite what the MVC'ERS are bragging about here is what is "really" happening in the controller code with most applications I looked at in the field and sample code written by cheerleaders. The controller becomes this massive bloat of spaghetti code combining data access, linq, business rules, authentication and data sets with varying degrees of duplicated code in the UI. Worse yet the code is further duplicated from controller to controller and also into the web services because developers are NOT using "true" OOP design patterns.

I found a brief video that helps explain this point a bit more, enjoy. :)



There are several reasons why I believe this happens:

Microsoft ignored the model layer in their paradigm making it difficult to work with and now they seem to be forcing EF as the model layer, good luck with that one. Some developers haven't worked in C++ or VFP therefore don't have a firm grasp of OOP programming concepts or design patterns and fail to setup a good class structure if they use any class libraries at all. They merely are following some false hope and Microsoft marketing efforts to make them believe because a controller layer is involved in their application they are following OOP design principles and therefore their concerns are separated.

Anyway lets look at some code shall we, that may help...



This was pulled right off the blog of a Visual Studio cheerleader to validate a login in MVC.

Here is a very real world scenario.

A programmer is working on a site and "googles", log in validation + MVC, they find this sample with some documentation and implements it. The blogger is an Indian MVP from Microsoft so he has to know what he is talking about right? - come on do you really think this doesn't happen? My good friend Soma was blogging about script junkie, trust me this shit happens all the time!

A few minutes later, cool, the site is working, users are getting in and some users are denied access. The developer is happier than a two-dicked billy goat and thinking wow those cheerleaders f'ing rock man!

A month later they receive a request to add in a web-service to this web app that requires a username and password before it can return some data. So the programmer cracks open VS/.BLOAT then armed with C# and a KB article works some magic and the web-service is working.

I think you can see where this is going, we have validation crap in the controller, the html and a web-service.

And folks I will say it again this unfortunately is "REAL WORLD" stuff. This is how quickly an application turns into bloat because a "true" design pattern was not implemented from the get-go.

Don't worry I get it, you been brainwashed into thinking webforms controls are bad due to viewstate and extra lines of code VS injects into the html along with losing control over the id's then there is also the postback issue etc... but isn't the real solution to fix webforms/VS? Isn't using the code behind to bind up a list view and act as a bridge between the middle tier and UI a "workable solution" to a bad situation when it comes to separating concerns? If the web-forms code behind is merely calling classes in a middle tier how is that not separating concerns?

Some closing thoughts.

Look there is nothing wrong with MVC as a pattern, the issue is Microsoft's tools are lagging behind the technology (debugging, intellisense, class browser etc) and what Microsoft's final MVC implementation will be like is anyones guess, if it even makes it to maturity. Companies have spent an enormous amount of time and money jumping on the MVC bandwagon early and now stuck supporting some really ugly code.

Many cheerleaders are hyping this technology simply because it is new and "cool" and that type of bullshit doesn't do anyone much good. Pick technologies because it serves a purpose to your development efforts not because it is cool or because "DOT GLUE" or some freaking cheerleader says so. Using MVC doesn't mean separation of concerns, you still need a well planned out class structure or you will just end up with spaghetti code in a new framework.

Webforms is a mature product that will be around for a while don't dismiss it on a whim, it could end up saving you a significant amount of development time.

That is enough for today.

Happy Coding!
.Mark

Thursday, December 9, 2010

The Death Of Foxpro and the Birth Of the Entity Framework - another CTP anyway

There was an estimated 500,000 FoxPro developers at FoxPro’s peak around 1995, and millions of computers with FoxPro apps running (either DOS or Windows based) according to Ken Levy’s Blog. Still Microsoft in their ultimate wisdom- or lack thereof- killed VFP to force developers into the .Bloat/Visual Studio environment.

Today Scott “The Dot Glue” is hyping AND spinning EF CTP 5 on his blog. Instead of my personal rants about how bad EF is, let’s take DOT Glue’s own example code and rip it to shreds with” code first” and see the future and the past to determine if we are really better off by comparing the EF to VFP.

After all “Source Code Doesn’t Lie”…

The Entity Framework CTP 5

Step 1 Model Class and DB Context classes.

Actually we have to build up the tables first, just a minor detail...

So let’s see what these model classes look like...

Public class Product
{
Public int productid { get; set }
Public int categoryid { get; set }
Public string productname { get; set }
// WTF is up with the ? talk about an after thought…
Public Decimal? UnitPrice { get; set }
Public Bool Discontinued { get; set }
public virtual category category { get; set }
}

Now we have to jerk with the category table class

Public class category
{
Public int categoryid { get; set }
Public string categoryname { get; set }
Public string description { get; set }
public virtual ICollection Products { get; set }
}

Public virtual is one of the bullshit commands that Microsoft loves since it struggles to do anything that is straightforward in Visual Studio. Basically we have two tables or collections, products and categories and there is a relationship between the two that is lazy loaded so EF needs a property for some screwy reason.

Now we need to create a data context – No I am not shitting you

Public class northwind : dbcontext
{
public dbset Product {get;set;}
public dbset Category {get;set;}
}

Side note: You need less then and greater than signs around the table names. The blogger editor stripped them out.

Thanks goodness THE GLUE doesn’t use any real world examples I would spend hours hand coding the classes.

Step 2 Configure the connection string

No big surprise a connection string in the app.config, if vfp was accessing a sql database we issue a sqlconnect no biggie either way.


connectionString="data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|\northwind.mdf;
User Instance=true"
providerName="System.Data.SqlClient" />


Step 3 Pull a collection from EF

DOT GLUE used linq in this example

Personally I hate the linq syntax it is sort of like reinventing the wheel and building a CUBE instead of a circle.


NorthWind Northwindw() = new NorthWind();

var p = from p in northwind.products
where p.category.categoryname = “Beverages”
select p;

Step 4 an EF update

NorthWind Northwind() = new NorthWind();
Product.Product = northwind.products.find(1);
Product.UnitPrice = 2.33m;
Product.Discontinued = false;

// this is where the VS Cheerleaders have an orgasm and praise gu!
Northwind.SaveChanges();

NOW Let’s run through this same example in VFP

Yes no class code or data context required.

For humor sake if we wanted a record object it would look something like this.

Select product
Scatter name oProduct blank
Select category
Scatter name oCategory blank

Yes that is correct in Visual FoxPro we use two lines of code no cryptic syntax no virtual relationship command. Even more important if the base tables structure changes no change is required to the code.

Next The Glue built a collection using linq… a cursor will work just fine in vfp.

Select * from products
inner join category on products.categoryid = category.categoryid
where categoryname = “Beverages” into cursor p

That looks familiar Native SQL in VFP sweet! Yes the same syntax can be executed against a sql database using sqlexec. This is important makes sure you read my closing comments with regards to sql commands and ef!

Perform an Update

Select product
= seek(1) // This finds a record

Don’t even complain about what happens if the record is not found THE GLUE didn’t handle that case either. Yes we could add the workarea and index into the seek command and use one line of code instead of two.

Scatter name oProduct
oProduct.UnitPrice = 2.33m;
oProduct.Discontinued = false;

// this is where VFP developers should be laughing at EF as we have been saving records with one line of code since foxpro for dos.
Gather name oProduct

Is it just me or are you having a WTF moment as well.

Folks Microsoft killed Visual FoxPro and now we have the entity framework don’t you love progress Microsoft Visual Studio style!


EF Validation

Next THE GLUE blogs about two property attributes: range and required. My first instinct when I read this was that is pretty cool. Then I sat back any thought about it for a minute and SAID this is bullshit and here is why.

If there is a UI involved the range and required validation should occur in the form! Now you are thinking yeah Mark you missed the case of a web-service and reusability. Fair enough but wouldn’t it be better to catch this in the business layer object of the middle tier and avoid a round trip to the server and connecting to the datasource etc- after all you die hard performance based MVC guys are worried about view state in the HTML being downloaded from the server slowing things down you should crap yourself if you have to load the EF data context when it isn’t needed.

Ironically in the next paragraph THE GLUE discusses Keeping things DRY





The “DRY Principle” stands for “Do Not Repeat Yourself".

Don’t you wish Microsoft came up with this idea with regards to the .NET FRAMEWORK that is all redundancy or how about 6 different Datagrids and list views and isn’t there two different View Engines for MVC. Better yet how about all the different flavors of Vista ... What an Joke!


The GLUE wraps this post up by getting us excited about other improvements

1) EF Code First CTP5 exposes a new set of change tracking information that enables you to access Original, Current & Stored values, and State (e.g. Added, Unchanged, Modified, Deleted). This support is useful in a variety of scenarios.

Well this sounds like VFP GetNextModified and GetFldState to me nothing new there.

2) EF Code First CTP5 now allows raw SQL queries and commands (including SPROCs) to be executed via the SqlQuery and SqlCommand methods exposed off of the DbContext.Database property. The results of these method calls can be materialized into object instances that can be optionally change-tracked by the DbContext. This is useful for a variety of advanced scenarios.

By advanced scenarios does THE GLUE mean cases that Linq to entities can’t handle or does linq to entities perform so poorly under some instances you really should use an SPROC? Regardless this was available years ago in VFP in the native VFP SQL statement and does SQLEXEC sound familiar to VFP developers?

THE GLUE writes in conclusion, EF Code First provides an elegant and powerful way to work with data [OBVIOUSLY HE NEVER USED A DATA CENTRIC LANGUAGE BEFORE LIKE VFP]. I [“THE GLUE”] really like it because it is extremely clean and supports best practices [IS THERE REALLY SUCH A THING AT MICROSOFT AS BEST PRACTICES WHEN TECHNOLOGY AND PARADIGMS ALMOST CHANGE DAILY?], while also enabling solutions to be implemented very, very rapidly [THIS HAS TO BE A TYPO]. The code-only [HE NAILED THAT ONE THERE IS A TON OF CODE IN VISUAL STUDIO APPLICATION DEVELOPMENT AND NOT MUCH RAD] approach of the library means that model layers end up being flexible and easy to customize….. [OH REALLY WE MAKE A CHANGE TO A DATA STRUCTURE AND LETS SEE WE NEED TO RECOMPILE THE EF AND CHANGE ALL THE CLASSES REAL FREAKING EASY]

I think it would behoove THE GLUE to use VFP for a while before writing a blog post as according to my blog post there is nothing new or elegant based on the sample code Scott GU is blogging about when using the Entity Framework. Obviously VFP should be the winner but even if you want to give the THE GLUE the benefit of the doubt, look there is not a thing in this example that is new or different at best this example is on par with VFP technology.

The funny part is the GU is getting praised on his blog for EF when it is doing nothing but causing more work and I am sure a few cheerleaders will flame me for pointing out just how bad the new EF technology really is…. And here I am trying to make their jobs easier by suggesting Microsoft builds (for you anyway - I went open source for all new web projects) development tools that work!

When all is said and done aren’t you glad source code doesn’t lie!

Until Next Time

Happy Coding!

.Mark

By the way in case you are interested here is the link to the no confidence petition for the entity framework started by several MVPS.

http://msmvps.com/blogs/peterritchie/archive/2008/06/25/entity-framework-petition-of-vote-of-non-confidence.aspx

Donn Felker Android and MVC

If you read my prior post I picked up an android phone over the weekend. This morning I checked out some android videos here is the Google Android Sessions video link if you are interested. There is some cool stuff being discussed if you are into mobile droid development or at least curious about it.

Then I went browsing around the interweb for some books on the subject and I came across a book and blog by Donn Fellker. He seems like a knowledgeable fellow, so I googled his name and came across an article he wrote for code magazine. Granted I am not a fan of CODE magazine by any stretch of the imagination, but his article summed up exactly what I have been blogging about perfectly with regards to MVC. I hope I don't upset Donn by reprinting an excerpt of his article here but it is definately worth sharing. (Donn if you find my blog and want this removed just let me know - I will still buy your book anyway :) )



Here is the link to the full article.

The point being is this, the Microsoft Cheerleader Squad led by Scott "The Dot Glue" are trying to convince developers that MVC is a productive development environment with their pride and joy showcase application, Nerd Dinner. Look don't buy into! While I don't know Donn personally or what his opinion is on Microsoft MVC but at a minimum, his acknowledgement that MVC html code gets "ugly" even with the "simpliest" of tasks is a breath of fresh air amongst all the hype that is being spun.

The bottom line Microsoft MVC is such a mess Microsoft rushed razor out the door and it is also the reason for the birth of the spark view engine.

Happy Coding!

Until Next Time

.Mark

Monday, December 6, 2010

Micrsoft the Next IBM

I checked out Scott "The Dot Glues" blog and he posted websites with great tips to do this or the other thing with Visual Studio and .BLOAT. For lack of something better to do I clicked on a couple links and found pages of steps and tutorials on how to do stuff with Visual Studio.

The first thought I had was, Scott "The DOT GLUE" doesn't get it! If in order to use a software development tool it take approximately 50 links on you blog and pages of tutorials to scratch the surface of steps required to make a tool perform tasks that should be native to the tool set, the software development tool FAILED! Given all the classes and bloat in the API wrapper classes known as the .NET framework that framework should do it all.

The issue is, .NET is NOT a FRAMEWORK, .NET's classes for the most part are merely wrappers over the operating system API much of which is still based on "LEGACY CODE". .NET is a mish-mash over whatever Microsoft has laying around or what some team is using at this moment.

I still can recall when YAG wrote the codebook for VFP. In approximately 200 pages with pictures you could have an application up and running with a pretty good idea of the basics of Foxpro. When was the last time you saw a visual studio book which was 200 pages long that explained this tool. It takes 200 pages just to unwind the freaking app.config and global.asax files.

Even with all that bloat, multiple frameworks and software involved in Visual Studio and blend you know, other then netflix I can not even think of one mainstream website or application for that matter written using Visual Studio and .BLOAT that is considered "cool".

On the operating system front Windows XP is the release when Microsoft finally got their os right, only to destroy it with Vista (gee that sounds familiar they did the same thing with Visual Studio after 6.0 was released). With Windows 7 I don't see any great adaption occuring. Window 3.11 and Windows 2000 were the last OS that had any big fanfare.

In the development tool arena Visual Studio 6.0 was the last good tool set that wasn't a bloated bug ridden mess. With MVC I actually get physically ill when I look at how far Microsoft's MVC implementation has managed to set software development back in terms of productivity. Perhaps only punch cards was more unproductive to use. Those cheerleaders that state we need to "get close to the metal" as justification for MVC are full of themselves and should spend more time deflating their overblown ego so they can drift back to reality instead of blogging. Here is a thought you want to be a real programmer then code in assembler so you can get real close to the freaking metal. Congratulations to Microsoft for splitting their own deveopment community.

On a side note ... Can anyone answer a couple questions, what is so freaking hard about building a webform designer that works? Damn this thing has been out forever and still unstable. I maybe could see a page rendering differently in firefox but IE doesn't even render correctly and Microsoft owns the browser's source code WTF? Further why can't anyone develop a class browser for VS that allows you to visually subclass UI controls? Even VFP could do this! Microsoft and the Cheerleaders love using the term OOP with visual studio but I seriously doubt the cheerleaders even understands what OOP means anymore. Soma or DOT GLUE do me a favor talk to Calvin I am sure he can help you with the class browser and explain to you why classes are important even at the UI level. Yeah I know you can hard code classes but this is supposed to be "VISUAL" studio not notepad with intellisense.

Anyway . . . .

Browsers: Internet explorer sucks balls each version has it's own set of hacks to get a webpages to render consistently across versions. Here is a hint for the IE team. FireFox is open source look at the code to see how to make a page render the same regardless what version of the browser you are using, you guys at Microsoft are great are stealing stuff go with what you know.

Websites: Live is dead. Bing is worthless and MSDN does anyone still use it. Not a single showcase website written by Microsoft. Sure there is Nerd Dinner that is a freaking showcase site and under a million lines of code .... How cool is that?

Office is still a good tool but the office team uses their own libraries and avoids .NET like the plaque.

SQL Server: I do miss using it on a daily basis, that is the one development tool Microsoft is yet to screw up.

Now we have the cloud coming. Which 95% of the average people are clueless what it does and for everyday users it serves no purpose. Again this is a business level technology which I struggle to see how businesses would be willing to turn over their data and files to Microsoft. My prediction, the cloud will have as much longevity as Microsoft BOB with the only exception being a few companies who see it as a way to eliminate some network cost.

I truly believe Microsoft is headed down the road of becoming the next IBM they have totally lost the "coolness" factor! If you dare question this logic here is a brief story.

I went shopping over the weekend to buy my grandson an IPOD for Christmas, my first stop was best buy. I looked down an aisle where Microsoft software was shelved then moved to the computer aisle there was no lines or enthusiasm people just stood blank faced while looking at the pc and the wore out windows paradigm like it was an AS400 mainframe.

I left and went to the mall, I walked into the apple store and it is packed with people, most of them were playing with apple technology or visiting the cool genius bar. People were calling ahead for reservations to talk to a sales person and exchanging ideas, in general they seemed excited about technology.

While waiting to make my purchase I had a vision of what it would be like if Microsoft had a Windows Store. There wouldn't be any employees at Microsoft's genius bar but video chat to Microsoft India where the support people would wear red polo shirts and ask you call them Bobby, Sally, Billy, Dick or Sue. Once you pose your question they would read a KB article to you, painfully detailing each of the 185,232steps required to upload a picture from Windows through the cloud to your facebook page, then assume you are an idiot for missing one of the steps which of course caused the process to fail and you have to start again. Moveover in the background you can watch them argue with each other over which way is the best way to upload your picture since of course there would be 531 ways to perform an upload and none straight forward. The mood in the Microsoft store would closely resemble a DMV office. The monitor above the bar, that displays the waiting list, would show the blue screen of death because a server in the cloud experienced a C0000005 fatal exception due to having the wrong version of the .BLOAT framework installed.

I suppose that is why Microsoft doesn't have stores, Ballmer is smart enough to have the same vision as mine, unfortunately he is not smart enough to fire the entire Visual Studio/ .NET management team then scrap Visual Studio and start over. Unless he is concerned that everything Microsoft does is worse then it's previous release, a lesson learned from vista.

After picking up the IPOD, I hit the wireless shop next. There stood the Windows 7 phone display, I looked at it for a moment but any interest I had in the phone was quickly lost when I thought of Visual Studio then proceeded to the android section where I ended up walking out with a 4g droid phone so I can "play" with mobile software development. Yes folks the ripple of effect of Microsoft Visual Studio even affects their phone sales.

Until Next Time.

Happy Coding and Think Open Source!

.Mark

Wednesday, November 17, 2010

DOT GLUE Firestater

It would be laughable the extent to which Scott Gu (DOT GLUE) will say or do anything if it wasn't for the fact corporations are spending money believing the ramblings of the cheerleaders like DOT GLUE and following their every word when making technology decisions.

DOT GLUE is blogging about the Silverlight firestorm event (firestorm is a proper name for it given that is what Microsoft started with silverlight when it failed to mention it's existence at a keynote) which is a complete contradiction to the path Microsoft appears to be following by those inside Microsoft that actually "KNOW" what they are talking about.

A commenter in mini-MSFT says that his/her “team got a direct message not to use the [Silverlight] technology.” Dynamic languages are also dying at Microsoft due to lack of interest from the public remember iron ruby?

Here is another excerpt I pulled off a blog today.

Microsoft to embrace and extend HTML 5?

Microsoft watchers are pouring over a series of Twitter posts from former Silverlight Product Manager Scott Barnes, now a user experience specialist at Australian development consultants Readify.

According to Barnes, just back from a week of briefings at Microsoft, there is intense internal debate about the future of HTML 5, newly implemented in the forthcoming Internet Explorer 9, and the Silverlight plug-in. He tweeted:

“Right now there’s a faction war inside Microsoft over HTML5 vs Silverlight. oh and WPF is dead.. i mean..it kind of was..but now.. funeral.”

WPF is Windows Presentation Foundation, the rich user interface framework that was originally intended to become the primary GUI API for Windows Vista, but was sidelined when Vista development was “reset” in 2004, and does not feature strongly in Windows 7. “There’s no-one working on it beyond minor touch-ups,” says Barnes.

“HTML5 is the replacement for WPF.. IE team want to fork the HTML5 spec by bolting on custom windows APi’s via JS/HTML5”

This would be a classic “embrace and extend” strategy, encouraging developers to create Windows-specific HTML 5 applications. It sounds like Microsoft is once again trying to create a browser monopoly like it has with windows, GOOD LUCK with that.

Folks Scott Gu is either completely detached from the realities of what is going at Microsoft or is in his own little cryptic bastardized kingdom. After looking at MVC I believe the later is true.

You can't trust Microsoft when it comes to technology they have NO PLAN or idea what is going on. With pre .BLOAT and VS tools like VS 6.0 it didn't matter what the internal conflicts at Microsoft were as their development tools was a separate product line. Now with VS and .BLOAT everything that happens internally directly affects developers as it is all intertwined into VS and .BLOAT which is why this product WILL NEVER have any stability. This type of nonsense is exactly why my decision to go open source was the correct one.

Your friend
.Mark

Thursday, November 11, 2010

MVC AND RAZOR BIZSPARK AND SCOTT GU AKA DOT GLUE

This is my first blog post in a while, I took some time away from programming. To bring you up to speed, I stopped using Visual Studio and .BLOAT and I made the switch to PHP, MYSQL and playing with Ruby a bit. Seems odd after 20+ years of programming and strictly with MS Tools since VFP 2.0 and interdev but it is worth it. Granted the open source tools may not be anything to get excited over and the syntax a little cryptic but it is nice to know you can actually learn a language or technology and it will be around a month from now.



On a side note: many of you may not be aware of this but I was a Microsoft cheerleader for VS 6.0, Sql Server and VFP 9. Now I dread even touching their software. My main pc setup I run linux and open office and another PC running XP used for Visual Studio and testing the sites on I.E. so I can put all the hacks in required to render a page correctly.

I just read the blog postings on the Internet about silver light, now Microsoft is back pedaling with silver light after they slipped up and let the cat out of the bag that this is a dying platform once HTML 5 is released. Yeah so what netflix uses silverlight I wonder how much Bill Gates paid them.

Here are some other tool sets or frameworks (I use that term loosely related to Microsoft) if you still think Microsoft has any plan for it's development product line, pop fly is in the grave after all the hype my Friend Soma wrote on his blog. From what I been hearing from a reliable source the Linq to Sql team has been dissolved and the ADO.NET team is taking it over, which they have already stated they are no longer enhancing the product. So the BLOATED slow and unstable entity framework with LINQ will be your tool of choice for data access, have fun! Remind me again when was the last time the MS Ajax toolkit has been updated?

Now all my new development is using open source development tools, I love knowing I am no longer feeding the Microsoft machine or supporting the economy of India. I am so glad I am outside the webforms mvc drama, hats off Microsoft for splitting your own development community. I still get the occasional client for which I have to painfully open Visual Studio. This one last week I had was blog worthy.

I had to implement several changes to an MVC website, I open up the source code and it is over 2 freaking million lines of code using the BETA version of MVC which is not compatible with the production version, WTF! Folks it took 2 hours to configure a computer just to maintain this code. Where is the productivity in that mess.

Trust me THE GLUE and the MVC lovers are full of shit about MVC. This company has 15 programmers supporting this single website and still required my assistance in implementing these changes because it turned into such a bastardize amount of spaghetti code and the performance was subpar. How can you expect anything else when the following array of technologies are used:

1) .BLOAT Wrapper classes
2) Jquery
3) Javascript
4) Blend
5) C#
6) CSS
7) HTML
8) Visual Studio
9) MVC
10) Webservices
11) SQL Server Stored Procedures
12) Entity Framework
13) LINQ
14) Dataset - to fill in the holes, like reporting, where LINQ and EF don't work
16) AJAX
17) ASPX - for somes pages that the MVC framework was to time consuming to use.

Folks this is what DOT GLUE doesn't tell you about the learning curve and technology overhead when you get into Microsoft MVC and blindly implement stuff after reading the blogs written by cheerleaders. Seriously MVC is 1970's programming writing htmlhelper a million times and alligator syntax it is seriously a step back closer to classic ASP.

Sure there are so many things wrong with this scenario as personally I wouldn't recommend using any Microsoft tools until service pack two is released (but the problem is Microsoft tools never make it into production anymore with any of their development tools they just call everything a RC, CTP) and definitely would NOT use beta software on a production website, but besides the point, 2 million lines of code what the hell are people thinking. Is that worth getting "CLOSE TO THE CHROME or METAL" however microsoft and the cheerleaders are spinning Scott Gu's and the Visual Studios Team's inability to build an innvoative productive development paradigm, write contols, class browsers (that works) and build designers. Given they can't write anything worthwhile on their own they copied Rails or at least tried to in their own BLOATED fashion. Disagree it is bloat refer to the above list.

Look point blank, Microsoft's MVC has zero RAD tools, no controls and for the most part you are on technology overload. Are developers that in love with .BLOAT that they pay to use an over bloated set of Operating System Wrapper Classes in controllers? If you want the MVC model use Ruby it seems to work well and the best part is it is not based on Microsoft's .CRAP wrapper classes.

What I find amusing is how Microsoft's is scrambling now to release the new MVC Razor view engine in hopes it fixes all the problems with their current view engine for MVC.

Then I read Scott GU'S blog and there are all these want-a-bees suck ups praising DOT GLUE for MVC release candidate 78,233 while DOT GLUE is posting comments about all the hacks and bugs in that framework and it has only been out a couple days. Didn't MSFT test any of this software? given DOT GLUE only writes elementary school tutorials on his blog that the want-a-bees cream over you know he won't find a bug in that framework, what a freaking joke.

Yes you read that correct DOT GLUE is stating in short YES WE F'D UP ANOTHER RELEASE and still the MSFT cheerleaders and want-a-bees are thanking him. This is directly off the DOT GLUE'S blog. "... If you installed the async CTP and the new MVC RC3 .... You will likely experience problems in VS with debugging (potentially other things)... I didn't paraphrase the (potentially other things) DOT GLUE wrote it - so what he is saying is he doesn't even know what the hell will go wrong.

Every person that posts thanks scott or cool, great job, I have a question for you what the hell is wrong with you? Look I will spell it out for you THE SOFTWARE DOESN'T WORK OR INSTALL CORRECTLY without jumping through hoops and Microsoft is even losing control of their technology base. Let me ask you this when was the last time a client told you good job for giving them software that is unstable? Moreover if you bought a car and the door wouldn't open and you were told just crawl through the trunk would you be happy. Why do so many developers HOLD MICROSOFT and DOT GLUE to such a pathetic level of competance?

The funniest post was some dude wrote: (and I am paraphrasing here) I opened up the MVC release candidate and I started to cry because this that and the other thing didn't work.... and DOT GLUE wrote some crap back like don't cry blah blah blah. I literally became physically ill reading his blog. Folks there is a reason this tool is ONLY being used by a small number of websites, regardless of how much spin DOT GLUE puts on it, its a trainwreck!

After being involved in the open source community for months now, I think there is such a negative impression and distrust towards Microsoft, and rightfully so, there is not a development tool they can release (and that includes Webmatrix - which is like an unfinished version of "access" for web development and still .CRAP based) that would gain back the developers that have left their camp. Soma is blogging about giving .BLOAT away under the Biz Spark umbrella to trick users into using it. Look, Microsoft doesn't care about your success, just ask any VFP or VB programmer, this is a marketing gimmick - don't buy into in. Microsoft is fully aware of the cost to change platforms so they give you their tools for free for 3 years (which is how long its take to write 100 million lines of code and hire a tribe of indian developers to use .BLOAT) knowing there is a high cost barrier to change platforms.

Unless Microsoft changes course, gets their head out of their asses and fixes this mess in 5 years the only folks still using .BLOAT and Visual Studio will be intranet corporate enterprise accounts, it will be a non-existant player on the web - sort of like BING (But it's Not Google search engine) and Live (is that even still around?).

Don't expect me to rip open source EVER, the software is free and it is the lesser of the two evils. Moreover the open source community didn't issue an end of life on every single development platform they had that worked, like Microsoft did. I find it completely ironic there is MORE stability in open source then with Microsoft tools.

Enough for now take care everyone.

Your Friend
.Mark

By The Way, If you read my Bing blog post when it first was released, I predicted it's failure and sure enough it happened, so what does Microsoft do, it gets balled up with yahoo and buys Bing's way into facebook and still can't make any inroads. Bing was written using Visual Studio and Google and Facebook weren't, need I say more.

Saturday, May 30, 2009

Bing - 3 Strikes Microsoft is Out!

First there was MSN search, it failed, then Live search was born, it also failed, and now raising from the smoke of two of the most expensive search engine screwups of all time comes the great BING (but it’s not Google) search engine. Yes friends, Microsoft is making yet another attempt to enter the search engine arena. Historically the Microsoft Search Engine and their Visual Studio Data Access Technology have a long standing common thread, they suck!

Looking into the future without having to even use the product, only watching the demo, Bing is going to be next in line to crawl into the bowels of cybernothingness.

You might be thinking to yourself Mark the product hasn’t even been released yet how can you make such a harsh pessimistic assessment that Bing is the sound the search engine is going to make as it hits the side wall of the garbage can. There are many reasons that I will once again be correct as usual.

First off, unlike in the development tool arena where Microsoft could purchase as many development tools as possible that were better then visual studio and then issue their end of life so developers were forced to use that piece of shit - ass licking - bloated - sucks worse then a vacation in Iraq - smellier then a India defaction pool in the middle of summer - development environment known as the .NET framework and Visual Studio. Thank heaven Microsoft is not able to buy it’s competitors, Yahoo or Google, so MSFT must innovate which it is completely unable to do. If you doubt this is true look at Vista, this was Microsoft's attempt to NOT copy the MAC OS in full and we all know what a great success that OS was.

Second, Microsoft isn’t capable of doing anything that is not bloated. The beauty of Google, besides the solid result set, is Google is simple to use !

Third, there is a large market segment that absolutely hates Microsoft besides the fact Microsoft is viewed as UNCOOL. These people will never use anything Microsoft related. The reason for their hate is more then justified let’s face it Microsoft's products suck and make everyone’s job harder, worse yet Microsoft could care less and continues on the path of never ending learning curve to make us less productive !

As a footnote below are some interesting facts about India from indiablogs.searchindia.com. Remember India is where Microsoft has 2 huge campuses and according to minimicrosoft India is where the .SUCK framework is developed. This Microsoft job exportation was due in large part to my good friend Soma!

* Indians leave about 100,000 tons of shit in the open every day, in the fields, on the river banks and in the middle of the biggest cities.

* About 665 million Indians shit in public or engage in open defecation (to use a euphemism), that’s half the world’s 1.2 billion who let go in public. [WOW while it is close but it looks as if more people in India dump the truck in public then there are classes in .NET4.]

* Each gram of feces contains millions of harmful bacteria and viruses and a thousand parasite cysts. [Ironically isn't this almost the same number of viruses that infected PC'S through Microsoft's pathetic Internet Explorer security model and bugs last year?]

* Over 37% of the total human excreta generated in urban India is unsafely disposed, according to the National Urban Sanitation Policy document prepared by India’s Ministry of Urban Development

* According to the 11th Five-Year plan document, of the 200 million dwelling units across India, only 40 million dwelling units have a toilet inside the house. Only 61% households in urban areas and 17% households in rural areas have access to improved sanitation. [I wonder how many of the people listed in the stats above work for Microsoft and even more interesting to know the number that are programmers working on MVC, WPF, Silverlight, Visual Studio and .BLOAT. I could be mistaken but the person pictured looks a lot like the .NET 4 lead programmer enjoying his break after coding for 50 cents an hour !]

* 12.04 million urban households do not have access to latrines and defecate in the open. [I think this is just about the same number of people that get sick after realizing they spent their hard earned money on Vista and Visual Studio]

* The Government of India acknowledges that lack of covered toilets nearby imposes a severe hardship on women and girls and yet does little. [I wish Microsoft would acknowledge the severe hardship caused by Visual Studio and .NET for developers. Like the Government of India, Microsoft does little to improve the situation.]

* The ultimate indignity of having to do it in the open. [Can this be equated to smart people that work at Microsoft that really need their job and have to advocate and spin .NET and Visual Studio as being productive?]

Aren't we glad India is the technology capital of the world ! Thanks SOMA without your efforts perhaps none of this would be possible and we might actually have a solid development tools like VS 6, VB and VFP better yet life without .BLOAT !

Until next time avoid bing and VS 2010 beta.

By the way I have joined facebook please look me up I would like to hear from you.

Your Friend,
.Mark

Wednesday, March 11, 2009

Who is really to blame for Visual Studio?

Scott's Gu posted a chapter from the new MVC book on his blog, which I finished reading a few minutes ago. I was amazed by the backward progression of "modern" development tools and programming techniques. Scott Gu, Microsoft and the cheerleaders act as if this debacle known as Visual Studio was created outside the sweep of history, or that they cannot possibly glean wisdom from yesterday's technologies. Is Scott Gu and Microsoft really so bright, so brilliant, so ingenious, that they need not consult with the wisdom of prior development tools used in the 6.0 days? Yes, the old fashioned musty things - can be our salvation - if only Microsoft would install them and realize how productive these "legacy" technologies are in comparison to .NET. Instead of learning from experience thereby building on the "legacy" knowledge base in order to guide future development tools, Microsoft and Scott Gu in a clear lapse of thought insist on reinventing the wheel. Their exercise in stupidity comes at great cost to developer productivity.

If we could provide only Lotus 1-2-3, as the next revision to our complex business systems that our client possess - then merely instruct them how to manually enter data into cells and create formulas while cheerleading the control they have over their data and complex algorithms they "get" to happily create spinning the extra work as a benefit -while we know know full well in their ignorance we would receive payment along with praise in the process for introducing them to this "great new user definable flexible technology" would we? If we answer yes, then we can't necessarily blame Scott Gu, Soma and Microsoft for the current state of Visual Studio and .bloat as we became the ignorant end users.

Perhaps we should blame the people who offer praise for Microsoft, pathetically thanking them for providing "new" technology and development tools that mandates hand-coding a user interface - employing coding techniques predating FoxPro 2.0 - which on a productivity level equate closer to Mainframe COBOL. The cheerleaders as much as Soma, Scott Gu and Microsoft bear the responsibility for our current state of affairs. Have we grown so accustom to horrific software by Microsoft, that lack of Visual Designers, debuggers and nonsensical glue code we now find praise-worthy instead of appalling?

If we don't expend the energy and time to speak up, we can only blame ourselves, when Visual Studio 2012 forces us to use technologies that resemble assembler.

.Mark

Thursday, March 5, 2009

Source Code Doesn't Lie #4: UI Framework Layer

The source code challenge creating a UI framework layer

The Winner - Visual FoxPro

Score card through 4 coding challenges:
The Legacy Visual FoxPro 4
The Great Visual Studio 0

--------------------------------------------------------------------------------------

Let’s start with a brief overview of what N-TIER design entails.

An n-tier application is one where the application is split into logic sections. These sections are the user interface tier, the middle tier where the application business rule along with data access programming resides and the data tier (the database). While all the tiers may reside on one or two computers or servers this model allows the application to be “scaled” to improve performance. In other words the user interface may reside on the client’s workstation or in a browser, the middle tier could utilize its own application server and the data tier would have its own server.

There are numerous benefits to this programming model besides scalability, for example the same middle tier and database can be accessed by both a web based interface or a client application interface. This means all the middle tier code and the database is shared instead of writing the code twice. Moreover a framework can be implemented to further reduce programming by creating a baseline of generic programming (classes) which the application is based upon. By employing a framework in conjunction with N-TIER design patterns we are able to create an application that is scalable, easy to maintain and provides a consistent programming model for maintenance along with a consistent user interface.

The most common mistake a programmer (and Microsoft for that matter) makes when trying to implement this design pattern is to place code that really belongs in the middle tier in the user interface tier or to access the database directly from the user interface layer.

Now that we have a basic understanding of the N-TIER model let’s move to implementing the classes that would be required by the user interface layer for a Visual FoxPro application and a winform application. I must be in a good mood tonight as using Winforms will paint Visual Studio in the best light. Microsoft royally screwed this model up in WPF and a comparison with Visual FoxPro would not even be close in terms of code and ease of implementation. On a side note: Yes they failed with Webforms and MVC as well .

Are you ready to develop a framework UI layer at light speed with Visual Studio 2008 and .BLOAT?

The first step is subclass the native development controls into a UI framework class. To keep things simple we will subclass a form, label and textbox class. Let’s start with Visual FoxPro, this step requires zero coding we simply use the class browser. As you see in the screen shot we have a base UI framework layer that is ready to use in our application. This took less then a minute to build.





















Now let’s perform the same task in Visual Studio. First off you can’t subclass UI controls in the class browser therefore we have to hand code each class. In order to save some code in Visual Studio - which I really freaking shouldn't - I will exclude the code necessary to workaround bugs that are related to setting default proprieties in the subclass that get jacked by the property sheet.

Now here is the Visual Studio Code that was NOT required in the legacy Visual FoxPro base framework layer.

//FOLKS: This is the Microsoft money section it forces your client to use the windows
//operating system. Steve and Bill count the dollar signs each time they see a
//USING system in your code.
using System;
using System.Text;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;

namespace UILayer
{

//Since VS doesn't have a class browser that works
//or an ide with code windows we need regions to keep the code manageable
#region forms

//Why in the hell do I have to add an attribute to my class that
//tells the great Visual Studio what icon it needs to display in the toolbox for the class?
//
//The ide freaking knows it is inheriting from a textbox. It should display a default
//textbox icon then allow us to override it as needed.
//
//In VFP a property sheet could have been used and no coding would be necessary

[ToolboxBitmap(typeof(System.Windows.Forms.Form))]

public class SampleForm : Form
{

public SampleForm()
{
}

}
#endregion

//Blah, Blah Blah the same crap not exciting but it is code we should not have to write!
//All that should be required is us setting proprieties and the business logic.
// yes this is plumbing code!

#region textboxes
[ToolboxBitmap(typeof(System.Windows.Forms.TextBox))]
public class SampleTextBox : TextBox
{

public SampleTextBox()
{
}

}
#endregion

#region labels
[ToolboxBitmap(typeof(System.Windows.Forms.Label))]
public class SampleLabel : Label
{

public SampleLabel()
{
}

}
#endregion

}


It is obvious FoxPro requires less work as the more we keep adding to this model the worse things get for Visual Studio. Adding methods, proprieties and inheritance are all done in the class browser visually with the legacy FoxPro and using the Microsoft's Latest Technology Visual Studio 2008 with 70k class of bloat in .NET this it is all done in code.

If this nonsense was not bad enough; let's say for example you decide to use the wizards in Visual Studio instead of using subclasses, guess what happens? (Don't think this wizard code is not used in the field I see it all the time in applications). Anyway back to my point guess what occurs, I will tell you, a WTF MOMENT occurs - that is what. The visual studio wizards embeds data access code into the user interface layer, not only do we lose the value of inheritance and have duplicate code everywhere, the foundation of N-TIER design is broken by code generated by Microsoft!

Even the Visual Studio Cheerleaders will try to spin this extra work as a positive, below is an excerpt from code magazine…

“...Subclassing the base .NET Windows Forms controls is different from VFP because developers must write code to do so. You cannot subclass visually, but the process will provide good exposure to the language and the .NET Framework.”

What the hell are they talking about, they can't think we are that stupid - Let's read it again -

“...Subclassing the base .NET Windows Forms controls is different from VFP [hell yeah it is it is alot more freaking work in Visual Studio] because developers must write code to do so [which in any worthwhile tool we shouldn't have to]. You cannot subclass visually, [no shit thanks for pointing out the obvious, they should have mentioned due to the fact the visual studio class browser sucks] but the process will provide good exposure to the language and the .NET Framework.”

Yes I read it correctly, they wrote "this process will provide good exposure to the language and the .NET framework" - are they freaking joking me?!?!? Here is what I have to say to the code magazine Visual Studio cheerleaders “SCREW THAT”. This is a major bug in Visual Studio call it exactly what the F&$K it is!

I hate to do this I really do, but we have to dig deeper into this idea of "providing good exposure to the language and the .NET framework".

First off I need to ask this, how many freaking times during the application development process do we need to WASTE time getting "good exposure to the language and the .NET framework". WTF - With all the code we have to write in Visual Studio do they think we are going to forget? There is less typing involved in a Mavis Beacon teaches typing dvd. This is a perfect example of what I have been saying all along folks, cheerleaders will do or say anything to hide the truth of Visual Studio.

Secondarily please stop calling .NET a framework. .NET is NOT a framework. For the most part Microsoft took the Windows API layer and wrapped it in classes - that is all the majority of .NET is. Moreover a portion of .NET is based on outdated legacy technology that has been around since early version of windows, yes before Visual FoxPro. There are basic principles of framework design: I will pick 2 general ones everyone can understand, a framework should eliminate code redundancy and a framework should provide a consistent way of coding. How in the world do we have a consistency in .NET when there is class redundancy everywhere, for example we have 6 bad ways of accessing data alone, that is not eliminating redundancy that is BLOAT! If .NET fails the first two general tests required to be considered a framework then it is not a framework!

Getting back to their quote "good exposure to the language and the .NET framework", If we apply their logic for minute to a car, would anyone want to push a freaking car instead of drive one because the car maker failed to design the engine correctly? Your answer would be NO - but a cheerleader would say that is fine because it would provide good exposure to fresh air. Yes, this is as freaking unbelievable as it sounds, and that is the idea they are trying to sell us on.

The bottom line is Visual Studio is so bad and unproductive it can not be defended using rational arguments so cheerleaders invent crap like "exposure to the language". The pathetic part is, believe or not, these people (and I purposely left out their name) are good programmers, why they insult their intelligence time and time again for Microsoft and Visual Studio is mind boggling? Here is a thought, they want to help the Visual Studio community, then in their next issue of code magazine demand Microsoft give us tools so we can get our work done in the most productive way possible, freaking get some balls and point out the bugs. Look, if you don't have the balls to speak the truth for fear of biting the hand that feeds you, just direct your readers to my website and I'll do it.

I will break down what I think transpired, Microsoft was smart when they issued the end of life of Visual Basic and Visual FoxPro in this respect. Before Microsoft killed these solid products Microsoft grabbed the more respected cheerleaders in each community and promised them 75 virgins besides Vista Ultimate to spin Visual Studio. Microsoft was betting that the Visual Basic and FoxPro development community would blindly take the advise of community leaders and just follow along. (Well it wasn't the virgins, actually most got offered jobs in Redmond then disappeared into the woodworks-I should find Griver's letter to the VFP community on the end of life and analyze that to prove my point) . Then with the Visual Studio community, Microsoft didn't want non-microsoft employees leading the development community so they created the Microsoft Evangelist network, these are the A-team cheerleaders that spin visual studio. You know what, sadly for us, this plan worked perfectly. Developers are listening to the cheerleadering squads, which is exactly why we are stuck with this crappy bloated bullshit platform to write applications with. I have said it all along Microsoft may not release the best software (With Vista and Visual Studio I'm being nice) but they are smart when it comes to business.

Ok I will get off my soap box, well there you have it another code challenge and Visual Studio lost again to Visual FoxPro. It is time to move off the class browser, inheritance and User Interface Layer for the time being as the Visual Studio suck factor is obvious. In the next installment of source code doesn't lie I will put LINQ-TO-SQL up against VFP'S native data centric language. Perhaps we can develop at light speed when creating middle tier components that perform basic business processing.

By the way if you haven't checked out the Ms. Fox Pro (Ms. means female not Microsoft) video, do so, it is posted on my blog and also my facebook page.

Until next time, be productive Developing at Bloat Speed!

.Mark

Sunday, March 1, 2009

Weekend Update: Dot Net Chick VS Ms. Fox Pro

I was thinking today, what if Apple bought FoxPro instead of Microsoft? Given there was a FoxPro for Mac version it might have been possible. I'm sure Apple would develop a "simple" way to port my code over to the iPhone without a complete rewrite. My application would also run in any OS instead of being "used as bait" to feed the Microsoft monopoly by locking my clients to Windows through .BLOAT, you know the OS api wrappers Microsoft and the cheerleaders spin as the .NET framework.

More importantly, if Apple would have bought FoxPro just think what great commericals Apple would have made to actually market FoxPro something Microsoft failed to do. Wouldn't it be cool if Apple would have followed a similar Mac vs PC format. Instead of the PC and Mac guy we had the DOT NET chick vs Ms. Fox Pro, like in the video below, I wonder which one you would perfer to take you where you want to go today?

Definately check it out!



Like everything there would be some downsides to Apple owning FoxPro, I would have to find some hobbies to occupy my free time. You know the time that I now waste writing tedious nonsensical Visual Studio "plumbing and glue code" that wasn't required in legacy technology, and working around bugs in LINQ for example when used in the middle tier

Unforunately, I snapped back to reality only to look down at the Visual Studio IDE and thought life can be a real bitch sometime!

In closing, later this week I will be releasing my next installment of Source Code Doesn't Lie: The User Interface Layer. You want to be sure to check it out!

Until then have fun and "Develop at Bloat Speed!"
.Mark

Monday, February 16, 2009

Source Code Doesn't Lie

MSFT'S NEW CATCH PHRASE - VISUAL STUDIO: DEVELOPING AT LIGHT SPEED

Perhaps they confused the source code with FoxPro when they came up with this slogan as the code comparision is complete. To develop the same application between Visual FoxPro -vs- Visual Studio the results are:

VISUAL FOXPRO 26 LINES OF CODE - 8 MINUTES *from scratch

VISUAL STUDIO 2008 POWERED BY 70K+ CLASSES OF .NET BLOAT 300+ LINES OF CODE - 35 MINUTES! *using some of my prewrriten framework components!

------------------------------------------------------------------------------------

Background

If anyone has been following my friend Soma’s blog, Someone named Sam and I have been debating the pros and cons of using Microsoft's Latest and Greatest Rapid Application Development Toolkit otherwise known as Visual Studio/.NET compared to the outdated legacy Visual Basic and Visual FoxPro development tools. In the event you haven't been following this I will give you the short version of what has transpired so far:

Sam appears to be your typical VS cheerleader or Microsoft employee not sure which as he refuses to answer the question even thou I asked him multiple times. He is very pro Visual Studio to say the least and needless to say I have a difference of opinion. After several rounds of back and forth debating various points, I asked him to write a small N-TIER application using The Great Visual Studio 2008 and I will do the same using the outdated legacy application FoxPro 9.0..

Now here is the really cool part Sam would like nothing better then for me to quit posting on Soma's blog and furthermore he would be delighted if I quit telling the truth about Visual Studio, I'm sure Soma would like that as well. Therefore I stated if Sam could write this application in fewer lines of code using Visual Studio 2008 then I can in Visual FoxPro I will stop posting on Soma's blog. Seems fair enough. I will extend this offer to Soma and Scott Gu as well. Just post the code in the comments of my blog and use Visual Studio 2008 - I really don't care if they use VB.NET or C# just make it a simple N-TIER application hopefully using LINQ so I can mock the poorly implemented data context and helper objects that are required to use Linq in the middle tier.

Now common sense would lead us to believe a new great technology such as Visual Studio powered by all bloat in .NET should be the easy victor after all would Microsoft's marketing department and the cheerleaders try to misinform us? Especially since FoxPro is no longer worthy of even being produced anymore by Microsoft.

Specifications

The specs are simple, create a very small N-TIER application (user interface, data layer, database) that simply displays a form, connects to SQL Server that pulls some customer data from adventureworks or northwest sample database. Display the data in a grid formatted correctly (phone numbers etc) contained on the form and include a command button to save the data to excel. .

Actions speaks louder then words

Given I made this wager I wanted to keep up my end of the bargain. I wrote this little application. The application required 26 lines of FoxPro code and took 8 minutes to generate. There is some code that the form designer auto generated that I did not count. At the end of the blog I included all the code.

The WinForms C# version which I wrote tonight also, using my C# framework required 35 minutes. I do not have an exact line count as I had to allow for my framework code. Making a rough estimate excluding framework code, the application is around 3o0 lines of code.

Since I already had much of the functionality written into my "framework" it is hard to tell exactly how long this would take by hand to code out, I'm guessing a minimum of 2 hours assuming codeplex was used to steal some sample excel export logic since VS doesn't natively export to excel, as a sidebar can you freaking believe 70k classes of bloat in .NET and can't freaking export a dataset to excel WTF! - anyway- However, if you wrote everything from scratch including the excel export (which would be the fairest comparision given that is how I wrote the VFP application) I would bill this out at a minimum 6 hours using Visual Studio 2008 and .BLOAT.

Development Cost

Visual FoxPro: If I used VFP dbf files instead of SQL Server this application would cost about 50 bucks as that is the minimum I charge. Of course VFP has a royalty free distribution so no licensing is involved and yes it would support more then 20 users.

Visual Studio: The Rapid Application Development Tool Visual Studio Microsoft Latest and Greatest Development Environment required more then 10 times more code then Visual Foxpro to write the same application. YES THAT IS RIGHT MORE THEN 10 TIMES MORE CODE THEN FOXPRO. Being generous I will use the 2 hour estimate for the sake of argument. If we assume 125 a hour is the going rate for a Visual Studio Programmer the cost is 250 dollars. Then we still have to be concerned with data storage and hardware requirements to even get the application to run.

Even if you really want to remain in your fantasy Visual Studio World and think I don't know what I'm talking about, as misguided and flawed as that thought pattern is, below is a comment from a Microsoft MVP regarding the cost of a Visual Studio application.

...Les Pinter has a nice strategy for selling VFP apps.He first shows to his audience, most likely managers and budget-responsible people, the whole myriad of classes and possibilities of VB.Net of C# or whatever they can come up with.He is driving them crazy with all the things you can do in .NET to a point where they ask him for a price to develop that must-have application XYZ.He gives them the price and the time to deploy the app and tells them there is an alternative.... and then says, "nahhh, you probably won't be interested, it will cost you only 25% of the price I just mentioned but it won't be interesting of you". Well, those budget-responsible people ARE interested then, and then he shows them his "special framework, developed in C++, AKA VFP".He drives their minds to a boiling point with another show-off from VFP and compares that with the things he just showed to his audience. And shows that it is indeed, remarkably quicker, and, what's more, cheaper!!

Waiting for the cheerleaders to prove me wrong

I will give Sam or any other cheerleader for the matter that disagrees with my assessment sometime to respond perhaps a couple of weeks and we can see what the self proclaimed expert VS programmers can do. If I don't hear anything, which wouldn't surprise me, I will post my VS code.

I even took this one step further I offered to pay Sam to code the application in WPF and Winforms. The only catch is I get to post the code on my blog. So we will see if Sam takes me up on my offer.

Cheerleaders - No excuses for Visual Studio Please - Source Code Doesn't Lie

I know the arguments the cheerleaders will make:

1) This application is simple - Have you happen to see the examples GU uses to showcase new technology none of it is real world, cheerleaders get off and praise him for it! The size of the project shouldn't matter! The bottom line is new technology should be better then legacy technology even for simple tasks that is called progress. If new technology is not better then legacy technology it is called going backwards. If we have to pay more for new technology so we can move in a backward direction that is called getting screwed!

2) Visual Studio can do all this cool stuff Visual FoxPro and Visual Basic Can't - Some of this argument might be valid but guess what C++ can! And yes C++ DLL libraries can be consumed by FoxPro more over many small and medium size businesses only require a LAN based crud database application they don't need enterprise based features.

3) What about internet - I'm referring to lan based desktop application database development for small and medium size businesses. The market Microsoft can careless about!

4) What about data level security - Guess what FoxPro can access SQL Server so how is FoxPro to SQL Server different than Visual Studio to SQL Server. If it is written correctly!

I'm sure they will come up with other excuses and I will deal with those as they arise.

Why do this to the Great Visual Studio and expose the truth?

No I'm not pro-mac or unix over Microsoft. I develop for the Windows platform, I really wish they gave us the "right" tools for the job - that is what I want. What I am is totally pissed about is the amount of extra work VS requires to code out an application compared to other development tools that Microsoft has stopped producing (VB/VFP), the high cost of ownership related to Visual Studio for small and medium size businesses, all the cheerleadering/bullshit going on how great VS/.BLOAT are - this amounts to spin and wishful thinking.

Furthermore, VS lacks a complete implementation/integration between technologies such as WPF/ Winforms (Can you say blend) and MVC and ASP on the web side of things, everything floats out there in a half finished state of suck! Then there is all the bs plumbing/glue code to get everything working right which we should not have to worry about especially on the web side of development - want examples just view GU'S blog it is full of it.

Microsoft is also trying to redefine OOP and N-TIER standards by totally taking the focus off reuse and creating a cluster-f&*k in the UI layer - yes this includes WPF / XAML! Moreover Microsoft is spinning OS api wrappers as a framework and VS as being object oriented - then they goes as far as treating data like objects which has huge draw backs besides the bloat in the dataset object. In my opinion data should be treated as data but yet a UI control, which should be subclassed can not be in the class browser and requires jumping through hoops to code these classes out from scratch in c#!

Finally VFP has a great data centric language engine that should be part of Visual Studio which Microsoft owns the source to but they are too freaking arrogant to implement it, so instead we have 5 different miserable data access strategies in Visual Studio and we simply pick which one sucks less to implement in the application based on the requirements. Despite what you hear and read all of them have limitations in the middle tier that requires various ass backward workarounds and helper objects.

Look VS has a clear niche it is enterprise application development I will not aruge that, as a matter of fact that is exactly the technology I would use for enterprised based applications even with it's high suck factor! VS/.BLOAT are more productive to use then C++ to obtain certain functionality which exceed the capabilities of VB/VFP. However this is more the exception then the rule. For Microsoft to kill off VB/VFP and expect us to shoehorn VS and .Bloat in the small medium size business market is bullshit it doesn't fit!

This is why this blog exists and I waste my time with my friend, Soma!

Some other random thoughts

1) I want to give Soma credit, as least he posts my ramblings on his blog that is more then I will say for Scott Gu!

2) I also made the point on Soma's blog why wasn't WPF used in windows 7? Needless to say I'm not the only one raising this issue, despite what Sam would like for you to believe. Here is the link ... http://blogs.zdnet.com/carroll/?p=1890

FINALLY: The results and Foxpro code in detail

VFP Lines Of Code:
Form Init: 10 (Most of this code just sets properities which could have been done using the property sheet)
Button Click Code: 5
Middle Tier Code To Populate A Cursor: 4
Middle Tier Code To Generate an Excel File from a FoxPro Cursor: 7

Note: If you set the properites using the designer instead of coding it out, the amount of code required for this application is more then cut in half.

Total lines of code I had to write: 26
Time to build the application: 8 minutes


Below are the screen shots and code to evidence I actually did write it.

Using the class brower in Visual FoxPro, which works by the way, I exported the form and class code. The VFP class browser can also sub-class UI controls try that in Visual Studio!



















**************************************************
*-- Form: form1 (d:\sam\sample.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 02/16/09 10:46:00 PM
*

* NOTE: THIS SECTION OF CODE VFP AUTO GENERATED FROM THE FORM DESIGNER

DEFINE CLASS form1 AS form

Top = 76
Left = 252
Height = 393
Width = 691
DoCreate = .T.
Caption = "Form1"
odatalayer = ""
cfilename = ""
Name = "Form1"

ADD OBJECT grid1 AS grid WITH ;
Height = 336, ;
Left = 0, ;
Top = 29, ;
Width = 696, ;
Name = "Grid1"

ADD OBJECT command1 AS commandbutton WITH ;
Top = 365, ;
Left = 312, ;
Height = 27, ;
Width = 127, ;
Caption = "Command1", ;
Name = "Command1"

ADD OBJECT command2 AS commandbutton WITH ;
Top = 365, ;
Left = 438, ;
Height = 27, ;
Width = 127, ;
Caption = "Command2", ;
Name = "Command2"

ADD OBJECT command3 AS commandbutton WITH ;
Top = 365, ;
Left = 564, ;
Height = 27, ;
Width = 127, ;
Caption = "Command3", ;
Name = "Command3"

ADD OBJECT label1 AS label WITH ;
Alignment = 1, ;
Caption = "Label1", ;
Height = 17, ;
Left = 8, ;
Top = 7, ;
Width = 121, ;
Name = "Label1"

ADD OBJECT text1 AS textbox WITH ;
Height = 23, ;
Left = 137, ;
Top = 3, ;
Width = 551, ;
Name = "Text1"

* END AUTO GENERATED VFP CODE

PROCEDURE Init
* Note I added two properties to the form cFileName and oDataLayer using the property manager
* Reference to tell VFP where the class library can be found
SET CLASSLIB TO datalayer.vcx
* Get rid of the word NULL in the grid
SET NULLDISPLAY TO ""
* Set a caption on the form
THISFORM.Caption = "VFP Example"
* Set the label caption for the filename to save and bind the textbox to the property
* Note this could have been set using the property sheet
THISFORM.Label1.Caption = "Selected Filename:"
THISFORM.Text1.ControlSource = "THISFORM.cFileName"
THISFORM.Text1.Alignment = 0 && Right Align

* Set the captions on the command buttons
* Note: This could have been done in the property sheet
* I split these into seperate buttons for the purpose of code examples
THISFORM.Command1.Caption = "Get Filename"
THISFORM.Command2.Caption = "Populate Grid"
THISFORM.Command3.Caption = "Export Grid"
* Get a reference to the middle tier SQL data layer
* Note: The class could have been dropped on the form
THISFORM.oDataLayer = CREATEOBJECT("cusSqlData")
ENDPROC

PROCEDURE command1.Click
* Use the built in VFP GetFile dialogue box
THISFORM.cFileName = GETFILE("XLS")
* Refresh the textbox
THISFORM.Text1.Refresh()
ENDPROC

PROCEDURE command2.Click
* Get a cursor from the adventurework person.contacts table for security I did not display the connection string
THISFORM.oDataLayer.PopulateCursor("Contacts", "MyConnectionString", "Select * from person.contact")
* Bind the dataset to the grid
THISFORM.Grid1.RecordSource = "Contacts"
ENDPROC

PROCEDURE command3.Click
* Export the sql contacts table to excel
THISFORM.oDataLayer.ExportCursor("Contacts", THISFORM.cFileName)
ENDPROC

ENDDEFINE
*
*-- EndDefine: form1
*************************************************


**************************************************
*-- Class Library: d:\sam\datalayer.vcx
**************************************************

**************************************************
*-- Class: cussqldata (d:\sam\datalayer.vcx)
*-- ParentClass: custom
*-- BaseClass: custom
*-- Time Stamp: 02/16/09 10:32:12 PM
*
DEFINE CLASS cussqldata AS custom

Name = "cussqldata"

PROCEDURE populatecursor
* tcCursorName name of the dataset to return
* tcConnString name of the connection string to use
* tcSelectStatement to execute against the sql database
LPARAMETERS tcCursorName, tcConnString, tcSelectStatement
* lnHandle holds a connection to sql server
LOCAL lnHandle
* Connect to sql
STORE SQLSTRINGCONNECT(tcConnString) TO lnHandle
* Create a dataset
SQLEXEC(lnHandle, tcSelectStatement, tcCursorname)
ENDPROC

PROCEDURE exportcursor
* tcData name of the cursor to export
* tcFileName name of the excel file to create
LPARAMETERS tcDataSet, tcFileName
* This code is not needed for this example but
* it is a good practice when changing workareas to save off the current one
LOCAL lnSelect
lnSelect = SELECT()
* Create the excel file
SELECT (tcDataSet)
COPY TO (tcFileName) TYPE XLS
* Return to the original workarea
SELECT (lnSelect)
RETURN .T.
ENDPROC

ENDDEFINE
*
*-- EndDefine: cussqldata
**************************************************

Until next time - Develop at bloat speed!

.Mark

Saturday, February 14, 2009

Windows 7: Vista Renamed!

Sorry I haven’t been around much as I’m sure my friends Scott Gu and Soma missed my blog entries but I spent the last month on site with a client from Louisville Ky, fixing yet another Visual Studio application abortion written by some over zealous Microsoft technology cheerleader.

While onsite one of the things the client asked was if the VS application would run on Windows 7. Given I prefer to wait until service pack 2 is released before using a Microsoft product, vista proved 2 service packs may not even be enough. I honestly told the client it should but then again it is a Microsoft product so who knows.

So one of their helpdesk people and I found a XP machine and decided to try it out. It didn’t take long at all to have my first WTF moment, apparently Windows 7 does not have an XP upgrade path. Therefore we ended up reformatting the machine which is probably a good idea anyway but still this is the lack of thought shows just how pathetic Microsoft is. What were they thinking everyone uses Vista?

The Windows 7 operating system is not sexy and looks for the most part like Vista with poorly implemented stolen inspiration from KDE and Mac. Not surprising they took the worse part of office 2007 (the suck ribbon bar) and implemented it all over the place in the OS. At least Microsoft’s lack of innovation reputation is still intact.

While the Windows 7 OS seemed a bit snappier then Vista, then again what OS isn’t, it was still not as quick as XP. Of course there was a crash right after installation due to a video device driver problem (what a fing joke) and without hacking the registry, as least that I could find, you could not install unsigned device drivers.

One thing I did find very interesting is the lack of WPF used in Windows 7. Given WPF has been out for more then 2 years you would think Microsoft’s own internal development would have used this great framework (yeah I even laughed at that one). It seems the only package Microsoft is releasing with a WPF UI is VS 2010 and even that will be some hybrid UI, according to my friend, Soma’s blog,

At the end of the day we were able to get the application running on Windows 7 but my first impression is Windows 7 amounts to nothing more then Vista Service pack 7000 and far from anything to get overly excited about unfortunately. Windows 7 is simply just another attempt to fix the magnitude of issues in Vista.

.Mark