Thursday, September 18, 2008

Searching for wisdom... Dev diary 9/18

Five weeks left. Flipping? Who's flipping? Kidding, I mean I'm as calm as one can be in this situation. Anyone would be stressed with this much time left in their first big project. Controls are being completed, pages are coming together, consultants are doing their thing. Am I concerned about everything getting done? November 1st is the day we're scheduled to go alpha, I'm not saying when we're going into prod. Because I'm not even letting MYSELF think about it. As far as I'm concerned production is November 1st. Don't even think that I'm not going to be asking some of you to help me test, lol, because I will be.




 


Right now I'm wiring up some of the xhtml, I'm going to be just plowing through things (hopefully) the next few weeks. This post is going to be short, tonight a girlfriend and I are getting together and having a bottle of wine and I'm taking a night off. However, I have one question for all of you. I know that a lot of people that read my page have been here before, is there any kind of advice, or wisdom you can pass on to someone that's in this spot of the life cycle for their first time? I'd love to be prepared for a major hiccup, though I”m sure there will be others.




 




Good night all, here's to the four day work week! (seriously, ever since I heard that's what they do at 37 signals, my boss is now the oracle)



Tuesday, September 16, 2008

O'Reilly Web 2.0 Expo


Today was the O'Reilly Web 2.0 Expo at the Javits Center in Manhattan. Today was "Workshop Day" and that's what I thought looked the most applicable for me, I have a feeling the expo will be filled with things like this so I would be more productive at work. The conference was cool, there were SOME nerds which was awesome. I heart nerds that wear backwards baseball caps and dirty jeans and lean back in their chairs and don't care what you think, because if I was a guy that's how I would be. Plus I would skateboard. Not saying girls can't skateboard, because they totally can, but I digress. I met a few cool nerds, and think I made some friends.


There were also a bunch of people walking around loudly talking on their cell phones saying things like "Really? Did you check to make sure the blog was published? Ok, well then you should definitely twitter about it and post a bulletin. Ok, then check the adsense and call me back." BLECH. I'm SO on Web 5.0 at this point. My Space is SO the AOL of 2002 I'm deleting mine this week I'm almost embarrassed to be there. Twitter : Internet as DVR : Television, it just is. Developers need to come up with some anti-Web 2.0 terminology ASAP.


This morning I went to a talk about "Building Successful Next Generation Web 2.0 Applications," it basically reinforced in my mind that 'm doing the right thing. S3, REST, JSON, CSS, XHTML, AJAX, JQuery... the whole she-bang. It got me feeling pretty confident that I was keeping on top of things, however, I didn't learn much. This afternoon, however, was totally worth it. I went to a talk for Developers (which there were hardly any at all as seen here):




About Advanced Javascript given by this guy (PS, I just noticed, um he only MADE JQuery), is it weird that I decided his talk would be interesting because he had cool glasses? I think he may have skipped fourth period health to give this talk, I can say that because not 3 months ago my orthodontist asked me what grade I was in.... (it's like when you make racial jokes about your own race). Not only was the teaching tool he used awesome (See? You can edit and debug(kinda) and compile) but I learned a lot that I really want to play with. Javascript is like a mountain, once you conquer it you think it's awesome, but if it's in your way you abhor it. People that are good at JS freaking love it, and wouldn't live without it... but getting to that point is rough because of limited debugging resources and other languages that offer more functionality (because regardless of how fast the client is, the server has just so much more info) tend to be distracting.


So I learned about Javascript caching, which is cool. Basically what you have to do is declare a function's cache, like so:


Add.cache = {};


Then set it within a function like this:


                                                                                       

function Add(num){  

if(Add.cache[num] != null)

return Add.cache;

var ber;

ber = num + 1337;

Add.cache[num] = ber;

return ber;

}



then you can call the cache if the variable passed in is the same, through the cache.


assert(Add(3) == 1340, 'YAAAAY');



assert(Add.cache[3] == 1340, 'YerAwesome');



For small functions like this it means nothing... but when you're holding up processes with your insane JS calls this is super handy. I also learned about OO Javascript, and inheritance, and recursion (the only thing I was already aware of) and all sorts of fun things. I will do a more indepth post at a later date.


It never fails, though, at these talks there are always guys that ask questions just to ask them. Kind of like "stump the speaker" where they already know the answer but they are asking to see if HE knows the answer. This would be fine in moderation but when it happens over and over it's a bit annoying.


While I was in the shower the Mets decided to finish their nap, so the game is over. Now it's time for The Shield and 90210 (I don't even want to hear it that show is AWESOME). My card for Thursday this week starts my study on LINQ for filesystem. It looks hella useful and if it is I will make sure to tell you all about it.


