Thursday, July 29, 2010

Your Code Sucks

       A very good friend of mine is in the midst of an avalanche of work. He has a lot of open contracts, and has been abandoned by a fellow developer that was helping him with his workload. So, with three huge clients breathing down his neck he has been working non stop for weeks now. 

       One client contacted him about the iPad application he is building for them, he let him know "I paid another developer to look at your code, he says it really sucks." 

   When he told me this story, I had to chuckle a bit, and think of all the times I had decided that other people's code sucked. When I first started out, and I looked at code that definitely sucked hard, I scrapped it, and started from scratch in a way I knew was way better. As I matured I looked back and realized that what I had destroyed was a well accepted design pattern, and what I created was a mess of a mess pattern.

Lesson learned. 

      After some growth I encountered code that I thought sucked ever so often. At this point I wasn't decimating things all together, I would find specific parts of code that I found intolorable and rewrite it. About 9 times out of 10, when I got more than halfway there I'd run into an issue that made me say "Ooooh, that's why they did it that way" and revert it or use the same "sucky" logic with my syntax. 

     Now that I am a little more seasoned, I can tell you with all confidence that I never look at a solution that someone else created and say "Oh, this code sucks." I know that there really is no quick way to tell if code is good or bad without understanding the entire solution. Sure, sometimes things can look sloppy, or poorly done, or undocumented (in my case, not self documenting), however, you never know what was going through the head of the developer that wrote it. More often than not there is a reason why they have done things this way, and there is no hard and fast way to tell what the context is without being elbow deep in it. 

    So, when I hear that someone has looked at someone else's code base and determined that it sucked I smile and remember what it was like to be so new and sure of myself. So sure that I was an amazing developer, and that I knew what was best in every problematic situation. I miss that swagger, but I appreciate what I have learned, and that is the only person's code that sucks is my own, and the reason why it sucks is I just haven't learned how to make it better yet.



Monday, July 26, 2010

Throw 'Em Up For HTML 5

If you've talked to me about web development for more than 5 minutes you've heard my rant about how "JavaScript is the future." I have an ongoing love affair with JS, it's been around since nearly the beginning of the web, it died a little when we came to know abstractions like Flash and, more recently, Silverlight. However, one thing we've all come to realize is that the cost of those platforms. There is overhead, the need for browser add-ons, the difficulty it gives search engines with indexing content. As a developer, a purely web developer, I can't reconcile asking my users to deal with this flaws. 

Enter: Javascript. When it comes to floating elements, and snazzy page manipulation JS is the answer. Our savior from the downloads, our bail-out from intros and restaurant music (sorry, but there is something to be said about Flash being nearly synonymous with the classical music playing and browser hogging restaurant websites that we've all seen too much of). I, personally, spend a large portion of my time elbow deep in JS and JQuery. That being said, JS can't produce the embedded video issues that....

...HTML 5 CAN! Check it. Not only can you implement the video that flash can, you can much better integrate it into your markup. If you have the passion that I do for the DOM, you can really appreciate the purity that HTML 5 offers you.  

  Why bring this up now? This is semi-old hat for all of us, and a battle we've been fighting for a while. I bring it up for a few reasons, I intend to invest some time in learning some HTML 5 myself (I did it with Flash, and I can't preach the 5 without being able to do some of it myself.) Also, I came in contact with this awesome site tonight. So, I had to contribute, and give my respects to the future of web development. Throw 'em up:


Snapshot
 



Wednesday, July 14, 2010

Girl Develop IT!

In the past few months I've been working with some amazing people about something I'm very passionate about.

Over the past few months I have been working with a rock star team: myself, Tony Bacigalupo and Ana Hevesi of New Work City, and Vanessa Hurst of Developers for Good. We all feel that there is a big need for low cost programming costs for women. We think it is important to create a place where ladies would be comfortable learning concepts, and tools, and mainly "how to code." As I have said before, I think the first step in closing this gender gap is to get women shipping software. So leaving them with something tangible was a priority as well. 

We are all proud to announce, along with our sponsor Girls in Tech: Girl, Develop IT!



Monday, April 19, 2010

Party with a Purpose - MongoDB WAN Party

 Tonight we had a very different WAN Party. I have been wanting to learn about document databases for a long time. I tweeted about it the other day and someone mentioned that we should do it together on the WAN party. I thought that was a great idea, so tonight we went about implementing it. I used some screensharing software to show everyone my desktop, then all together we went about removing Linq-to-SQL and adding MongoDB to http://bundl.it. It didn’t take us too long, and we all got to learn together. It was really great, and I hope we can do this more often.



 


Anyway, I thought it would be a good idea to share what we learned here. MongoDB seems pretty awesome from the little I’ve used it (basically just tonight). You are able to map your objects and store them in really simple ways.  


We used these blog posts as references for our education session: Jason Alexander'sFredrik Kalseth's



So, the first thing you do is download the executable for Mongo here.


