“Zone of Pain vs. Zone of Uselessness” or code analysis with NDepend
As for me, there are only two kinds of projects – hobbyist’s nifty tools and systems (scale may wary). The main difference between those is the easiness of making changes and refactoring. Other words, how many other developers I should persuade to do it just because “In the final analysis, it’s their war” – JFK. But what can be the good reason for such fast talk? – “You code sucks or at least it ought to”.

“Every generation needs a new revolution” – Thomas Jefferson
So, in order to win such revolution for “systems” you absolutely need static analysis tools like NDepend. Those tools are not intended for being your advocates, but those intended to help you to understand all risks and approximate the amount of work should be done to fulfill another revolution.
Unfortunately, you cannot use such tools for fair measuring of code quality because of Computer Science rules of thumb. How to decide whether “methods is too big” or “method is too complex”? However you can (and should) use it for dependencies risk detection. For example, in following illustration you can clear understand that any change inside BetterPlace.Core or BetterPlace.Model assemblies (and namespaces) can be painful.
Now the only question is who is responsible of modules, using it and how long will it take to convince them to make a revolution.
From here you can start using CQL (Code Query Language) which is SQL like language invented by Patrick, the author of NDepend, for querying code elements and sections. By using it, you can define what “method is too big” means in terms of your project.
SELECT METHODS WHERE NbLinesOfCode > 300 ORDER BY NbLinesOfCode DESC
Or see where you should replace method overloads by default arguments, introduced in .NET 4.0
SELECT METHODS WHERE NbOverloads > 1 ORDER BY NbOverloads DESC
Then, when you marked all places and human targets for revolution, you can start it. After you done, you can even compare builds and measure the amount of work and quality of results achieved.
To finalize, I just touched the tip of what good static analysis tool can be used for. So get it, learn it and use it not only when you need to make a revolutions, but also during your application design and build process to be aware about how the new monster created will looks like.
Download NDepend >>
Proper disclosure: Apr 15, Patrick, the author of NDepend, asked me to review his tool and offer one license for evaluation. I told him, that do not need to evaluate it because I’m using it for a while (also I had the license of my own) and I’ll be happy to write a review once I’ll have a bit time for it. Now it happened. Thank you, Patrick, for such good work!
July 27th, 2009 · Comments (1)
How to pass technical interview in Better Place
If you following me on Twitter, you probably know that we’re looking for developers. However those who was in interview here become a little bit shocked. It is not very standard interview for software houses. So how does it works?
Step zero – requirements and open positions
Even before somebody send us his/her resume there are requirements and open positions. Those requirements are very straight forward: “We need a developer for servers” or “we need somebody to build UI” or “we need GIS guy” etc. All open positions (at least for Israel) you can always find in our local website. Those days we have two open positions for our team: super-fantastic developer and chronic headache reliever.

