Wednesday, November 5, 2008

Three Great Reasons Why Even Lonely Developers Need Source Control

Sometimes, when you're a lone developer on a project you skip some of the important facets of developing as a group. Like iteration planning, bug tracking, and source control. Well, I'm here to tell you that having source control is the most important part of your application (that's not written by you, that is). Here are three great reasons why you should never develop without it, in desc order of importance.



    You sporadically do really stupid crap.


    Let me illustrate with a story. One time I was getting ready to go out with my girlfriends., this was a few years ago . I had just gotten out of the shower, so I was wearing a towel. I was simultaneously on the phone and putting the stuff I needed on the floor in front of my mirror, for instance my makeup, and a hairbrush, threw my curling iron on, and lay out my clothes. I chatted some more with my girlfriend and sat down to start prettying up. Well, I guess we all can see where this is going, I sat on the curling iron. It's a salon curling iron, so it gets up to 400 degrees. For the rest of my life I will be literally branded by this colossal momentary lapse in judgment. Now, if you asked me a year beforehand “Sara, do you think you should do something to take precaution for sitting on hot styling tools?” I would be like, “Why, that's the craziest thing I've ever heard.” Well, guess what, you've done something just as stupid (get off your high horse, you SO have) and though you're thinking “Why, I would never trip over a rabid squirrel and toss my laptop in the sewer” it just COULD happen. Then where would you be? Source control is important because you never know what can happen and you always want to have a backup.





 



    As programmers, sometimes our brain writes checks our fingers can't cash.


    “Why, I think I should which from Castle to LINQ this weekend.” “C# looks cool, let's switch from Java this week” “Wouldn't it be great if we created a new utility project and condensed all our object methods into one big class arraigned by related data by page this afternoon?”





 


My father is one of my four favorite men on the planet, however, one of his hobbies is starting projects around the house. His hobby often doesn't include finishing protects around the house. He's really done some beautiful work on their home, however, my mom has had to explain to guest swhy we had a half of a deck, no bathroom tile, and, when he decided to get aluminum siding, a black tar-paper house. I'm sure she would have loved it if my father had checked in early and often so she could just roll back his changes after a few months.



     


    Listen, sometimes doing something new can be fun, and great ideas occur to us all the time. When we get to implementing things we can make a bigger mess then we intended. When we ensure we can bring back “the last time things worked” before we started gutting things. Or, we could just decide we liked our earlier solution and revert back to it. Either way it's a good call.


     


    You obviously care about your development as a talented programmer. I mean, you're active online you pay attention to the blogs, you keep up your skills. Wont it be nice a year from now to look back and see just how far you've come? I mean, I know we tend to run into those things in our code ever so often, but usually we fix them as soon as we can. It's always great to reflect, and chuckle a bit at prior naiveté. The other day I was going through my stuff and looking at the LONGEST if statement since the beginning of time I think, and I realized, I didn't need any of it. That one line took care of the whole thing. Seeing my application like it is now will probably make me smile down the road.





 


There are a ton of other reasons to use source control as a lone developer, but those are the top three in my book. Though you may not take the time to set things up it's invaluable. It took me two days to set up svn for the first time (I also had to set it up on the mac's of the designers as well because I had hoped they would use it for cataloging designs, these hopes were quickly dashed). It was an investment, but worth it and in the end I learned a new skill. I could do it again now in much less time.




 


So, take care of it, because I don't want to hear you whine when you DO get attacked by that rabid squirrel, because it will be too late.



Sunday, October 26, 2008

Dev and Dev, maybe some more Dev...



Haven't been around for a few days, been kind of  in hibernation getting some things done. Got the first few pages out and tested and about to have a few more. After Nov 1st and before Dec 1st my goals are the following:


-Implement the payment gateway (between the pages and the security)


-Get the forums up and going, I think I'm going to be using  Community Server.


-Complete user logic


-Url Rewriting


-Ad rotation


-S3 Image upload from the browser (fileserver to S3) ... having trouble finding .NET support for this


-Choosing a production server, I'm leaning towards Rackspace?


I guess the point is it wont be a lot of development. Which is a bummer but it means I will be done by then (hurrah!!)


For those of us NOT at PDC, some MVP's and ASPInsiders are putting together a group #NotatPDC. For information on giving a talk or how to partcipate here is the email associated.


I DID catch up on a lot of TV over the weekend. SNL was pretty good last night, however, there was a lot of Mad Men references. I'm a little paranoid now that I've been warned that Mad Men is due to jump the shark soon because of it's publicity. The Mad Men finale was good, as you can imagine I love me some Peggy, but come on, she deserves better than that, no. (look ma, no spoiler!) Dexter is becoming less relatable. I feel like he is letting his guard down in an unrealistic manner.


