It’s not a complaint as I use WordPress myself on this site but sometimes I’m just surprised how many people come to me for something and they’ve got a WordPress install.    I’ve been working with a Baton Rouge Sign company who has a website that’s “just a website” and it runs WordPress. People seem to use it as a quick CMS of choice for just about any situation and it certainly does work well. Even Microsoft pushes WordPress in their web platform installer for developers to consider.

The bad side of this is often developers just setup and forget these installations. So a business owner calls me in and I’m facing a version of WordPress completely out of date with multiple out of date plugins installed. Most updates that come out are around security which means over time site owners become more and more susceptible to hacks.   So I guess if I could complain about WordPress it’d be that an automated mechanism for notifying an owner concerning updates would be nice and doable.   Heck it might exist as a plugin I just haven’t looked it up yet.

Ok mini rant/excuse to blog over.

, , ,

Software development is an insane business.   Truly.   The definition of insanity(as most know) is repeating the same thing over and over and expecting a different result.    And despite years and years of learning and hammering to make things “modular”, “decoupled”, “services” and “layered” developers still come in and continue to tightly couple applications to the point that I feel like I’m staring at a giant obelisk.    There’s no way to do anything with it beyond take it for what it is and start building another.

I feel like console applications are a way to prevent some of this especially in the phase of building domain, data and business layers.    In my experience developers get wrapped up in things like MVC, Silverlight, ASP.NET, WPF, Mobile and whatever the end goal interface is.    They want to go from bytes to complete functionality and press a button so badly that they rush through everything.

Writing a console  application is a chore to most of the undisciplined.    It takes focus away from the end result and allows you to focus on the business of what you’re writing.   It stops you from hanging up on some pointless JQuery subtleties for days when you’re supposed to be building an appropriate business logic functionality.   Hell short of standing behind a developer II with a gun I can’t get them to actually digest the purpose of a View Model because going around it is quicker and allows you to close a task in 10 hours when it’s scheduled for 40.

When a person who’s written several more applications to you in the specific enterprise you’re in schedules tasks for 40 hours and you finish them in 10 you should think perhaps you’ve worked with a bit too much haste. 

I came to the conclusion to write console applications for anything not so long ago after an interview in 2010.    A solutions architect came in to interview me and flipped a laptop open and asked me to write some functionality.    At that point I NEVER wrote console applications however I figured it out and he rather enjoyed the result.   I got to know this guy a little better and found that he wrote console applications for everything being that he worked in integrations and had zero care for interfaces.     It wasn’t important as he only wrote services.    I decided to try my hand at this on return rather than trying to bolt up functionality clumsily to whatever flavor of interface technology we were focusing on at the time.

The quality of code and the bug rates were noticeable to say the least.   Domain errors were reduced, business logic bugs were identified sooner and tests were run cleanly before a single fancy Telerik control hit a page.   There was no scrambling later and reproducing code in multiple places because you accidentally added business logic to view models in a Silverlight project that you needed in an export service later.    Further we were able to quickly produce those fancy client applications because we didn’t have to perform changes to a domain that crippled some aspect of your MVC application because you worked directly with your domain objects.

Kind of all over the place in this rant aren’t I?   The point is that when you use a console application to perform taste tests on your products you don’t make near the mess.    All the great products out there by Microsoft, 3rd party vendors and open source products are so enticing that they take focus away from creating quality software.     I think that if you’re in an environment with a lot of developer freedom you should go console application first while creating the ground work of an application.   It’s in my opinion the best way to stay focused on the right kind of interfaces and create sound software.

I’ll probably read this next week and disagree with a bit of it but hey take it for what it is.   A rant based on my experience.

My beautiful wife decided I deserved a Kindle Fire as a Christmas present this year.   I read a lot and have commented that book size often makes it difficult to read in the room.   Additionally she wants to sleep and I want to read so light can be an issue.    Being thoughtful she purchased this great little device for me which I was extremely happy to see.