ALSO, if anyone else is having trouble with their OpenId on StackOverflow (Technorati) please let me know, I can't log in, I'm experiencing analphylatic shock, I thought if there were a bunch of us we may be able to get the attention of the overseers.



Monday, September 15, 2008

Reflection - Iteration 5


     Did you know that developers don't ONLY develop at work? Well, apparently this is true, and the other stuff is tenfold when you are managing a project. That is the biggest thing I struggled with this iteration. It's hard for me to get in the face of consultants and make sure they are performing. I'm looking at them like a developer, and not like a manager. It's also hard to do all this stuff and still get my work done at the same time, however, I think I've come up with a system. I'm worth very little in the morning, I am 0% a morning person, so that's not a good time for me to be productive in development. However, that's a great time for me to get all the administrative stuff done... so starting this week that's what I'm doing.


    Things are taking me longer to do then I want them to. Part of this is because I'm green, another part is because I expect too much of myself and those expectations aren't realistic. I did get some cool stuff done this iteration, though. Like I published the first websiervice and did a bunch of AJAX-y crap. That was pretty sweet, I'm pretty proud of that.


    Web 2.0 conference tomorrow in NYC, let me know if you'll be there def taking advantage of the workshops. Also, if you have any experience with a DB product called Filemaker Pro I need a custom export written, or if you know any consultants that would be awesome.


   Here is a question I posted on Stack Overflow...would love to get some feedback here: 


I have two repeaters and an image inside an update panel along with some AJAX dropdowns with link buttons to the left. I want to update the data inside the update panel as fast as possible as values are selected from the dropdowns.


What do you think would be the best way to update the data? The repeaters are populated by objects, so if I could just filter the objects by some properties I could end up with the correct data. No new data from the server is needed.


Anyone have some ideas?



    Six weeks left until Alpha release. OMG. Thanks for all your support and feedback, my first "technical" post was daunting... and my initial reaction to the response was not too grown up (I got super defensive)... but over all it went well. For those who have been asking I feel much better, thanks. 


 EDIT: Also, looking for a good flash developer, looking for either a part time gig, or full time if in the NY metro area.


    Happy developing! 



Tuesday, September 9, 2008

NHibernate - When the Fun Begins


So, you've integrated NHibernate as your ORM, you've created your objects and your mapping files, sooo... what next? The exciting part, that's what. I mean, I KNEW what an ORM was, what I didn't know is that my SQL would be taken care of for me, all LINQ-style in my code. What I didn't know was how manipulatable my objects would be with the functionality that NHibernate provide


IQuery: This is the most flexible, and frankly the least exciting, NHibernate data manipulation interface. It allows you to just run an inline query and return either a list, or a single object. To return a list you would just


    IList listIDs = session.CreateSQLQuery("select id from Foo where name = '" + name +"'").ToList();


 For a single item you would use .UniqueResult() instead of .ToList(). Something I know is possible but haven't used yet is the CreateMultiQuery method, which allows the return of multiple query results for different criteria. You can also use CreateQuery in a more direct way with your objects by just instantiating your object then passing it into CreateQuery() and using .Add to add parameters to your query. This is more direct, but I have not used it because of this beauty:


   ICriteria:    Ok, so listen to this, you just pass in the TYPE of the object you are looking for along with some criteria and it puts together the whole query for you. Like if I'm only trying to find Foos when Foo.Name is something like Steve and sort it by ID then I do this (notice the use of implicit local variables, 3.5 rulez!):


var foo = new Foo();


var baz = session.CreateCriteria(foo.GetType())


.Add(Restrictions.Like("Name", "%Steve%"))


.AddOrder(Order.Desc("id"))


.List();




 


How awesome is that? Restrictions is a member of Nhibernate.ICriterion and provides you with a way to add equations, or search for values to limit your result set. I used the ”like” constraint since it is so familiar to we SQL cats, but there are many more. It's that easy. You can also do simple inserts and updates using a simple session.Save() transaction which is super handy.




 


Now, before you play with any of this fun stuff you need to remember to do the following




 


