Saturday, July 17, 2010

How to Find and Land a .NET Development Job

My developer job resource kit is now available. It's called "Shove It, FizzBuzz: How to find and land a .NET development job."



What's included in this kit?

The kit includes a 200+ page eBook (PDF) that teaches you how to get the job you want (and will make you a better developer in the process). It contains tips on improving your overall developer marketability, 110+ technical questions (with answers), plus general interview questions, puzzle questions, and more.

The kit also includes software that simulates an actual interview and can help boost your confidence during the real thing. You could also just use the software to keep yourself on top of the latest technologies.

Last, but not least, the kit includes a customizable resume (in Word format) that has proven to be effective at getting people jobs.

http://shoveitfizzbuzz.com



Friday, May 14, 2010

Repeating and aligning elements using jQuery and CSS

Today I had a need to create a dynamic list of checkboxes, and I wanted them all aligned properly, so the results would look something like this:

image

The layout was simple with CSS, then I added some jQuery to simulate getting the checkbox items dynamically.

Example:


That example produces a list that adjusts appropriately when resized:

image image

Monday, April 26, 2010

ASP.NET Chart Controls Without Web Forms


I started tinkering with the ASP.NET chart controls last week for a project at work, and the samples available from Microsoft are excellent, except they're mostly all using web forms. So I took it upon myself to do a few things:
  • Upgraded the existing samples from .NET 3.5 to .NET 4.0.

  • Added a sample project 'ChartsWithoutWebForms' to show one way to utilize the ASP.NET charts without using web forms at all.

  • Added a sample project 'ChartsWithMVC' to show one way to utilize the ASP.NET charts with the ASP.NET MVC framework.
The basic idea behind the two additional projects is that the chart is rendered as an image, which means you lose some interactive functionality, but my examples show that you can still fake some interactivity.

I also have an example that shows how you might create a dynamic charting system, which is actually what I'm working on now, but the work is venturing into an area where it will be specific to my employer, so I want to release the samples before that happens.

Feel free to take these updated samples and use them as you see fit. Hopefully they will help you out.

You can download the samples here:
http://www.downcastsystems.com/files/ChartSamples.zip

Tuesday, November 4, 2008

C# 4.0 dynamic Intellisense : a letter to the C# designers

I just emailed this to Eric Lippert:

I want to express my concern with the new dynamic language features in C# 4.0.

I think it is important to enable duck-typing along with this feature; possibly by enabling a "fake" cast to an interface. My proposal is below.

 
public class Person
{
public string Name { get; set; }
}

public class Fruit
{
public string Name { get; set; }
}

public interface INamed
{
string Name { get; set; }
}

public static class Program
{
public static void Main()
{
// these types may be defined in any language; possibly from Ruby, etc.
// the cast to INamed is "fake"; used only to enable intellisense since actual member resolution is dynamic
dynamic p = new Person() { Name = "John" } as INamed;
dynamic f = new Fruit() { Name = "Apple" } as INamed;

// would get intellisense after "." provided by the INamed interface
Console.WriteLine(p.Name);
Console.WriteLine(f.Name);
}
}

Monday, September 29, 2008

Balsamiq makes mocking up fun!

Robert sent me a link last week to a new mockup tool called Balsamiq.  At first, I didn't really see the point, but after using it for only a few minutes, I was totally sold.

What is it?

Have you ever tried to use Visio to mockup UI?  It's a cumbersome process, and no matter what I do, the end result just always looks like a bunch of circles and squares and nothing like what I actually envisioned.

Balsamiq has some ready-made controls that you can easily drop onto your canvas.  They look hand drawn, which is absolutely wonderful because then when I show people my mockups, there will be no doubt that they're simply looking at a mockup and not the final version.

image

Why is it useful?