The features for the price is awesome on the Kindle Fire.

This thing is truly awesome.  It comes with a one month free subscription to the Amazon Prime service which really makes it easy to hit the ground running with this toy.   I took the opportunity to read the first piece of 21st century fiction I’ve taken the time to read   I read “The Hunger Games” in about 3 days with this little device.   It makes reading so easy with it’s size, screen and feel.   With the Wifi option I could easily swap over and look up words, do a little Googling/Wikipedia time.   For my situation it’s a great device.

My Reading Speed Seems to Have Increased.

This is something I didn’t really anticipate when using one of these devices but I seem to be reading faster.   A book that previously took me a week can be read in about half that.   I’ve read a few books with the think now and it’s very noticeable.    I think the combination of the size along with the adjustable brightness to the screen make it far easier to read longer on a device such as the Kindle Fire.   Great for me because I digest the material much quicker.

Kindle Fire vs Ipad

Without dispute the Ipad is a superior device in all areas.(especially price)   The Fire is a great device if you want to read books and browse the internet.    I also watch WiFi  video and listen to music.      The question comes down to a few things you can honestly ask yourself.

  1. Do you need to use it for business?   -  If the answer is yes then you don’t want a Fire and likely want the very mature Ipad.
  2. Do you need the larger tablet screen?  – This really makes a difference.   I strongly encourage you to try out several pad sizes before purchasing.  I don’t need a large screen although it would be nice.   However for the cost I am happy with my Fire.
  3. Do you need more than Wifi?   -  Hasn’t been a big deal to me with the Fire.   I have Internet in 90% of the places I go.
  4. Do you needa gyroscope, camera, WAN module, Bluetooth, microphone, GPS, or micro-SD?   None of these things are in the Fire.   If you want a true gadget then buy a more expensive device.   You truly get what you pay for and Fire covers the needs of me and probably over half of users which makes it a great niche device.

 

, ,

I have the pleasure of being the lead developer in a ramp up of some new software we’re building. I have other experienced devs with me but none of them are experienced in Microsoft’s MVC and we have time to ramp them up while exploring MVC and available options for navigation, controls and other front end components that will be important and we don’t want to waste time on later. One of my devs is specifically working on a layout with a specific navigation criteria. We own Infragistics controls and are open to anything that gets the job smoothly so we tried both sets of MVC extensions.

Infragistics controls install via an installer. I’ve used their Silverlight controls for some existing applications and they worked great. Their MVC controls look very nice in the demos(although no menu control) but we tried them first to see what they had to offer. My developer had a seriously hard time getting the demo grid to work in his existing MVC application due to resource and path issues.

Telerik offers a larger variety of MVC controls. Infrigistic offers some of the same controls and some that Telerik doesn’t but we found that Telerik had a more complete suite for what’s important. Additionally the amount of time for our developer to get started using the controls was dramatically less. In fact when I suggested he use the controls it took him about an hour to get it working within the demo whereas he spent about a day fighting with Infragistics.

Based on our one day assessment I have leaned towards suggesting we purchase Telerik in addition to our existing Infragistics components. It’s been a smoother experience, my other lead developer is an Telerik fan and in my experience at Tech Ed and other Microsoft events Telerik gets more love. It’s an added bonus I don’t have to take heat for the original Infragistic purchase since the guy responsible for that isn’t any longer here.

I’ll post back with an update if my mind changes.

, , , , ,

Baton Rouge has a Windows Phone 7 User Group.   One of my favorite things about the Microsoft products is there seem to be several communities popping up concerning their technology.   I volunteered to talk about my experiences as relates to the development of Pocket Brewer so I’m doing that.   The slides and demo code as relates to this talk are at the links below for anyone interested in them.

DummyWP7App – Windows Phone 7 Demo App

Pocket Brewer Power Point

 

 

