Saturday, 29 November 2008 10:27 by
Hadi
Visual Studio comes with TODO markers where you can mark sections of code with little comments to indicate that you need to do something. However, TODO sometimes becomes too generic. You start to mark tasks, features, futures, (bugs have their own by default) with the same tag. Fortunately you can add custom ones. If you have Re-sharper installed, you get additional benefits since it allows you to create filters, identify the tags inside comments and highlight them on the right margin.
One tag to add is SMELL. A code smell is a piece of code that works yet it just isn't right, and you know that the longer it's left in there, there worse it can get. It can lead to an unsustainable situation where the whole project can start to smell like a dump site. Other times it's just a small section that is isolated and won't have immediate side-effects, but would be good to get it cleaned up.
Now, I know the purists would probably scream and say that any smell should be eradicated then and there. Snap back to reality. Both you and I know that that's not always viable. Having said that, If it's a bad smell that can lead down a spiral of stink, then yes, it should be, taking into account schedules, etc.. but even in that case, you're not going to do it all at once, so you still need to identify the smells as you go cleaning them up.
Here's some screen shots of smells with Resharper
To define them, use Resharper's To-Do item entry
You can also see on the To-Do Explorer
Thursday, 27 November 2008 19:42 by
Hadi
marc recently made a blog post regarding the world not revolving around Delphi, and in particular DelphiFeeds. My blog goes through a sophisticated Yahoo piping system to filter only Delphi related things, so that only posts that actually have words like Delphi, Borland, CodeGear, Embarcadero, etc.. come through the pipe (the reason for using Yahoo pipes was that I previously didn't have support for tags on my blog engine).
Reading marc's post, I recalled some comments the guys that run Delphifeeds made. They said they receive hate-mails if too many blogs posts are made that are off-topic.
Now here's the thing. First off, even if it wasn't exactly hate-mail, sending messages to someone that runs a feed site or posting comments on people's blog complaining that posts are off-topic shows plain arrogance. It's not your site, it's not your feeds and it's not your blog. Don't like it, well unsubscribe. Nobody owes you anything.
What's worse though is that many people don't seem to understand that Delphi is just a tool, it's an IDE and a language. Programming is a whole lot more than that. There are topics such as design, architecture, good practices, team work, and other frameworks (some could add value to your tool of choice, be it Delphi, Visual Studio, Ruby), etc. Just because there is no specific mention of Delphi in a post shouldn't automatically be considered off-topic or of no interest.
You subscribe to blogs that interest you because the content is interesting. You're not subscribing to an automated content-generation system. You're subscribing to a guy that's writing this content. Maybe that guy has something interesting to say that is not directly related to xxxxx (again, insert tool of choice here).
P.S.: This post should make it on Delphifeeds since I've mentioned the word Delphi a couple of times. If you are interested in other things, subscribe to my site directly. That way my posts aren't "censored".
Thursday, 20 November 2008 09:44 by
hadi
While I was at TechEd in Barcelona last week, I had a chance to sit down with Mark Dunn from .NET Rocks and talk a little bit about ASP.NET MVC and jQuery. They've recorded the interview. You can watch it here
Wednesday, 19 November 2008 08:31 by
Hadi
I've found that many of the things Jeff Atwood posts about, most of us think about. The difference is that some are so blatantly obvious that you would never even consider blogging about it. But each to his own.
However, there are some things that just blow my mind. His latest post about programmers are typists first is one of them. Let me first say that I'm a firm advocate of annihilating the mouse from a developer's toolbox. Ok, that might be a little extreme, but point being, you are more productive if you learn keyboard shortcuts and don't have to reach out so much for the mouse. However, I wouldn't say that developers are cats first, then programmers.
Initially one could understand Jeff's title as expressing that being a fast typist is important. If that were the statement, to a certain degree I would concur, and I say to a certain point because at least on my team, we don't measure productivity in terms of keys pressed per minute.
So Jeff comments:
We are typists first, and programmers second. It's very difficult for me to take another programmer seriously when I see them using the hunt and peck typing techniques. Like Steve, I've seen this far too often.
Well let's think about that for a moment. If you're not a professional typist or never taken courses, the only way to improve is through practice. As a developer, the more you write code, the more you practice your typing skills. People also tend to say that you really can't be a pen and pencil architect unless you've got your hands dirty with code, and that I do believe. So to a certain point, the previous statement makes sense, but I don't think it's black and white thing.
He continues to say:
Steve and I believe there is nothing more fundamental in programming than the ability to efficiently express yourself through typing. Note that I said "efficiently" not "perfectly". This is about reasonable competency at a core programming discipline.
What has the rate of keys per minute (KPM) got to do with efficient expressiveness of code?Efficiency can be an indication of how expressive or clear your code is, or how fast it executes where speed matters, not how fast you type it into a text file. I would say efficiency is more about coding if statements correctly or using LINQ where it makes sense.
This next comment blows my mind:
What I'm trying to say is this: speed matters. When you're a fast, efficient typist, you spend less time between thinking that thought and expressing it in code. Which means, if you're me at least, that you might actually get some of your ideas committed to screen before you completely lose your train of thought. Again.
I really don't have much to say about this other than it's utter nonsense. In fact he tries to justify it somewhat in the next paragraph:
Yes, you should think about what you're doing, obviously. Don't just type random gibberish as fast as you can on the screen, unless you're a Perl programmer. But all other things being equal -- and they never are -- the touch typist will have an advantage.
Advantage over what? Over thinking faster? Over beating the next guy on the team on expressing his thoughts?
I'm also a self-taught typist, and I've learnt through practice, spending years writing code. My wife is a great typist also. She didn't take courses either, she's worked with computers for many years. She suck at programming, but she's great at Office. Get the point? You become a good typist by practicing and using a computer. The more you use it, the better you become. You don't need to take a course on typing before learning how to program.
Tuesday, 18 November 2008 13:08 by
hadi
I was installing SQL Server 2008 today (x64 bit version) and after the initial checks it does, I got an error about MediaInfo.xml file missing. Looking in the folder where it had unpacked the files, effectively I couldn't find a reference to it. After a very hard session of extensive research, I found that others had run into similar issues. Some of the suggested solutions were to re-install .NET 3.5 SP1. Others said to re-install the complete .NET framework. One guy had re-installed his entire OS and still had issues.
Clearly not being the path I wanted to go down, I decided to try and install the 32 bit version to see if it was a problem with the 64 bit. This one seemed to go ahead with the install. Looking at the decompressed files, I saw that the missing files were there on the 32 bit. I then cancelled the install and ran the 64 bit one again. After decompressing the files, the missing files were also there. I thought maybe I had a bad run and let it continue. However once it did all the checks and I hit Continue, suddenly half of the files were deleted from the folder. So it seems that at some point the installer was deleting the files.
So instead of running the installer bootstrap, I decompressed the files and ran the setup manually. And it worked. So if you get a errors on missing files, decompress the package and run the setup.exe manually and it should work ok.
Tuesday, 18 November 2008 11:37 by
hadi
I'll be doing a talk in Belgium next month at the Visual Studio User Group, where I'll be covering topics such as Separation of Concerns, Single Responsibility, Interface Segregation, Dependency Injection and Inversion of Control, along with examples of IoC containers. There's limited space (90) and already 55 signed up, so if you're in or around the neighbourhood, got nothing better to do than here my brag, come along. I think they are organizing a geek dinner afterwards so it should be fun. Although the talk will be in C#, the important things to grasp are the concepts, not the language, be it Visual Basic, Delphi or whatever else (obviously it needs to be a OO language).
Monday, 17 November 2008 08:59 by
Hadi
Everyone knows that unless you're writing about Harry Potter, it's hard to get rich from a book, and even more so a technical one. I wrote the book on WCF mostly as an adventure, being my first in Spanish and sole author. I decided sometime ago that I wanted to give all proceeds from my cut to a charity. After getting in touch with a number of them requesting information (let's just say I don't trust 100% all charities), and never getting a reply back from any, I decided to look for something close by. I'd heard about Juanma from a friend of mine (Guillermo Som) and we've been actively helping (Málaga .NET User Group as well as all other user groups around Spain) by organizing events, raffling prizes, etc. Juanma has an illness called Leukodystrophy also known as Alexander's Syndrome and the family is trying to raise funds to further investigations to find a cure.
Therefore, all proceeds from the author's cut will be destined directly to this cause. Krasis Press, the publisher is aware of this already and everything will be handled directly by them. So if you speak Spanish and need a book on WCF, know that you're also contributing to a good cause by buying a copy. If you don't, but feel you still want to help Juanma, please visit their web site: www.ayudajuanma.es

Friday, 14 November 2008 13:55 by
Hadi
Here's my presentation from my TechEd talk on ASP.NET MVC. I'll be uploading the demos as soon as I get them cleaned up. Any questions, you know how to reach me.
Saturday, 8 November 2008 08:19 by
Hadi
Ok, I know I said I'll never do it, but I'm going to try it out.
Saturday, 8 November 2008 07:47 by
Hadi
If you're doing multiple demos that somehow involve CSS, make sure you rename the default Site.css file ASP.NET MVC creates for you. Otherwise, during a presso you'll go crazy trying to figure out why half of your demos aren't rendering correctly. In other words, make sure each demo has it's unique CSS filename so you don't run into browser cache "issues".