-Build your SessionFactory (this I do here not in my helper class, this is stolen code from somewhere on the intarnetz, if someone can find it I will credit.


-Check for an existing Nhibernate ISession (NOT ASP.NET Session)


-Open a Nhibernate ISession (if one does not already exist)


-Then load your objects like above.




 


The funnest (I know, and I don't care) thing I have done so far is refactor the above behavior into a helper class. I am going to give it to you below because I love it and think it is great. Tell your friends, and have fun with Nhibernate (possibly also have fun with all the time you save, maybe earn some CrackOverflow points).




 


 


public class NHibernateObjectHelper


{


public static ISession session;




 


public static T LoadDataObject<T>(int Id)


{


session = CheckForExistingSession();


var returnObject = session.Get<T>(Id);


return returnObject;


}




 


public static IList<T> LoadObjectListAll<T>()


{


session = CheckForExistingSession();


var criteria = session.CreateCriteria(typeof(T));


var results = criteria.List<T>();


return results.ToArray();


}




 


public static ISession OpenDataObjectSession()


{


session = NHibernateSessionFactory.OpenSession();


return session;


}




 


public static ISession CheckForExistingSession()


{


if(session == null)


session = OpenDataObjectSession();


return session;


}




 




 


public static void CloseSession()


{


session.Close();


}




 


public static void Save(BaseObject<int> businessObject)


{


session = CheckForExistingSession();


var transaction = session.BeginTransaction();


session.Save(businessObject);


transaction.Commit();


}




 


public static void Update(BaseObject<int> businessObject)


{


session = CheckForExistingSession();


var transaction = session.BeginTransaction();


session.Update(businessObject);


transaction.Commit();


}


 




 


}



Sunday, September 7, 2008

The Politics of a Developer


      I'm not here to tell you who to vote for, however if you're going to vote based on what some girl on the internet tells you you may as well listen to me. Why? Because I'm funny, that's why.


    It can be argued that there isn't much difference between the two parties. This is very true, and I myself don't affiliate myself with either. I do practice my right to vote. For all the things about our government that I disapprove of, the fact that we can vote to elect our officials is pretty cool. My grandmother's generation fought so that I can vote, therefore I take pride in the fact that I can do it.


  I mean, there really isn't a debate about which candidate is more computer savvy. Obama also supports tax breaks for companies that don't outsource. If you're voting as a developer it just isn't feasible to vote for a man who admits never being in front of a computer. However, some of you may be voting with your values, and that I can understand.


  The biggest thing that appeals to me about Obama has nothing to do with his qualifications to be president, though I think it contributes. The thing I adore is his unfailing idealism. I'll say it again unfailing idealism. Some may associate that with naiveté and inexperience, however, I maintain that it is part of the foundation of success. It's not the message of "change" that gets me. The word "Change" along with the phrase "Web 2.0" makes my ears bleed at this point. Its the idea that your dreams are possible, that hope isn't a weakness. Associating our emotions with manifesting our dreams and goals is a message I can stand behind. 


   This attitude is mistaken for weakness too often. I'm sure some of you are shaking your heads and rolling your eyes as I speak (or type). You probably think I am "young" and "just haven't learned what reality is yet"  I maintain that I have accomplished things uncharacteristic for my demographic. Why? Because I know I can.


   There are many discouraging things that come my way on a daily basis. I have failed, others have told me I will fail, and people tell me that I need to get a grip of what I am capable of. People have asked who I think I am, they don't like my attitude, they think I am loud and overly confident. I am tempted to feel sorry for myself, to make excuses on why something can't be attained. I can't afford to listen to any of these things. I can't for an instant take my eyes off my goals. Why? Because that's when I fail.


   There are a lot of mumbo jumbo books out there like "The Secret" that promote this type of thinking. The thing that they lose is it's not some "magical key to unlocking your future" and it's not some great revelation, it's been known for a long time. Thomas Jefferson said "Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude."


   Do I lose sight of this? Often. Not two months ago someone had to remind me to stop questioning myself. I'm knee deep in this project because of it (more like waist deep at this point). But, I digress, Politicians break hearts. This I know. However, the one thing I see in this candidate is the chance that someone may show the next generation something that has been lost in ours, that idealism and belief in ourselves and each other can move mountains.


   Ok, I'll get off my soap box in a hot second. However, I have to say something quick to say about Michelle. She isn't the pretty woman in the nice dress that is standing behind a great man, she's the pretty lady in the nice dress that is standing WITH a great man. When her husband speaks to her I hear something I haven't heard in a politician before, he talks to her like she's a man. By that I mean, that he addresses her as a true equal, and that's something I can admire.


   I guess this comes across as one big endorsement. On a level I suppose it is....I'm not trying to open a debate about platforms and earmarks and inexperience and whatever else is a hot button issue. I understand we all have our beliefs and I'm not challenging yours. I just can't help but admire his unwaivering belief in his own ability to affectively improve our country. That is something I would want exemplified for my (currently non-existing) children.




 



Wednesday, September 3, 2008

Reflection - Iteration 4


Hey folks, how are things? Things are awesome over here. Development is in full swing, a lot of things are done and in the woodworks. I'm really excited about this. I have found some great consultants to do work for us, I'm really looking forward to seeing what they can do. If they can't self document it's the gallows!


So, last week I had off, we got back yesterday. It was a good week off, relaxing, I got a lot done, both project related and not. Some of you may wonder why I didn't do my reflection yesterday like I normally would. Well, I have invented a new term for Agile Developers, it's really brilliant. It's going to revolutionize the industry I think, it's called "The Mulligan" Definition: when there is a day between two iterations that you just want to do some stuff and not account for it and not tell people why. I think you should get one Mulligan a year, or one Mulligan for ten iterations. Yesterday was my Mulligan. GET OVER IT. 


I'm pushing myself a little this iteration. I do well in chaos mode so I am going to try to apply that to my iterative cycle. We will see how that goes.


Unrelated notes: The new 90210 is AWESOME, (UPDATE(typo)): Nonoba.com is a great UX, and I have 71 points and 4 badges on CrackOverflow and none of you can take that away from me (well, unless you get 100 points yourself and are also hella mean)


Here are some pictures of my "web wall" as it goes, and my messy desk. "A messy desk means a warm heart" I always say.


web wall


messy desk



Monday, September 1, 2008

StackOverflow - The Answer to &quot;-site:ExpertsExchange&quot;?


So, the collaboration between Atwood and Spolsky titled StackOverflow has come to (beta) fruition. The buzz is finally starting to come in. I have seen both good and bad and decided to see for myself what the hype was about.  I'm going to walk you through my experience and give you some of my reactions.



The UI is welcoming, and I say that as a developer. Well, maybe not so much a developer as much as just someone who likes a "no frills" UI. I'm more of a reddit girl than a digg girl, I don't like extra bells and whistles and even special colors. Let me rephrase that, I like a high functioning skeleton without all the distracting "Look at me! Look at me!". In other words I like plain webpages. Why was that so hard to say?



So, naked UI, check. How does this thing work? I figured I would play around... so I did the obvious and asked a question. This is a problem I am really having with my Visual Studio. I think it has something to do with Installing and Uninstalling both Refactor Pro and Resharper. It comes and goes, but regardless it's an annoying problem and I figured I would check to see if anyone else had it. I was able to post a question without registering. I gave myself the moniker "Kevin Lee." I often hear that being a female I get my questions answered a little faster than the average nerd. Something about a "Geek to the Rescue" fantasy. I figured if I just pretended to be the average programmer I could see an unbiased response time. My question was answered quickly  (I notice you can't see exactly but it took about 20 mins) and the integral goal of StackOverflow was fulfilled. I was impressed, only because my first question about StackOverflow was "Well, I mean, don't we have forums for that?" However, it takes me a lot longer to get an answer on the ASP.NET forums. Was it answered correctly?  Yes, after a few. There were some answers that were a little off the path for my question, though I could see why a programmer would go to them, they didn't apply. The same experience as if I was in a forum, answered a little faster. So, I mark the answer as "accepted" and go to rate up the answer as well (may as well throw around some points). 



What's this?  Hmm,  apparently I can't rate answers up if I don't have at least 15 points. Well, that's clever, I need a rep in order to decide what question rates. What about if I want to vote an answer down? I need 100 points, so if I'm some kind of jerk who likes to go spreading bad web vibes I have to work REEEALY hard to get there. I guess that adds to the Wiki-ish flavor. A lot of the feedback I have read in the "sphere" points to the idea that everyone that answers questions isn't necessarily going to answer correctly. I found that the correct answers tended to be indicated and rated high, possibly this algorithm for voting is to thank for that.



Ok, now let me go answer some questions. Mmmm, I had a little trouble including multiple tags when searching questions, now I'm not going to jump on the "THIS IS A BUG" wagon, but if it isn't then the UI could be a little more explanatory. I entered the names of multiple tags I saw on the list, but when I entered C# and then .NET (with a space in between as instructed) nothing was returned. I was able to answer questions with ease... nothing too exciting (though the level of most of the questions being asked was impressive).



What are some of the other features I noticed? Well, you can earn badges based on performance. I was really excited to see that

I had earned the "Autobiographer" badge, but then I realized it was simply because I had filled out my profile. I sincerely hope I get a "Kiss Ass Blogger" badge for this post. Some other fun things were the ways you can filter questions by what is unanswered, or what is popular, and other nifty filters to make browsing more interesting.  I'm sure I will discover more in time.



What didn't I like? Well, the amount of information all at once was kind of daunting. I supposed this could be partially remedied by the use of multiple tags. I would also recommend giving users the option to not see a preview of each post and just view titles. There were many times I wanted to rate an answer or question and I can't yet which was frustrating. I suppose that's the price you pay to keep the community clean.



So, the question remains, is StackOverflow THE new resource for all your coding needs? Is it going to put Experts Exchange and other pay-for-your-answer sites out of business? My answer is: no one knows and don't pretend you do, blaggers, because you don't. If I were to design a perfect UX for a one-stop-shopping coding resource this is pretty dang close. However, it's really up to us as a community to put in the effort. It seems to have a huge following already in beta, so Joel and Jeff as developers may have hit on something big (is this possible for people not named Scott?). I'll be interested where this thing goes and what changes are made for the first official release (may I suggest a NY release party?).