I was just playing around with Balsamiq for a few minutes and made a quick screen showing a new feature we want to implement.  I showed it to Robert, and we found out instantly that I was going about it the wrong way.  Imagine if I'd mocked that up in HTML, or in Photoshop?  It would have taken me a lot longer, and it would have been harder to modify after my initial mistake.  Since I used Balsamiq, i was able to just move the controls around.  So it saved me a lot of time and aggravation.

Another Example

We have to implement a way for color blind users to use our web application, so we've been asked to add "Color Schemes" to the User Settings.  The user can have an underline or a box around particular fields on the form.  The box background color or underline color is affected by changing color schemes.

At first, I thought, the simplest thing to do would be to simply provide a drop-down list of named color schemes with a preview below, so I mocked it up, and it looked like shit.  Then I remembered the way Digsby and now the new Windows Live Messenger 9 Beta showed some of the custom UI settings, so I tried to emulate it a bit.  (The horizontal rule control in Balsamiq isn't colorable yet, but the author says he's added to his upcoming feature list.)

image 

Also, I just want to note that I've emailed the author twice, and he responded back within a few minutes each time.  That's impressive.

Check it out:

http://www.balsamiq.com

Friday, May 2, 2008

Unnecessary Iffage

A friend of mine showed me an example of the kind of bad code he finds every day where he works:

image

There are a lot of things wrong with the example above.  Le'ts pick it apart and simplify.

1. This line is unnecessary:
image 

You could just use SomeBooleanFunction in place of someBooleanValue in the example above, like so:

image

2. " = True" is unnecessary.
The function already returns a boolean value.  Get rid of it:

image

3. anotherBooleanValue is also unnecessary. We could do away with it and return the value immediately from the If statement, like so:
image
 
4. In fact, almost all of it is unnecessary:
image
 

How does this happen?

Why didn't the programmer just use the existing SomeBooleanFunction() instead of creating a new method that does the exact same thing?  I bet I know.

I suspect the original programmer didn't know that SomeBooleanFunction() existed until after he'd already duplicated the same logic in MyBooleanFunction().  Once he found out that SomeBooleanFunction() was there, he wanted to use it, but didn't want to change all the code that was already using his new MyBooleanFunction().

A simple find/replace could have solved his problem, but he may have been afraid to change too much. That's not a good excuse, I know. I'm just sayin'.

Tuesday, April 29, 2008

Programming Books Usually Suck

Jeff Atwood over at Coding Horror is always going on about how programmers don't read programming books because most of them suck, and I agree with that.  I personally have only read about three really good ones.

In Jeff's post, he mentioned (as an example of poor writing) a book called Perl for Dummies. I followed through to the linked review, and it was great. So I wanted to point out a few of the best (of the worst) examples, as I think programmers who are writing should take notice of these kinds of things.

When there are simple and difficult explanations, you can usually count on Hoffman to find the difficult explanation, and then to tell you how difficult is. For example: (page 93)

int can be a bit tricky because it rounds down for positive numbers and rounds up for negative numbers.

He's right; that is tricky. Wait, which was does it round again? Up, down, positive, negative, I can't remember. But if he had said

int is very simple: It throws away the fractional part of a number, leaving the integer part.

then it is a lot easier and you understand the name so that next week you might remember what it does.  Another example of this: In the ill-advised explanation of xor, he says

The operator returns true if the two things have different truth values but returns false if they have the same truth value. (See table 8-2.)

Here's the simple version:

$soup xor $salad is true if either $soup or $salad is true, but not both.

Then you dispense with the table.

Part of the reason Robert and I do Develocity is because we are always finding terrible sample code out in the wilds of the Internet, and it's teaching programmers the wrong ways to do things. It's scary to think people are filling books with the same sort of nonsense.

I'm not a programming expert, and I make my share of mistakes too, but before I post sample code that other people are going to look at and possibly use, I will go through it a few times, seeing if it can be made simpler and easier to understand.

Most examples have too much noise.  A "Hello, World" example should do nothing but print "Hello, World" to the screen. Don't add any for loops or random number generators to it.