Here’s a fun little piece of code I scraped together today for an ongoing issue we’ve been having. Seems for years nobody can figure out how to locate whether a user(jodom for example) exists in our Active Directory and how to add them to a group via C#. A few people have tried but always given up and used a web service built by a consultant that no one knows what happened to the source code. The service is a pain because it dies silently whether the user exists or not and whether it succeeds or not.(really dude)

The code isn’t that difficult as you can see and I’m almost certain my peers came up with something similar on previous attempts. I’m almost certain their failure was the result of not being able to obtain appropriate DN because nobody even our network engineers had heard of LDP Tool for Querying Active Directory(LDAP) which will assist you in building LDAP queries in C#. There’s obviously a disconnect there in the developer community because I must of ran through a dozen HELP threads on various .NET boards concerning this topic.

So….code is below and should work fine to add/remove a user to a group that the userName/password provided has Management rights to. It first uses the DirectorySearcher to find the DN of the account and then uses that DN for the Add/Delete. There might be a simpler(mo better) way to do it but this hammer works so swing it.

string NTId = "jsmith";
bool IsAdding = true;
string userName = "UserWithManagementRightsToGroup";
string password = "Password";
var exists = this.ObjectContext.SomeEntitys.Where(p => p.EmployeeID == NTId);
DirectorySearcher userSearcher = new DirectorySearcher();
userSearcher.Filter = "(&(objectclass=user)(objectCategory=person)" + "(sAMAccountName=" + NTId + "))";
if (userSearcher != null)
{
userSearcher.PropertiesToLoad.Add("distinguishedName");
SearchResult searchResult = null;
using (SearchResultCollection src = userSearcher.FindAll())
{
if (src.Count > 0)
{
searchResult = src[0];
string DN = searchResult.Properties["distinguishedName"][0].ToString();
try
{
DirectoryEntry entry = new DirectoryEntry("LDAP://domain.com/" +
"CN=My_Users,OU=Security Groups,DC=domain,DC=com",
userName, password);
 
if (IsAdding == true && !entry.Properties["member"].Contains(DN))
entry.Properties["member"].Add(DN);
else if (IsAdding == false && entry.Properties["member"].Contains(DN))
entry.Properties["member"].Remove(DN);
else if (IsAdding == true && entry.Properties["member"].Contains(DN))
OnError(new DomainServiceErrorInfo(new CustomError("Attempted to add user that is already in group. : " + NTId)));
else if (IsAdding == false && !entry.Properties["member"].Contains(DN))
OnError(new DomainServiceErrorInfo(new CustomError("Could not remove because user was not in group. : " + NTId)));
 
entry.CommitChanges();
entry.Close();
}
catch (Exception uhoh)
{
}
}
}
}

I just implemented this IIS Compression article on some business applications we’re delivering over a low bandwidth connection and it reduced. Interesting enough if you simply enable IIS compression as explained by Microsoft and a couple hundred other sites then you do HTTP analysis on how your Siverlight Business App is performing you’re going to see zero improvements. As explained in the article I listed above the Siverlight Business App template with RIA Services will be sending data over the wire in binary by default so it’s already improved. However this type isn’t compressed by default when you enable IIS compression so you’ll need to add the appropriate MIME type to the application host configuration file. Namely you’ll have to add this dynamic type:

add mimeType=application/msbin1 enabled=true

I can’t express enough how much this improves the performance of the requests to the application. Our app made many requests that returned 50-100Kb of data. Shrinking that by 80-90% per request was huge for how the application responded in the field. Compression is a must if you’re going to use RIA Services in a similar situation.

, , , , , ,

I just read over an excellent series on using Elmah. If you’re unfamiliar with Elmah it’s a great tool for logging and debugging exceptions in an MVC # app. Unfortunately we got to the Elmah stage on our application at about the point the application was being piloted. However it’s been a big help in smoothing out some of the errors in teh app. This series was specifically useful to us in regards to getting Elmah to send exception emails. The exceptions weren’t making it past the MVC Error Handling to be handled by Elmah.

