Terminator Salvation
Posted on July 17, 2008I just saw a preview of the new Terminator movie due out next summer, holy crapper Batman, Christian Bale is John Connor, how bomb ass is that! Trailer here, they don't show much which is good.
I just saw a preview of the new Terminator movie due out next summer, holy crapper Batman, Christian Bale is John Connor, how bomb ass is that! Trailer here, they don't show much which is good.
OK. So I had no clue when I posted previously about the C# var keyword that the use of var is a religious war that's going on right now. I'm not sure where I stand right now, I'd have to say, "it depends".
I wouldn't use it in my current work, it would confuse other devs not up on the var usage and would unnecessarily complicate things at this time.
I'm also not sure due to the fact that people far smarter than me are on both sides of the fence, so right now is a good time to sit back and REALLY think before introducing var into my everyday code.
This is an 11 minute(or so) long screencast demonstrating how to pull down the latest bits from the castle folks and get a monorail project up and running. It goes through configuration and creating a simple controller/view using the build from 7/11/2008 off of the castle build servers.
Here's the code used for the solution. I've included the bin directory from the castle download, so the project is just over 5 megs.
I've been seeing a lot of people posting code examples that have the C# var keyword sprinkled liberally through their code. It's a handy little feature that helps you with LINQ queries, anonymous types, etc. For example, you can create a new type on the fly like this:
1var person = new { Name = "Chris" }; 2Console.WriteLine(person.Name);
Not everyone reads from left to right, but I do, as does every single person who works with me and every single blog and code example I've ever seen. This is important when considering the liberal use of var because now one would have read a whole line of code and figure out the type for themselves, rather than just reading the first word on the line(if declaring a local variable).
Look at the following snippet:
1var bus = FacilityConfig.Children["bus"]; 2if (bus == null) 3 throw new InvalidOperationException("bus is a mandatory element");
What type is bus in the previous example? You would have to hope that you're in visual studio and can hover over it with the mouse pointer so you could see the type which is lame.
The var keyword should be used sparingly, only when the type is unknown, like in a linq query that returns an anonymous type. Using it in situations where you know what the type is makes your code hard to read.
This is nothing major, and actually producing the screencast was harder than normal. It's silent so you don't have to hear my awesome voice. Check it out here: View It!
So, I'm not seeing any good ways of returning a script block that can be executed on the client side. What i was doing was having a block of javascript validation code below my block of html form elements. I couldn't get this working, it may just not be possible, I'll try again later. However, you can put all of the javascript you need into the onclick event of a button. So trying that, I now have this, which isn't pretty, but my intentions are that the form would be autogenerated anyway, so I don't think I'll care about how pretty it is.
1<form> 2 <table> 3 <tr> 4 <td> 5 <label> 6 First Name:</label> 7 </td> 8 <td> 9 <input type="text" id="FirstName" /> 10 </td> 11 </tr> 12 <tr> 13 <td> </td> 14 <td> 15 <input type="button" value="Save" onclick=" 16 if($('FirstName').value.length == 0){ 17 alert('First Name is required!'); 18 $('FirstName').activate(); 19 return false; 20 }; 21 " /> 22 </td> 23 </tr> 24 </table> 25</form>
My forms need to be simple. Can you tell I'm talking this one out? I have some really good ideas, and some mediocre solutions so far.
The area of a form to concentrate on is just the middle contents of a page. The type of target application is a business application, so there will be a lot of standard things we can do, think Microsoft CRM sort of(and I'm really sick of that flavor of blue we stole from the CRM follks).
The look and feel needs to be super easy to swap out, not just the stylesheets, but the layout as well. Not sure if this is a pipe dream, but I think it's doable.
How do you build forms? We are tasked with building a toolkit that's pretty framework agnostic, meaning it should work in asp.net webforms, asp.net mvc, castle monorail, or any other framework. It needs to only be tied to html, meaning all it does is generate the html for a form that has nothing to do with any framework.
Whatever "it" is, needs to generate forms, in an intelligent way, not just CRUD forms that have no life. By intelligent, I mean they need to fit the destination application in look, feel and behavior, and they are not generic in any way shape or form, other than that they have to fit most of the cases for the destination application.
How fast can you build forms? And by speed I mean, what's the least amount of code you can write to get no less than 100% of the desired form functionality. This includes any field validation, etc.
My response to Hussain's post on Technical Interviews.(read it first and come back here).
I never liked that "...can you fit your hand..." question. It's abstract-ish but has an answer.
I've seen some ridiculous microsoft questions(eg, "What would you do if you were to meet the Prince of Darkness?"), but they are intended to get you to show your creativity and thought process, there is no actual answer.
An interview for a technical position ideally would be conducted by the people that the individual fulfilling the position would have to interact. The interview questions slash activities are driven by the job description and the candidate themselves.
There are different facets of an interview(assuming anyone actually cares about who they are hiring). Sure you wanna know if they are professional and passionate about technology, that makes sense. How do you find out if someone is professional? You'll find out during the interview, do they trash past employers or employees? Note: Trashing previous employers and/or employees is perfectly acceptable, just not in the interview :) Are you passionate about technology? Too easy to answer yes to, so interviewers have to plan some questions that cause candidates to give up examples of how they are passionate. But is that all? Nope.
Let's say you're hiring a software developer with at least 3 years experience developing websites using ASP.NET, C#, and Sql Server(or any other database for that matter). A laptop would be required for the interview, something I'd bring for the candidate(or a desktop, whatever is easiest). And since I'm into the virtual image kick, I'd have one created already for the candidate, complete with visual studio 200x and Sql Server 200x, and firefox set as the default browser;i'd actually hide all of the ie shortcuts too :)
I would have some requirements typed up, preferrably written by a business analyst or someone who's not a software developer. And I would make some of the requirements vague(so they have to ask questions in order to complete the task). I'd hand the requirements over to the candidate with the instructions, "fulfill the requirements, no visual designers are allowed in either of visual studio or sql management studio".(details like connection strings would be included). At that point the interviewers would sit back and watch the show.
Watch what? Well did they clarify the requirements, remember, they're written too vague to be able to actually complete correctly, so questions are expected.
How do they type? I'm convinced that if you're clumsy on the keyboard, or if you're poking around visual studio menus for the "Build" menuitem, you lied on your resume about having ANY experience with visual studio. I would expect that for someone who types, and is not used to the provided equipment, would type fast and make a lot of fat finger mistakes, which is fine.
The database part would interest me the most. How many people put "Sql Server Expert" on their resume, and can't issue a CREATE TABLE command in a query window(and yes, it has to actually create a table)? OK. Don't know the command? that's no problem, but i wanna see how or if the candidate can find the answer. This also downgrades their status of "Sql Server Expert" to "i've connected my .NET app to MS Sql Server and that's about it".
The task would be simple enough to complete within say an hour, actually maybe even 30 minutes. I'd love to see if they're smart and pick up some tool of their choice(Subsonic, LLBLGEN trial version, their own CodeSmith templates, whatever) to help them complete the task on time; or is most of the time spent writing sql. The data access code would drill their knowledge of System.Data as well. Did they write something like "select * from blah where somefield = '" + somevar + "'"? or did they write "select * from blah where somefield=@somefield"(note the use of the parameter). Lack of parameter use is a pet peeve of mine.
Lack of a designer is good too. If you're really passionate about what you do, you'll know, maybe not prefer, but you'll know how to type html into the text editor.
What your favorite unit testing framework? How many computers do you have at home and what are they? What OS? What hardware? Who's blogs do you subscribe to? What was the last project your were proud of? What made you proud of it? Do you own an IPhone? MP3 player? Any other geeky gadgets? What would you do if you met the Prince of Darkness? Have you ever been to the Rio? What's your favorite beer? Which is better, Blade or Roadhouse? (It's a trick question, they are both awesome). Who's better, Killswitch Engage or Motley Crue? (again, another trick question; and yes I am going to the Cruefest next month) How many times have you watched Old School? How bout Office Space?
For those who know me, you might be thinking, but all of those questions reflect things specific to me, they're not general questions, but they're things that _I_ look for, and that, my friends, is the point. Questions like that have to, at some point, come from those the candidate would be working with as part of the interview process. Can the candidate get along with the people already working there? Candidates interviewed by recruiters or anyone else they won't be working with are ultimately going to suck.
I could only think of one off the top of my head: Can you draw a UML diagram? If you can, sweet, teach me the next time I'm finding it difficult to fall asleep, I don't how to do that, and I don't plan on learning. UML == BORING.
Yay! The ColorZilla plugin was recently updated to work with the latest release of Firefox, good for color picking.