Does anyone watch the show Life? There were two great shows that NBC came out with last year. One was Journey Man and the other was Life. Journey Man was awesome, and it was SUCH a bummer it got canned (why do I feel like I've talked about this before) but Life is still on Friday nights. It's a cop drama, but it has a better underlying plot then most, I feel. The lead character was wrongfully imprisoned for years and then given his job back as a cop after he got out. He spends his life finding Zen for himself and trying to find "the real killers." I really admire people like this in real life who go through something terrible and are determined to face life with passion and not feel sorry for themselves, like this guy.


Oh, and of course every self-respecting nerd has to like Fringe. There is a Mulder shaped hole in my heart and I'm trying to let Fringe fill it. It's hard, but I'm sure it's like riding a bike.



How To: Use Dynamic Images in the ASP.NET SiteMapPath control









ASP.NET offers all kinds of controls for all of your development needs. I'm convinced that in 5 years there will be one control <asp:YourWebsite runat=”server”/> However, until that part there is still use for us programmers. Recently, I had use to use a new one and I thought I'd share my experience.



So, the SiteMapPath control is very convenient when you are adding breadcrumbs to your web application. However, if you want to make your breadcrumbs a little more dynamic then they are packaged, you will need to do it pro grammatically, I will share my process below. 


Ok, so step one: Creating your site map. Your control needs a datasource , and you have to add that in the form of an asp SiteMap. It's basically an xml page the guts of which look a little like this:


<siteMapNode url="Default,aspx" title="Home" >


<siteMapNode url="DoSomeJunk.aspx" title="Here's Where Users Do Junk" >


<siteMapNode url="AboutUs.aspx" title="About Us" />


</siteMapNode>




 


The outer node is the parent for the others, and that is how you indicate it in the site map. Ok, now creating your SiteMapPath control, your default datasource will be the web.sitemap, if you want it to point to a different site map you can set the SiteMapProvider property.




 


Your default SiteMapPath ends up coming out like this:




 




 


<asp:SiteMapPath ID="siteMapPath" runat="server">


</asp:SiteMapPath>




 


Now, you can leave it like that and it will look like this when you are on the About Us page:




 


Home > About Us




 


However, some of us like adding some snazz to our apps. My designer gave me breadcrumbs that look like kind of like this:


  HOME LOCAL SEARCH




 


Now, the SiteMapPath allows you to add images inbetween your links by populating the SMP (SiteMapPath)'s “PathSeparatorTemplate” property. There are a few templates in the SMP, the others are “CurrentSeperatorTemplate” which is the node that represents the page you are on, the “ParentSeperatorTemplate” which is the parent node (obv), and the “RootSeperatorTemplate (you get the drift). You can put an image in the PathSeperatorTemplate, or some words, a picture of your kids... whatever you want, and it will go between each one of your nodes like so:







However, since I had different pictures inbetween each of my nodes I needed to dynamically load the images in runtime after testing which nodes were displayed and where. Upon learning that the SMP had a ItemDataBound event I was able to load I t like a repeater (a control I use a little more often.) There are two ways to do this, I used an if statement,but it got a little long... It looks like this:




 


 


protected void siteMapPath_ItemDataBound(object sender, SiteMapNodeItemEventArgs e)


{


 


      var node = e.Item.SiteMapNode;


      if (e.Item.ItemType == SiteMapNodeItemType.PathSeperator)|


     {



          if (node.Url == "/Default.aspx")


         {


               ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/blue-dot-small.gif";


         }


        if (node.Url == "/Classifieds.aspx")


        {


          ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/green-dot-small.gif";


        }


 


        if (node.Url == "/ViewCalendar.aspx")


        {


             ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/grey-dot-small.gif";


       }


}


}




 


So I graduated to naming my images after my pages and did this:




 


protected void siteMapPath_ItemDataBound(object sender, SiteMapNodeItemEventArgs e)


{


      var node = e.Item.SiteMapNode;


      if (e.Item.ItemType == SiteMapNodeItemType.PathSeperator)


      {


           ((Image) e.Item.FindControl("imgNode")).ImageUrl = "~/Images/" + node.Title + “_Breadcrumb.gif”;


     }


}


 


 


Skip Navigation Links


And that, I decided, was the best way, for now. So that's how you add dynamic images to your asp.net SiteMapPath control! Thanks for reading, and as usual:


 




Tuesday, October 21, 2008

An Anthem



I have an iPhone, I like the band Cake, I drink octane drinks, the whole world spins and I'm hunched over a 17" screen for 12 hours straight.


I'm a Developer.


I like math, I have a wall sized white board, I crack my knuckles, I don't do suits


I'm a Developer.


I'm the internet's engine, I am a Data Architect, I will break it without buying, I worship source control


I am a Developer 


I think I like Fringe, I might buy a Hybrid, I pirate music, I love War Games


I'm a Developer


My dishes have mold, I hope I fed my cat, My hair is greasy, I may sleep at work


I'm a Developer a week before release.

 



Wednesday, October 15, 2008

Reflection - Iteration 8 of 9

razor slide 


WHOOOOOOOOOOOOOOO!!!!!


Honestly, I kid. I know I've been doing a lot of complaining lately ... and in my defense I have been pretty stressed. This is a huge responsibility, and I take it very seriously. I'm enamored by the idea behind the site. I'm in love with the design. I seriously can't wait to forward the link around to everyone and get their reaction. I have been given many resources and freedoms as far as the development process, and that means so much to me. All in all I can't wait to step back and say "F-yeah, I did that." That being said, and I'm sure that many of you have been at this point in your development careers.



As I've discussed I'm a n00b. I started out with a SQL focus about 6 years ago. Dabbled a bit in VB. I have been doing ASP.NET/C# for about 2.5 years now. So, developing an application of this magnitude has been a rocky, rocky road. I've had a lot of support, but even now during crunch time, I'm exhausted. In a good way? I imagine this is how you feel when giving birth (if even one guy emails me that giving birth "is not that hard" I'm flipping the heck out. Men always say this and should never EVER no matter what your wife tells  you.) I imagine this is like that part where it is most painful and almost over. I have one page left to develop. It's a doozy. I have some loose ends to tie up on 3 others. November 1st is my Alpha deadline. Then December 1st for Beta.



Tonight I am getting a decent night's sleep. I left earlier than usual. However, lately not so much. Again, I'm not complaining! This will all be worth it in the end, such an accomplishment for myself. I'm so excited.



Any words of support or advice from people who have been here are much appreciated. Any words of "HOLY CRAP YOU STILL HAVE A WHOLE PAGE" will be greated with sobs.



What am I struggling with? Well, how to load my images and store them related to certain records (using LINQ for objects thus far). Allowing users to upload video. I'm using s3, but I have to build an interface (along with consultant) for uploads. I have found a consultant to do the import from File Maker Pro who is versed in SQL Server 2005 and FMP which is hard to find, however, I worry about how he will do and his speed. I'm worried that I wont get the last page done in time. I worry that I'll never end this post and get some sleep...lol... so, if you want to know what I will be dreaming of you got it.



Anyway, good night, all.


Sara




 



Sunday, October 12, 2008

Philly .NET Code(nerd) Camp


So, this Saturday I went to my first Code Camp. It was cool to know there were that many nerds(myself included) in the area (kind of my area). I could have done without all the Phillies gear (go Dodgers! or Rays! or Boston!). I learned a whole bunch. My personal favorite talk was about REST programming with Sam Gentile. I thought his talk was entertaining and informative. Great learn.


Two cool things happened, I was approached by a Microsoft Evangelist about their budding woman developer program. She explained that they are researching the desire for one.Apparently there are two schools of thought

"I'm a woman developer, therefore I am unique" and "I'm a woman developer, don't single me out." I guess we all know what school I am in,lol. I am quite proud of being a female developer. Not because it has been "hard" or I've been "discriminated against." Because I honestly believe being a female in this industry has been more of an advantage than a handicap. I just think it's different. I think there are things that are unique about us and I'd love to discuss it. Also, I'd love to learn what environment other women grew up in. That way we can learn how to make more of us!


I was also approached by a woman who wants to start a women's user group in NJ which is hardcore. It's funny because I have many male developer friends, and I love them, but there are some things I can't talk to them about. Even just last week after I had pulled an all nighter working I found myself wishing I had a woman to talk to about it. You know? It's just different. It's not sexist, I don't believe that sexism is recognizing the difference in the sexes. I think that the differences and overcoming some of them, is what makes today's woman awesome.


Anyway, all in all, good experience. Will write a longer review this week. I feel guilty because I got NO work done today and I had intended on doing a bunch.



Wednesday, October 1, 2008

New Article Published

Feel free to comment here as it takes a while to get feedback from the site. :)



Clicky Clicky