I then opened Mongod.exe to get the server running on my machine, and then mongo.exe to look at and play with our data. What I did next was find a driver so I could access my data from my application (http://bundl.it is written in ASP.NET and C# MVC 3.5 Framework). Someone suggested Norm, it’s a project by Rob Conery and it seemed like it would be up for the task. We downloaded the repo, opened the project, and built it in Release mode. We then went over to the bundl.it solution and included the Norm.dll.


Ok, so, next step was replacing Linq-to-SQL in the bundl.it solution. I gutted all my data access methods, the idea was to get the application back up and working again using MongoDB. The next step was mapping out some classes. There was much dismay at my “BundleManager” class, also my throwing two objects in one class file, however this was for the sake of time and will be fixed before I deploy.


The ease of setting up my objects to Save and Request from MongoDB was suprising. Norm provides a connector class “MongoQueryProvider” within which you pass the name of your datastore as a string. The cool thing is if you haven’t created that particular store yet it will create it for you.


Step next was making sure my objects saved. The syntax on that was “mongoQueryProvider.DB.GetCollection<T>().Insert(object)” or “mongoQueryProvider.DB.GetCollection<T>().Save(object)” (this also does an Update).  Retrieving them was just as easy: “mongoQueryProvider.DB.GetCollection<T>().FindOne(new Object {Property = property})”


 


One thing I loved was the ability to find a list of child objects by passing in the parent using “mongoQueryProvider.DB.GetCollection<Child>().Find(new Child() {Parent = new Parent() {ParentProperty = parentProperty}})” I didn’t have to map out these relationships in a painful ORM manner.


 


I don’t have enough experience with MongoDB to accurately cover the bonuses and pitfalls. However, the little I have worked with so far I really have enjoyed.


 


I’m going to make a “tldr;” how-to below to make life easy:


 


Step 1: Download the mongo executables and unzip.


 


Step 2: Run the mongod.exe from your command line


 


Step 3: Run the mongo.exe from your command line


 


Step 4: Download NoRm 


 


Step 5: Build the NoRm project and Release


 


Step 6: Include the NoRm dll in your project


 


Step 7: Create a MongoQueryProvider


 MongoQueryProvider


Step 8: Add new object


 Add New


Step 9: Update existing object


 Update existing


Step 10: Retrieve object



Retrieve object 


Bonus step: Retrieve children via parent.


 Load child


 


I plan to do the same “learn together” format for the next WAN. I have an idea of what we will learn, but if you have any desire one way or another let me know.


 


 


 


 


 


 


 


 


 



Sunday, April 11, 2010

What the Frig is up with the WAN party?




So, lately the WAN parties have been few and far between. Originally we were going every Wednesday and then we were at once a week, but random days, however the past two months have been spotty and non-existent. Frankly, I've been pretty busy, and I've found it hard to dedicate one night every week for the WAN Parties. I've been looking for someone who could host them when I'm not around (I still am if your interested), however, none have come forward. 


I'm a little torn, because I enjoy them so much, however my responsibilities are many. I'm involved in some pretty cool stuff right now that I will be sharing soon (Some folks already know about, such as theMVC Melee). I'm going to try to have them as often as possible, and you can find out when via twitter. If you do not follow me, shoot me a line and I will make sure to let you know when one is scheduled. 



Thanks to everyone who has been frequenting them. I really enjoy the opinions I hear and the things I have been learning from the group. I look forward to many WAN parties to come.  



Sunday, March 21, 2010

Mix 2010


So, I was lucky enough to go to Mix this week and it was awesome. Vegas was beautiful, the casinos were great, and I got to hear some really cool talks. I was surprised, I expected things to be very designer focused but it wasn't. You have to think, though, how many Windows designers do you know? I don't know any. I think design degrees come with a Mac Book and some granola.  



Douglas Crawford of JSON fame made a special appearance. It was cool to see him speak and even cooler to be sitting in on the same sessions as he was. He had some interesting stuff to say about aging out browsers and Java Script the good/bad. 


There were some cool dynamic language talks, a great "ask the experts" dinner, and many other Java Script sessions I really enjoyed. They have all the videos online and I recommend the following:



Six Things Every JQuery Developer Should Know - Elijah Manor\


How JQuery Makes Hard Things Simple - John Resig



The Tale of Java Script, I mean ECMAScript - Douglas Crawford


The Mono Project - Miguel DeIcaza


Reactive Extentions for Java Script - Eric Meijer


ASP.NET Security - Hanselman and Haack



Check those out and there are dozens more I didn't see that I hope to check out. I leave you with this picture of me and some Microsoft/Mono folk at the awesome attendee party at LAX in the Luxor. 


Happy Developing!





Sunday, March 7, 2010

Introducing the MVC Melee!!!



Hi, how are you? Been well? Awesome. I wanted to tell you about something I think is pretty cool, and that's the MVC Melee. The ever so clever/kick ass JP Toto and I thought it would be cool to put together a competition for y'all to do neat stuff with ASP.NET MVC. 


The basics are that contestants get together in teams of 1-4 folk (I suppose one person isn't really a team, is it?) and get 48 hours to build the coolest web app they can think of in ASP.NET MVC. The applications submitted are then voted on by the community and then winners are crowned in a few different categories. 


I'm hella excited about this and a bit jealous I can't participate. JP and I will be starting soon with building the supporting framework that will make the contest possible. 


Check out the site, tell your friends, and be excited. We will be hosting teams at New Work City and other co-working spaces around the country are welcome to join in. We plan on plowing through the weekend, so bring a sleeping back (if you plan on sleeping). 


Review of my MVP trip coming soon. See you at Mix!