Now a bit about candidates. I had some developers hired during my career and it always worked following way: there are only 10 kinds of developers – developers and not. It never worked for me to hire somebody just because I have to hire somebody. Also it did not worked to hire mythological “average” or “rather good” developer. So for me the segmentation here is very binary- can write code or can not.
Step one – CV
Somebody told me that the only chance to hire good developer via CV is if the developer is student. However, and in spite of this the very first station is HR department, they get a ton of CVs each day and filter it out by using strange and mysterious heuristics. In most of cases it works like in bad search engine – by using keywords. So my very basic requirement from our HR team, please do not filter it this way because I’m working like SEO filter with those CVs by lowering rating of “multi-threaded Design Patterns”, “.NET 1,1.1,1.2,1.3,2.1.2.2.3.4.3.4.5.6.5.4.3 and dot.Net Remounting for Agile Ajax(tm) Web Services”, “deep knowledge and application of MFC, GUI, WinForms, C++, C#, HASP, SQL, ADO, OOP, ODP, IRC, TCP, HDTV, AX, DX, COM, VC++, API” and “Windows 3.11, 95, ME, 98, 98 SE, 2000, NT 3, NT 4.2, 2001, XP, XP SP1, SP2, SP3, 2008, 2010, Vista SP3 and DOS”.
Also candidate which “management responsibility for the 26 software engineers (6 teams) located at India (Bangalore). Resources allocation for $1M budget and restructuring planning based on defined priorities” probably won’t be developer, but want to be finance controller, because we was able to make 26 developers (even in India) to work for $38K a year including materials, living, facilities, etc.
So a small tip for your CV, please write what you did (yes, it is not shame if you never heard about OOP/ODP, but knows how and when it should be virtual and when abstract).This way you’ll not waste your and your future employer time.
Step two – Phone call
If CV is readable and clear for me, I’m calling the person. Usually it takes under 5 minutes to invite him/her or not for frontal interview. However sometimes it can take even half an hour. I am not asking the same questions, this because it is impossible to ask the same somebody who write smart client applications and those from web planet. I almost never ask a candidate to repeat what he/she just told. The only exception is when I am not understand the answer. However when the candidate asks relevant questions it is big plus for him.
The general set of questions contains of three main sections: what exactly you did (even if it clear from CV), what are you looking for and whether you want to work in Better Place.
The phone call ends by taking one of four direction: invite for frontal interview (jump to step 3.1), invite for technical exam (jump to step 3.2), send home work to prepare (non-blocking wait for a year or two) or “we’ll be in touch” by transferring the candidate with mark “negative” to HR (end of the process). They know how to tell them.
Step three point one – Frontal interview
Frontal interview is usually takes between an hour and an hour and a half. It contains of general CS questions like those. Also question to understand whether the candidate is developer or “code-monkey” – one who does not know what the difference between scalar and vector or how to convert float to int faster then using “corporate frameworks developed by other team”. The thumb rule is simple – if each question takes more then 10 seconds to answer the candidate does not really knows the topic. In spite of this, I allow about a minute for each answer.
Next section is related to specific domain of the candidate. It might be architectural overview of one of his/her solutions, all he/she knows about inheritance (why, how, multiple, virtual, public, etc). Constructors/destructors/templates/generics/allocations/virtual inheritance is a next part. What is “new” and why we need it. How to cleanup remindings and how it works in real life (even if you thought that it should be done automagically). Special bonus for those who knows what interrupts and registers are and how it really works under the hood.
If the candidate good enough we keep going toward data structures. This includes linear/random access, hash, trees (with different colors), search vs seek vs lookup with yield return bonus. What is special about “string”. Lazy invocation vs evaluation, alloc/malloc (if relevant), lifetime.
If the candidate is especially good we can start speaking the target language (sometimes it’s assembler and sometimes is C# or even Python [I can speak some
]).
Step three point two – Technical exam
Sometimes, when it is not very clear whether the candidate is programmer, I’m asking for write a small program from scratch without using standard libraries. For less developer position I’m asking to find a number of bugs in real code (which includes required bugs
). Code is different for different levels of programmers. Also in most cases a candidate can use any computer language he/she wants.
To prepare such exam we need to work very hard. First of all (and before it comes to candidates) we’re sending it to all developers in similar positions and asking them to do it. Then we are measuring time and multiply it by 2. Also we’re writing down all question, asked by developers and trying to fix description to answer all commons.
Candidate got new clean machine, empty silent room with air conditioner and can use any information sources he/she wants in order to do the exam. It can be internet, friends, books, etc. However it is not so simple as it looks. Each candidate has final time to write the program. It takes longer to find the “similar” solution and adopt, rather then do it yourself.
We are require three hours to finish current exam (it took about an hour to finish it for me, and hour and a half in average for the company). If the candidate finished it before the time he/she got a bonus point. If he/she wrote “almost the same code” – failed, “almost finished” or “almost works” – failed, “has not enough time” – failed, two significant bugs – failed, “the question was not clear” – failed, “did not know who to ask” – failed, etc.
It’s amazing how hard for some code-monkeys not to use standard libraries. Sometimes it is too hard for bad programmers to understand that not all computer languages has arrays and collections, sometimes, it’s too hard to realize that if you not really understand what inheritance is you have to write the same procedure more then once.
But not only the exam determinates the future of the candidate. Sometimes (in very rare cases) we’re wrong with this test and do not filter out bad programmer. It is very hard to lay out him later, but because of such person you will not finish project at time, or will do it overbudget. Thus we prefer not to hire, then to fire. This why we have additional step.
Step three point three – Another interview
It is very important to emphasize that we have about 0.05% of those who where at stage three point one. This interview can take upto full day. You should come ready for this. Plan and watch each of your steps. Also you should be ready to speak with number of people near flip charts, whiteboards, calculators, computers and other hardware things. Also you should be ready to assert your opinion.
Most of people you’ll speak with will be very smart (this is not restricted to your direct manager or future colleague only). Sometimes you’ll speak with two or three people at simultaneously. Each person will have his own very special opinion. Also the questions may wary from base calculations to mechanical and electronic schematics or references of your vehicle.
You can take timeout, however take into account that people speaking with your sacrificing their time and projects, so you should consider it.
Step four – final
If you passed all three previous steps – you can consider yourself as our future employee. There were only once, when we had not hire developer because of financial/welfare issue. This because of our stances of good developers. If you did not hire them – you and all company will loose, not the developer. Each of those will find his/her place very soon. Even if the good developer has no CV at all or he/she is a student or foreign resident. Because the only chance for this company to produce good results is to have good human resources.
Send me your CV or contact me tamir [AT] khason.biz to tell that you are the one I’m looking for >>
Please do not send me your CV if it passes the regex of the first step – just send a message with list of what you did for last 7 years.
July 23rd, 2009 · Comments (10)
Windows 7 – dry run or how things should be done to correct old mistakes
I have not write for a while (if you’re following me on Twitter, you know why). Even so, today it will not be very informative post. This all about my expression about latest builds of Windows 7 and one job proposal. Have a fun.
January 13rd, I expressed rather bad opinion about Windows 7 (beta those days). Today, after most of post-RC builds (currently with 7260) on work machine I would way with big confidence – Microsoft learned from beta errors and now it works almost like it should work for RTM.
Installation
Installation takes less and less from build to build (this is 7th I’m checking). With 7260 it took about 15 minutes. All hardware devices (including Intel AMT, PM45 and LM5) were found and installed correctly. Shortly after the installation it installed a bunch of security and device driver updates. Looks like Microsoft has no issues with Intel anymore (or they just decided to build drivers by itself).
Hybrid graphic cards still not supported. Also it not seemed that it will be supported toward RTW. However Windows 7 correctly decided to use discrete card, rather then on-board once BIOS settings were set to prioritize it.
Taskbar
It still sucks, but you will accustom to it. From the beginning it looks like it takes all valuable space on your desktop, but shortly after you’ll see that it somehow comfortable to use it (it is really depends how you working. Lately I changed a bit a way I’m doing things [this why you cannot see me in Live Messenger anymore], thus it become rather good for me). Here how it looks for me now
Yes, it is Chome on this bar and this why:
‘Coz Internet Explorer become worse and worse
The only good thing I found about IE8 shipped with W7 is it has support for Windows 7 taskbar. However even this fact cannot defense against its suckness. It slow, buggy, has not enough functionality and absolutely annoying. I love Firefox, but it has too much functionality for me those days. Once I used to open it, I loss at least a half of hour for twittering, reading rss, etc. With Google Chrome is it not an issue, because this is nimble program with only one functionality – browse internet pages.
My last BSoD
Since the last time, I had no BSoDs. Also WDM not eating 999.9 CPU hours anymore (like it did in idle Vista). Also I had no compatibility issues. Everything worked as expected on my machine. The only issue I had is IE, that decided not to die and stuck as running windowless process. You know how it is when any icon on taskbar stops to do anything, just becoming red when you click on it.
Conclusion
Do it. Upgrade your OS as soon as possible and have a fun.
We’re hiring! (Israel residents only)
Lead Software Development Engineer in Test
We are looking for strong Software Development Engineer in Test who is passionate about UI and internal API usage to test rich client applications. Responsibilities would include developing test strategies, writing unit tests, UI automation, custom msbuild scripts, performing problem isolation and analysis, communicating with developers in support of debugging and investigation.
My group takes both individuals and teams success seriously, and looking for the right person to join our team, which is development, rather than test team. What my group is doing?
The AutOS group is responsible for delivering of the system you’ll have inside your next electric vehicle, one of the most important applications we have at Better Place for providing a consistent, transparent and fluent experience for a driver every day. Currently the application is used for energy management, navigation, infotainment, road safety and many other aspects of enhancing your future driving. Come explore the exciting opportunities on AutOS team developing cutting edge tools, facing all customers for all Better Place EVs. Become a member of the outstanding team that strives for engineering excellence in improving the life of all of us. AutOS team is using latest technologies and innovations to make sure delivery of the best possible experience for a driver.
Qualification
Solid programming ability in managed programming using the .NET Framework (C#) with some experience in WPF or Silverlight.
Solid technical knowledge in Information Technology field, including hardware capabilities and performance evaluation and tests.
Strong problem solving and troubleshooting skills.
Knowledge of Team Foundation Server and MSBUILD scripting.
2+ years experience in software testing, including designing and developing automation infrastructure.
Strong test aptitude.
Good communication skills and ability to work closely in a development team environment.
BA/BS or MS degree in Computer Science or equivalent field experience is required.
You think, that you want such job? Send me your CV, couple of word about yourself and why you want and able to work with me at Better Place to tamir@khason.biz with “Lead SDET application” in subject. (if you do get get an answer from me within a week, your mail is in spam, so you should resent it by using contact form here)
Have a nice day and be good people.
June 17th, 2009 · Comments (9)
Book review: C# 2008 and 2005 Threaded Programming
A couple of weeks ago, Packt publishing asked me to review Gastón C. Hillar book “C# 2008 and 2005 Threaded Programming: Beginner’s Guide”. They sent me a copy of this book and today, I’m ready to write a review for it. But before I’ll start reviewing it, I want to apologize to the publisher and author for the impartial review.
First of all, you should understand, that this book is about how it possible (for this book author) to write four programs (with awful user interface) using different classes from System.Threading namespace to perform tasks, rather then what is multithreaded programming and how to achieve best performance by utilizing multiple CPU power. Your own programs will not run faster after reading this book, but you’ll probably know (if you did not know before) how to use BackgroundWorker, Thread, ThreadPool, AutoResetEvent and WaitHandle classes. Also, there is a small chapter about thread context switching for UI thread delegates invocation and parallel extensions.
There are some technical misconceptions and errors in this book. But it is not the major problem of it. The problem is that while reading this book I question myself whom this book aimed at? Language style is somewhere between blog chatting (better then mine) and MSDN style documentation. I admit I don’t know quite how to categorize this, the author writes in a style that is just bizarre (even more bizarre then mine in this blog
) Overall, it sounds like I’m reading a conversation between two beginner-level programmers trying to explain one each other why they are using certain coding convention in C#.
Another half of this 395 pages book is just copy-paste stuff from Visual Studio (including it default tabulations and indentations). Here one of representative examples of such copy/paste
// Disable the Start button
butStart.Enabled = false;
// Enable the Start button
butStart.Enabled = true;…
// Some very useful property, which used as private member for another public property
private int priVeryUserfulProperty;
public int VeryUserfulProperty
{
get
{
return priVeryUserfulProperty;
}
set
{
priVeryUserfulProperty = value;
}
}
Verdict: Not very exemplary introduction to some classes inside System.Threading namespace for fellow students who like to read blogs, rather then books and documentation and do not want to understand how it works under the hoods, but write something and forget it.
3- of 5 on my scale. This book is not all bad, though, but apparently suitable for very specific audience, which definitely excludes me.
March 20th, 2009 · Comments (9)
Some new in-mix downloads
There are some very cool downloads suddenly appear on MSDN download site due to all new technologies, presented at Mix ‘09. So let’s start
- Silverlight 3 SDK beta 1
- If you do not want to install full SDK, you can install only runtime for Windows or Mac. Then, you can read documentation online. You do not need it, if you’re going to install
- Silverlight 3 tools beta 1 for VS2008 SP1. After you have all this, go to the official Silverlight web site and start working.
- If you re “in” .NET RIA Services, you can download March ‘09 preview of it also to use with new Silverlight. It also makes sense to read about what is it in Brad’s blog.
- Also new Silverlight toolkit was released with SL3 support and a bunch of new up/down controls, LayoutTransformer, Accordion and TransitioningContentControl.
- Microsoft Expression Blend 3 Preview. It includes SL3 and WPF3.5 SP1 support, but excludes SketchFlow by now.
To learn more about Silverlight 3.0 and Blend 3.0, you can see first day keynotes at mix 09, Rollup of what’s new in Silverlight 3 by Joe Stegman. This includes offline mode support by Mike Harsh. I’ll write another separate post for this topic, due to the fact, that I’m a desktop guy, so wary about the future of WPF.
To learn more about how to use new Expression Blend, it worth to see this session by Pete Blois. Another good sessions are also wrapped for you by Scott Hanselman.
After we done with all web stuff, let’s speak about a client
- Microsoft MultiPoint SDK. Do you want to use multitouch in your application? This SDK provides you with ability to use up to 250 individual mouse devices simultaneously. And yes, it works with Windows XP SP2 too
- Internet Explorer 8 for Windows XP x32, XP x64, Vista x32, Vista x64
- In case, that you do no have Windows Vista or Windows Server 2008, you can download 30-day evaluation virtual hard disk of Windows Vista or Windows Server 2008 Enterprise and see how it works
. - Also a small present for my old friends (from my military consulting era) – WPF and Silverlight APIs for GIS engine of ESRI. Have a fun!
That’s all by now, going to write a review for new book and will publish it soon (probably even before, you’ll finish with all those downloads and readings). So, stay tuned and be good people.
March 20th, 2009 · Comments (2)
WPF Line-Of-Business labs and Silverlight vs. Flash
Small update today (mostly interesting links)… During my last “Smart Client” session I was asked about WPF LOB application development labs. So, there are two full labs, I noticed about:
Both labs include WPF ribbon and DataGrid, Southridge also come with M-VV-M design sample and some other interesting features. As for me, it seemed, like some parts of those labs can be easily used “as-is” for production level applications, like it was done with SCE starter, which turned into TimesReader (by the way, it has free version again).
For those, who still trying to consider what to use for their next killer app, I propose to read following article from Jordan, which compares between Silverlight and Flash. And then see composite application guidance to use Prism for Silverlight development. Here the video of it usage by Adam Kinney from Channel 9
Have a nice day and be good people
February 18th, 2009 · Comments (6)
Finally I can reveal stuff I working for last half year!
A couple of days ago WordFocus exposed one of our (frankly old
) WPF prototypes for in-car energy assistant system, so today I can exclusively show you some of screens from this state of art WPF work. Real time performance of WPF touch screen application, running on low power automotive grade PC, which boots faster, then Nokia phone. Huge respect for all developers and P-defs.



Full video report by WorldFocus.org
February 16th, 2009 · Comments (8)
Slides and desks from Smart Client Development session
Great thank to everybody attended yesterday at “Smart Client development” session. As promises, please see slides and desks from this session
February 12th, 2009 · Comments (1)
Bootstrapper for .NET framework version detector
You wrote your .NET program, that can be used as stand alone portable application (such as it should be for Smart Client Apps), however you have to be sure, that necessary prerequisites (such as .NET framework) are installed on client’s machine. What to do? How to detect .NET framework version installed on target machine before running .NET application. The answer is – to use unmanaged C++ bootstrapper, that invoke your application if correct version of framework is installed.
Until now there are 15 possible .NET frameworks can be installed on client’s machine. Here the table of possible and official supported versions, as appears in Q318785
| .NET version | Actual version |
| 3.5 SP1 | 3.5.30729.1 |
| 3.5 | 3.5.21022.8 |
| 3.0 SP2 | 3.0.4506.2152 |
| 3.0 SP1 | 3.0.4506.648 |
| 3.0 | 3.0.4506.30 |
| 2.0 SP2 | 2.0.50727.3053 |
| 2.0 SP1 | 2.0.50727.1433 |
| 2.0 | 2.0.50727.42 |
| 1.1 SP1 | 1.1.4322.2032 |
| 1.1 SP1 (in 32 bit version of Windows 2003) | 1.1.4322.2300 |
| 1.1 | 1.1.4322.573 |
| 1.0 SP3 | 1.0.3705.6018 |
| 1.0 SP2 | 1.0.3705.288 |
| 1.0 SP1 | 1.0.3705.209 |
| 1.0 | 1.0.3705.0 |
All of those versions are detectible by queering specific registry keys. However, in some cases, you need to load mscoree.dll and call “GETCOREVERSION” API to determine whether specific version of .NET is installed. You can read more about it in MSDN.
So it’s really simple to write small C++ application (or PowerShell applet), that queries registry and invoke your managed application. How to do this? You can either read about it in outstanding blog of Aaron Stebner, who is Project Manager in XNA platform deployment team or attend my session next week to learn do it yourself. We’ll speak about nifty ways to do it also.
Anyway, by now, you can use small stand alone program, I wrote a while ago, that will tell you all versions of .NET frameworks installed in target machine without any prerequisites. It can be run even from shared network location
See you next week.
PS: Do not forget to download and install the new version of Visual Studio Snippet Designer, which is extremely useful tool by MVP Bill McCarthy, you’ll need it later next week…
Have a nice day and be good people.
February 4th, 2009 · Comments (8)
Brilliant, yet simple technical questions, can be used for work interview
Few days ago, a friend of mine, sent me set of demonstration questions for 11th grade computer science students from Russia. I throw eye on this exam and decided to use some of those questions to test candidates in my company for hardware engineer position (we’re looking for). If you’re good candidate for this position, you should be able to answer all those questions without even think a minute.

Following those questions:
Automatic system recoded informational message in Russian from Unicode (16-bit) into KOI-8 (8 bit). After recoding the length of the message decreased by 480 bits. What was the length of the original message in characters?
1) 30 2) 60 3) 120 4) 480
There are 119 participants in bicycle race. Special designed system registers cyclers passing waypoint by writing his serial number with minimum possible number of bits. What will be the size of temporary message, recorded by the system after 70 cyclers passed the waypoint?
1) 70 bits 2) 70 bytes 3) 490 bits 4) 119 bytes
а=D716, b=3318. What the value of c if a<c<b?
1) 11011001 2) 11011100 3) 11010111 4) 11011000
Please calculate 438+5616?
1) 1218 2) 1718 3) 6916 4) 10000012
What logical expression equals to: & !( !B | C ), while &: logical AND, !: logical NOT and |:logical OR
1) !A | !B | !C 2) A & !B & !C 3) A & B & !C 4) A & !B &C
F is a result of logical expression execution with arguments A, B and C
| A | B | C | F |
| 1 | 0 | 0 | 1 |
| 0 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
What is the expression for F?
1) !A & !B & !C 2) A & B & C 3) A | B | C 4) !A | !B | !C
For encoding characters A, B, C and D we decided to use two bits numbers sequence (from 00 to 11). What was the result of coding sequence BACD on base 16?
1) 4A 2) 411 3) BACD 4) 1023
Led table contains of number of leds. Each led can be in one of following states: “On”, “Off”, “Blinking”. What is the minimal number of leds should be on table in order to display 18 difference signals?
Please calculate 2514 + 11-4 – 2110?
To calculator there are only two commands 1: “add 3”, 2: “multiply by 4”. Please write down the sequence of the calculator command in order to convert number 3 to number 57 while using not more, then 6 commands. For example to convert 2 into 50 you should write following: “21211” (X4,+3,X4,+3,+3)
The speed of data transfer over network is 128000 bits/sec. Please calculate the time (in seconds) will take to transfer 625 kBytes in this network.
Write a simple program (by using your favorite programming language) to convert the array of 30 integers into array of modulus of items from input array without using modulus calculation special function.
Good luck!
For people, currently employed in my company (hardware devs) it took less, then10 minutes to solve all those questions. However, I was shocked, that at least half of new candidates, come to interview failed to solve it.
January 30th, 2009 · Comments (19)
Discover other tags
My tools
- .NET Framework Detector
- Duplicate images finder
- Exchange Security Policy for Windows Mobile Devices Fix
- Gas Price Windows Vista SideBar gadget
- Israel Traffic Information Windows Vista SideBar gadget
- Localization fix for SAP ES Explorer for Visual Studio
- LocTester
- RTL and LTR in Windows Live Writer
- Silverlight controls library
- Snipping tool integration plugin for WLW
- USB FM receiver library
- Vista Battery Saver
- WebCam control for WPF
- Windows Live SkyDrive attachment for Windows Live Writer
- Wireless Migrator
- WPF Virtual Keyboard