Joel’s Elmah Post Series

Recently I’ve had a colleague having fits trying to optimize database access to an application that he inherited from a guy who inherited from a guy who…you get the point. I’d suggested speed isssues in indexes to him previously but he told me that several DBAs had looked at it and believe it to be working appropriately. Ok. Well I looked at it and was surprised to find that indexes were not only incorrect they were non-existant other than the primary key index and foreign key contraints.   At that point I recalled something from my subscription to the Sql Server Central newletter in an article(Sql Server Central Speed Part 3) which put a nice explanation in to using indexes out there.      I forwarded it to my friend and his problems melted away after months of headaches and no answers believing his problems not to be database related.

Understand the difference between a DBA and a Database Developer.

Software developers need to understand when looking for help there is a difference between a DBA and a database developer.   Yes a person could be both but typically people come down wearing one hat and developers mistake a DBA for someone who actually knows something about tuning a SQL database.     They might be able to make the actual SQL software pur and perform better but they might not know a thing about appropriate indexing for speeds.   Although they can tell you hey this index is eating up a lot of space or causing a lot more rewrites and therefore hurting my server they can’t actually speed things up.

Point being that just because a person with database in their titles within your organization tells you it’s right doesn’t mean as a developer you just have to say “ok it’s right”.    Having database in a title doesn’t make you an expert on all things database just like people with developer in their title might not know a thing about developing other than drag, drop and deploy..    My suggestion to all software developers is subscribe to a great website like SQL Server Central and read over their newsletter articles because that one 10 minute read you did 6 months ago might save you from months of pain in the future.

Speeding Up SQL Server Part 1
Speeding Up SQL Server Part 2
Speeding Up SQL Server Part 3

In the last year there’s been quite a bit to do with Silverlight, MVC and JQuery.   I’ve been fortunate enough to be exposed to all three in my day job where as many might not get to touch any of them outside of personal exploration.   As we’ve progressed through our learning experience in using these three either alone or in combination it’s become my opinion that the only caseswhere Silverlight LOB is better falls in to the following situations:

  1. You want a thinner thick application that also works over the Internet.    Silverlight LOB is sort of like the Taurus Judge of the computer world.  The Taurus judge is a pistol that also shoots shotgun rounds.   It’s not as good as both but it serves the purpose of both decent enough.  
  2. You want a web based application that can operate in a partially disconnected environment.    As if Microsoft was reading my mind they magically gave a presentation at Tech-Ed concerning disconnected Silverlight and posted a sample up on Codeplex.   So they definitely see the value there as well.

Noticed I said these are the situations where Silverlight LOB is better.    It’s not necessarily that the MVC + JQuery stuff is better in other situations but it’s certainly falling more in lines with standards.    It also doesn’t force users to install a plugin on their browser like Silverlight does.     However with HTML 5 emerging and JQuery constantly improving you can produce some excellent MVC + JQuery applications that perform much like the Silverlight LOB applications do.   

All this being said I must say that our Silverlight tools we’ve produced have been very successful as have our MVC + JQuery tools.   Everything is service based so a new client for either application is always a quick possibility.    I think careful consideration over which approach better suites the long term objectives of the client combined with their IT infrastructure will guide development teams towards the appropriate choice.   Remember to consider things like the following:

  • Can they install a plugin?   Some IT Network Infrastructure teams won’t budge on this.
  • Does the application need to be installed like a desktop app?
  • Must it run on IPad?   Silverlight can’t at this time.
  • Must it be available offline?
  • Will we be able to find someone to maintain this?   At this moment it’s hard to find people who’ve used Silverlight in my hiring market.

One big plus to working with the Silverlight LOB application is on a personal note I was able to quickly create a Windows Phone 7 application called Pocket Brewer.   So it prepared me for going in to Microsoft’s mobile market.