Inappropriate use of local variables in the Enumerable.Where() extension method

Before holidays I was solving problem with filtering entities. Users were really unhappy. When they want to filter entities by date range application showed not corresponding results, so I dig into that problem and was unpleasantly surprised by the bug I’ve found. Developer wanted to save one line of code and reused one variable like this(keep your eyes on the date variable)

// incoming parameters from UI
// if user do not filter by dates or filter only one end of the collection there will be used empty string
string maybeStartDate = "2011-01-01";
string maybeEndDate = "2011-12-31";

// in real world it can be any data source derived from IEnumerable
IEnumerable<DateTime> dates = new DateTime[] {
                new DateTime(2003, 1, 1),
                new DateTime(2010, 6, 15),
                new DateTime(2011, 3, 12),
                new DateTime(2012, 11, 26),
                new DateTime(2012, 12, 24)
            };

// unassigned local variable for passing with out modifier to DateTime.TryParse() method
DateTime date;

// if string is correctly parsed we want to limit lower end of selection.
// If empty string is passed we get fakse and we skip lower end limitation
if (DateTime.TryParse(maybeStartDate, out date)) {
    dates = dates.Where(dt => dt >= date);
}

// if string is correctly parsed we want to limit greater end of selection.
// If empty string is passed we get fakse and we skip greater end limitation
if (DateTime.TryParse(maybeEndDate, out date)) {
    dates = dates.Where(dt => dt <= date);
}

return dates;

Sometimes I feel that developer’s have weak knowledge about how collections and LINQ works together, because as I asked my mates they thought the code above will produce collection of one date(12th of March 2011), but that’s not right. In this case result will return empty collection, because there’s nothing between 31th of December 2011 and 31th of December 2011.

Unexpected result? No!

We know that Where extension method returns IEnumerable<TSource>, but what we usually didn’t is that Where method returns one of the following nested class derived from IEnumerable<TSource> based on the instantiated type.

  • private class Enumerable.WhereArrayIterator<TSource> for TSource[]
  • private class Enumerable.WhereListIterator<TSource> for List<TSource>
  • private class Enumerable.WhereEnumerableIterator<TSource> for IEnumerable<TSource>

All of these private types are derived from private abstract class Enumerable.Iterator<TSource> and defined in System.Linq.Enumerable type.

So, the problem here is that after we use Where extension method we didn’t enumerate the source collection and yield elements that satisfies predicate directly. Instead of it is created one of the above types which helds source collection and predictate. When we call Where extension method on one of this types the predictates are combined together and creates new one that is hold in the Iterator class.

In our case we’ve created WhereArrayIterator class we combine predicate td => td >= date and td => td <= date.

WhereArrayIterator is now holding after combining two predictates and we can simply write it like this:

DateTime date = DateTime.Parse("2011-12-31");
return dates.Where(td => td <= date && td >= date);

But why it is like that? Just because we’ve used lambda expression to create delegate that points to an anonymous method and anonymous method points to the local variable, not the current value in it. So, the problem is that we work with one local variable that was changed before we iterate throught the collection.

Solution(s)

Easier and better way to avoid this unexpected collection results is to simply declare separate variable for each parameter we are using in lambda expressions.

// incoming parameters from UI
// if user do not filter by dates or filter only one end of the collection there will be used empty string
string maybeStartDate = "2011-01-01";
string maybeEndDate = "2011-12-31";

// in real world it can be any data source derived from IEnumerable
IEnumerable<DateTime> dates = new DateTime[] {
                new DateTime(2003, 1, 1),
                new DateTime(2010, 6, 15),
                new DateTime(2011, 3, 12),
                new DateTime(2012, 11, 26),
                new DateTime(2012, 12, 24)
            };

// unassigned local variable for passing with out modifier to DateTime.TryParse() method
DateTime startDate;

// if string is correctly parsed we want to limit lower end of selection.
// If empty string is passed we get fakse and we skip lower end limitation
if (DateTime.TryParse(maybeStartDate, out date)) {
    dates = dates.Where(dt => dt >= startDate);
}

// unassigned local variable for passing with out modifier to DateTime.TryParse() method
DateTime endDate;

// if string is correctly parsed we want to limit greater end of selection.
// If empty string is passed we get fakse and we skip greater end limitation
if (DateTime.TryParse(maybeEndDate, out date)) {
    dates = dates.Where(dt => dt <= endDate);
}

return dates;

Second solution for that is to iterate the collection to apply predicate. So, you can simply call ToArray(), ToList() (or any other) method, but I don’t recommend this approach, because overhead is not what we want to achieve. You know, more you iterate, more it cost.

// incoming parameters from UI
// if user do not filter by dates or filter only one end of the collection there will be used empty string
string maybeStartDate = "2011-01-01";
string maybeEndDate = "2011-12-31";

// in real world it can be any data source derived from IEnumerable
IEnumerable<DateTime> dates = new DateTime[] {
                new DateTime(2003, 1, 1),
                new DateTime(2010, 6, 15),
                new DateTime(2011, 3, 12),
                new DateTime(2012, 11, 26),
                new DateTime(2012, 12, 24)
            };

// unassigned local variable for passing with out modifier to DateTime.TryParse() method
DateTime date;

// if string is correctly parsed we want to limit lower end of selection.
// If empty string is passed we get fakse and we skip lower end limitation
if (DateTime.TryParse(maybeStartDate, out date)) {
    dates = dates.Where(dt => dt >= date).ToArray();
}

// if string is correctly parsed we want to limit greater end of selection.
// If empty string is passed we get fakse and we skip greater end limitation
if (DateTime.TryParse(maybeEndDate, out date)) {
 dates = dates.Where(dt => dt <= date);
}

return dates;

Conclusion

Don’t try to save one line of code! Code became less readable and may cause unexpected results as it does in this case. Keep using things in the standard manner. Do not experiment when you don’t know how things really works. Oh, maybe I forgot one important thing. All written above apply for all types inherited from IEnumerable, so IQueryable types are also involved.

Fix for annoying Skype message sound notification

As there are a lot of people asking how to disable sound for Skype’s chat messages, because they are irritated with “bug” when a new message recieves and Skype notifies an user with sound. It used to happen during listening to some sound source(music, vids, etc.) with plugged earphones and an inactive Skype window on notebooks with integrated speakers. I have never been digging deeper into the real problem, but I think it is caused by conflict between a channel usage when Skype is trying to aquire channel used by another application, which ends up with this strange behavior. So, Let’s resolve it.

Resolving the conflict

It’s really easy to resolve it and I will guide you throught few screenshots.

Step 1: Start Skype application.

Step 2: Open Skype options dialog windows through top menu Tools and next click Options from the dropdown menu.

skype-options

Step 3: Select Audio Settings from the left menu.

skype-options-2

Step 4: Configure speakers and ringing options. It is important to set speakers to a different channel than ringing. I have set it to my communication headphones channel and ringing to a built-in speakers. I listen to music the 99% of time while I am in the office, so I choose it like this.

skype-options-3

Step 6: Save changes and try to chat with someone.

Conclusion

Skype by default doesn’t go down well with computers that have built-in speakers and makes a lot of pain to users. By changing setting we’ve eliminated conflict between two apps. These settings will make you comfortable about using Skype. All the magic there is to set up channel for communication same as the channel you are using for listening to music or sounds from movies which you can’t do both or you can, but it’s not usual to do. Usually, you talk via Skype or watch movie/listen to music. But you are able to listen to music or watch movie during chatting and a notification sound doesn’t need to be separated from the other sound source. So, we’ve set a notification sound to  a different channel and the built-in sound mixer will mix these together for us without any interuptions and that’s what we want.

Words under the line

Making the first screenshot with opened dropdown menu was PITA for me. I love to use my favorite keybord shortcut fn + alt + prt sc(captures active window screenshot), but I was unable to made it. Always I press the alt button dropdown menu disappeared. Gotta make it better in the seventh release, do you listen, Skype team? Small things make better products.

Do you know how to set up IIS for your web app?

Few minutes ago I was looking for solution for problems with setting up the IIS. Gladly, I found great blog post with the IIS Best Practices on the Cenk İŞCAN’s blog which helps me a lot with it.

Of course you’ll find useful information about IIS 8 setting in the Security Best Practices for IIS 8 article on the Technet.

Don’t forget to remove temporary code. Comment tokens helps you

Earlier today Joost van Schaik(@LocalJoost) tweeted about piece of temporary code he forgot to remove which caused performance degradation.

I think Joost is not the only one who forgot piece of code somewhere and didn’t realize it is causing the problem. I was/am not the exception, but I found way how to avoid it. My solution for this problem is named Comment tokens which helps me a lot when I am not lazy to use it.

Comment tokens

Comment tokens are words used at the very beginning of the comment and indicates that the comment might be visible in the Task List, if you set them correctly in your Visual Studio. Let’s take a look how it works.

Investigating comment tokens

Open the Task List window using Ctrl + W, T shortcut or navigating thru top menu opening VIEW and then clicking Task List.

Navigate through  Visual Studio top menu to VIEW and Task List

Task List windows will appear in the bottom of the Visual Studio user interface. Don’t be confused when nothing appears after you’ve opened it.  User Tasks are selected as a default. You need to select Comments option in the dropdown list.

Select Comments option in the dropdown list

But nothing is there still. Yeah, I’ve forgot we need to create some comment with token. So, let’s move to Visual Studio settings and take a look at the defaults. Through VS top menu navigate to the Options in the TOOLS dropdown menu.

Navigate through  Visual Studio top menu

Dialog with Visual Studio options will appears. Click Task List item.

Click Task List item

On the right side of the dialog windows you can see the option for setting up the Task List, but we’ll focus on the Token section. Here are Visual Studio defaults we can use immediately.

Take a closer look at the Token section

So, Let’s try it out with default tokens. I’ve used three of them in the code. Watch the Task List window where you can spot all of them now. When you take a look at right side of the Task List windows you can see there are informations related to these comments(green outline). It helps you to better understand in which file these comments arw. Another great thing is that you don’t need to use exactly the same case of your tokens. You just need to write the word only.

Underlined comments are appearing in the Task List now.

Hey, did you notice the red exclamation mark left to the unresolvedmergeconflict? You’re guessing right. Comments token can be prioritized. Low(blue down arrow), Normal and High priority(red exclamation mark) available. Higher priority token got, higher it appears in the Task List.

Setting up custom comment tokens

I hope you remember how get into Task List settings, so open it again(Hint: TOOLS > Options > Task List). We’ll set our first custom comment token. I will start with REMOVE token. Select one of the existing tokens(red outline) and change name and priority as you want/need(green outline). After you made change to the token name dialog disables Change and Delete buttons and activates Add button(yellow outline). After you’re done, click that Add button to insert your first custom token into the list.

Select any token, change it as you like and then click add button

I made some comment tokens and I’ll show you how to use them, but for now you have to think about it at your own. I am convinced you understand it and next image doesn’t need to be explained anymore.

I’ve used REMOVE, REFACTOR, TODO and EXPLAIN tokens as its visible in the Task List

How to start using Comment token

I don’t want to wrote a lot about it, cause there is really nice article Comment and Tasks in Visual Studio written by Dan Gilleland(@dagilleland) that is good enought to kick start. You can find useful Task List article on MSDN Library.

Conclusion

To avoid forgetting temporary code mark it with inline comment with token. It will help you quickly overview the code without overhead of searching for the problem or creating Task which is planned for later when the pressure allow you to take care of it. For me its better to create inline comment with token then creating new Task in the TFS if I only need to have some pointer to code I wanna review or have marked for any reason.

Input data, validation and data consistency matters. C# Corner proves it

Today I decided to create an account on C# Corner. I opened the site, navigated to the sing up page and filled the form. I did everything as I did successfully thousand times before, but was unable to go through the client side validation when tried to submit the registration form. Client side validation popups a dialog with error info: Mandatory fields – Last name must have alphabets only.

I thought I filled my last name incorrectly using English keyboard instead of Czech. My last name have a diacritics, so when I type my surname on the English keyboard it writes numbers. I closed the error dialog and saw I written the last name correctly as you can see on the picture above.

WTF! I am not wrong! Take a look at the image once again and you’ll find the Last name field is not marked as mandatory field, but the error dialog told me it is. Okey, I don’t care about that, but I care about my surname. I just want to use it with diacritics, not without.

Investigating validation

I started to investigate the javascript that validates the registration form. First and last name fields validation uses (([a-zA-Z])(\\s)*)* regular expression to check if the value is correct.

I don’t have strong knowledge of regular expressions, but I think it repeatedly tests characters once or repeatedly when there is a space. So, users can use surname of one or more words. But why I can’t use diacritics I still can’t imagine, so I dig deep into it. Regular expression used to test first and last name simply don’t count with diacritics and will always popup with an error if contains any.

I just tried to turn off Javascript and submit the form again. Guess what happened. Yes, the form was submitted and account created.

I was wondering if there is some server side validation to check correct form values and there is not. I tried to submit numbers and special characters with Javascript turned off and  I was able to submit it too.

I didn’t try to log in, but it doesn’t matter. I was wondering if I can pass the validation and create an account successfully only. And I can and that’s not good for application. It is difficult to estimate if submitted data can cause some problems, but it is possible when application logic counts with exact data. It is not my problem, but it is nice way how to realize you have to be patient when implementing input validation in your application.

Automatic data correction

Last year I’ve done Microsoft Certification exams and became MCPD. I wanted to print certifications, but all of them used my uppercased name without diacritics and I was unable to change it any way. I sent a request to the Microsoft Support, if it possible to change my last name. It looks weird when I send somewhere my certifications and there is not exactly my name. I can live without diacritics, but it is lot better when my name appears correctly on such a document. After few days Microsoft Support sent me an email with information my name should display correctly now. I was very pleased, because it is really hard to get from Microsoft what you want/need sometimes. I checked out the certifications and everything was correct. After some time I need to download these certifications and I was very suprised my last name was without diacritics again. I really can’t imagine why, but I think it was changed when I was editing my LiveID profile. Maybe(I’m just guessing), it doesn’t give me validation error, but directly converts input values to text without diacritics.

Conclusion

There is solved question how to validate Non-English character on Stackoverflow that will help you implement correct client side validation for languages which uses characters with diacritic.

Second problem on  C# Corner is there is not server side validation. This is big mistake. Every single user input needs to be validated on the server. For better user experience you can implement client side validation. You can take a look at question on Stackoverflow in which users ask if it is better to use client side or server side validation.

When you have implemented logic which changes input data or converts it, notify the user you will make the change. User can’t imagine you are doing such a think.

C# Corner please

Don’t send me password via email when I change the original system generated after the registration. Thanks!

Life’s not fair at all, but we have to live

It is always sad when somebody leave the world. It is life, but why have to die people under 30? Sunday 23th of September 2012 left one of my best friends. He was only 29 years old. I get the message from his girlfriend. I read it when I woke up and was shocked. I couldn’t believe what I am reading.

His name is David and we are friends for more than 12 years. We was playing sports, console games, drinking and other things when we were youngsters. We had a lot of fun together. He was serious guy and always there when I need him. Wish I’ll have one minute to tell him how I appreciate everything he done in his life(not only for me).

It is really sad and I am about to start crying. It is hard for me to believe he’s gone. There are his girlfriend Lenka and beautiful daughter Valerie alone now. Wish Lenka will be strong enought to countinue with her life as soon as possible. I trust to David’s brother Lukáš he will help her to overcome the loss of David. They have to be closer to each other more than ever before.

Look at them. They are beautiful. Perfect family.

 

I hope You had a nice trip to heaven. All of us will trully miss you, David. Rest in peace, my friend.

Don’t sleep with your love. Enjoy your enemy while sleeping!

Last few weeks I was facing really big pressure, because we lost one of our contractors he broked his hand. We tried to fill the gap, but nobody experienced enough was immediately available. We decided to continue development without wasting time looking for a substitute,  because there was a small chance to find someone suitable right before the summer and vacations.

Every single minute you should be prepared for extreme situations which can alter your project to a time-bomb!!! And you should be prepared for that time-bomb too!!!

Run faster than you planned. It saves your (personal) life

Always be at least one step before the actual plan(keep it as your secret, because some smart managers can change planning).  This one step means some unit of work or time(it depends on the project size). It is really important to avoid to fall too much behind the project plan when something went horribly wrong as my last experience is.

We had a lot of problems to solve on the project and I got an email about non functional app from other customer. In there was “We can’t work, because we can’t access detail page. We need to solve it immediately!”. I was calm, cause it is small app and there is nothing too complicated, but I was wrong. In the moment I figured out the problem is not as small as I was thinking and my development plan reserves were gone. It taked almost whole day to run the application again. Because I lost this one day I have to create positive gap again in the project plan staying at work till evening.

Not only your current project can go wrong. All other projects can run into problems. Keep it in mind and count with it. You wont be suprised if it happens.

Always it can be worse, trust me

That day I went home lately, opening the door and feeling some strange smell. Hooray, clogged pipe was filling my bath with dirty water and don’t wanna stop(take a look at the video). So, I was trying to find somebody who will fix it, but every repairman told me on the phone he is available only at the morning, not at night. I understood that. So, I grabed the bucket and carried the water from the bath to the toilet until it was nearly empty. Morning the repairman came and tries to clean up the pipe, but he gets stucked after 30 centimeters and can’t move forward(till now I don’t know why). After 4 hours he was gladly finished.

These two situations move me backward in my plans more then I was prepared for and in my head The Doors played song The End(Do you know that song?) in the while(negative thinking) loop.

Don’t tell to yourself you got enough time even if you do. Rather move quickly forward than procrastinate. Keep your current positive plan for yourself, but tell when it went wrong and you are behind the project plans.

We love the work, so we work till its done

All of these continous occasions led me to a biggest mistake I have ever made. I started to work a lot at home after I come back from work.  I spent lot of time in the kitchen and in my bed with my notebook working. This step simply removes the line between work and my personal life.

It was fine for first few days. When I was tired I just close my notebook and fall asleep really quickly. But after some time I was thinking more and  more in my bed and can’t fal asleep, cause of my thoughts flying from one side to another in my mind. My most intimate place tranforms to a place for work in the subconscious and that was bad for me and for the project. Morning waking up very tired and my whole days was like very very long slowmotion movie. No, I was like guy from slowmotion movie. I was unable to think and pursue work. It takes about a week before I figured out it slows me down a lot. I was just tired, ineffective and demotivated also.

Don’t mix work with your personal life. Keep it separated as much as you can. When you need to work at home build small office room/corner for that purpose.

Conclusion

Problems are everywhere and can rise up at anytime. It is hard to see all of them at the beginning and sometimes during the project. It will suprise you in times you wont expect it and you have to be prepared for all of these.

Project

Everybody can make a mistake and you have to rely on yourself. Even if you are “only” developer you may talk to managers and tell them when you find some mistake in the project plans. I have seen lot of project plans that don’t correspond to a reality. When you accept these mistakes in the plans, you expose yourself to pressure before the project starts. And thats your fault. Anytime in the future you won’t have arguments and everybody will ask you “Why you didn’t tell us?”. Pressure is fine, but when you can’t finish the project as it is planned you will only ruin yourself and makes customer angry, because of delay. Once again. Talk to the managers when you feel the project can’t be done in presumed time. If you think you can do your project in time or you feel there is an extra time never count on that. Always move forward as quickly as you can. You never know what happens in the future.

You and fellow workers

Keep in mind you and fellow workers are only people. People can be sick, can have problems with their family, flat, car or whatever. There is always possibility some of you can’t work on the project for some time. Always try to have somebody who can help you with developing while you or your colleague will be out. Again, you have to talk to the managers to take it into count. Talk to your fellow workers how they handle the pressure and if everything goes fine. Some people can’t handle long time pressure or can get stucked on some problem and are shy to tell.

Your mental side

Even if you need to work harder take time to rest. When time is your enemy, you have to sleep as long as it is possible to be prepared for another dose of hard work. Don’t forget to enjoy what you’d like to do. Go for shopping, watch movies, play games, cook, go for a trip, watch hockey or something else you like. It helps you to absorb psychological pressure and this is what you need.

Working environment

If you can work in employer’s office only, do it. Keep the gap between your work and personal life as wide as you can. When you have to work at home never ever work at places that are designated for other things. If you don’t have room where you can setup your home office, try to find some small place which is not used for anything. Don’t work from your bed. Bed is used for sleeping. Don’t use dining table. Dining table is used for eating.

Conclusion of the conclusion

  • Inform managers something (may) went wrong.
  • Ask for or offer help if needed.
  • Talk to the fellow workers.
  • Don’t sleep with your work. Enjoy your time while sleeping! Don’t forget work is still only work and even you love it you have to take a rest.

Convert and Math classes aren’t smell. It’s tasty!

Few days ago I started to follow Iris Classon(@IrisClasson) on the Twitter. She is asking on her blog (usually) everyday one question about coding, design, best practice e.g. in the 365 Stupid Questions.

These questions are really practical, because they makes me think about and search the answers. Reading the comments below the question is also valuable and give me different views at some problem. Literally it push me forward and I am happy for that.

Converting answer into an article

While I was reading comments under the Stupid Question 43: Are utility, helper and or static classes and methods considered a code smell? I notified one respectively part of one, that really don’t fit my opinion and I start to investigate more about Convert class. Joep Beusenberg wrote:

Unlike the previous replies I think Convert and Math are two of the worst constructed utility classes in existence.
IMHO Convert and Math have no reason to exist whatsoever. All of the Convert methods could easily be added as methods to existing types. (Convert.ToInt32(object o) could have been int.From(object o), and Math.Sin(double n) could just have been n.Sin(), perhaps even as the property n.Sin, since it’s quite pure.)
Same goes for the Array class.

I just miss the point why are System.Convert and System.Math classes bad. Each of both has its own responsibility. One for converting between built-in framework types and second for mathematical operations with numbers. I was thinking about it for some time, but I don’t get why these are the worst constructed utility classes. I still feel these two classes exactly follows the Single Responsibility Principle. Object can’t convert itself to another and object can’t compute itself to a result(this is direct dependency between objects and that’s bad). There needs to be responsible object for that work. So, there are Convert and Math classes for it. Moving these methods to an object is not good practice.

As Joep wrote int.From(object o). Is it possible to convert to int from (imagine your custom) object without knowing how to do that? I don’t think so. Take a look at these built-in framework types

As you can see all of these types are types we are using daily while coding. Except last three are all structures. Structures are recommended to use as primitive types not exceeding 16 bytes. In other words structures best fits data chunks only. Is responsibility of any data object(class or structure) to provide methods to do something with itself? I thing data containers must have only the minimum needed to work with them. Nothing more. So, it is really good there are Convert and Math class to do the work.

There is even more, don’t you know?

Each of types in the list above explicitly implements IConvertible interface and its methods listed below

This explicit interface implementation you can simply use whenever you don’t want to use static Convert class together with base types.

Methods in Convert class usually box passed value to IConvertible type and calls suitable method or directly returns the value or throws an exception. Convert class only encapsulates working with IConvertible interface and its methods we can call directly from our code if we want. Why we want to do when Convert class handles all checks for nulls and overflows? And better. Convert class can be easily extended to convert custom class to base types. We only need to explicitly implement that interface.

Take a look at GitHub repository Object.Conversion where you’ll find some example usage of IConvertible directly and explicitly implemented in Point structure.

Conclusion

I really think that Convert and Math classes are good and aren’t code smells. I am always trying to keep away of utility classes, cause there is way of doing it better without them, but sometimes when application gets too complex it is better to separate same/similiar behavior of more classes to one utility class. It is better to have one class responsible for some area of functionality over more types and when you do it extensible it is your win.

I don’t want to forget this

I don’t want to forget who I want to be. This important definition was created by Uncle Bob and I am glad he wrote it. It’s really important to have some “Bible” with commandments you’ll follow as I follow these.

What is a professional programmer?

The single most important trait of a professional programmer is personal responsibility. Professional programmers take responsibility for their career, their estimates, their schedule commitments, their mistakes, and their workmanship. A professional programmer does not pass that responsibility off on others.

  • If you are a professional, then you are responsible for your own career. You are responsible for reading and learning. You are responsible for staying up-to-date with the industry and the technology. Too many programmers feel that it is their employer’s job to train them. Sorry, this is just dead wrong. Do you think doctors behave that way? Do you think lawyers behave that way? No, they train themselves on their own time, and their own nickel. They spend much of their off-hours reading journals and decisions. They keep themselves up-to-date. And so must we. The relationship between you and your employer is spelled out nicely in your employment contract. In short: They promise to pay you, and you promise to do a good job.
  • Professionals take responsibility for the code they write. They do not release code unless they know it works. Think about that for a minute. How can you possibly consider yourself a professional if you are willing to release code that you are not sure of? Professional programmers expect QA to find nothing because they don’t release their code until they’ve thoroughly tested it. Of course QA will find some problems, because no one is perfect. But as professionals our attitude must be that we will leave nothing for QA to find.
  • Professionals are team players. They take responsibility for the output of the whole team, not just their own work. They help each other, teach each other, learn from each other, and even cover for each other when necessary. When one team-mate falls down, the others step in, knowing that one day they’ll be the ones to need cover.
  • Professionals do not tolerate big bug lists. A huge bug list is sloppy. Systems with thousands of issues in the issue tracking database are tragedies of carelessness. Indeed, in most projects the very need for an issue tracking system is a symptom of carelessness. Only the very biggest systems should have bug lists so long that automation is required to manage them.
  • Professionals do not make a mess. They take pride in their workmanship. They keep their code clean, well structured, and easy to read. They follow agreed upon standards and best practices. They never, ever rush. Imagine that you are having an out-of-body experience watching a doctor perform open-heart surgery on you. This doctor has a deadline (in the literal sense). He must finish before the heart-lung bypass machine damages too many of your blood cells. How do you want him to behave? Do you want him to behave like the typical software developer, rushing and making a mess? Do you want him to say: “I’ll go back and fix this later?” Or do you want him to hold carefully to his disciplines, taking his time, confident that his approach is the best approach he can reasonably take. Do you want a mess, or professionalism?

Professionals are responsible. They take responsibility for their own careers. They take responsibility for making sure their code works properly. They take responsibility for the quality of their workmanship. They do not abandon their principles when deadlines loom. Indeed, when the pressure mounts, professionals hold ever tighter to the disciplines they know are right.

Why you should discover hashtags about yourself

It is more trendy to use twitter to communicate and share useful information about anything and anybody. Even more I see tweets with some critics and hashtags #{company} and #fail or #epicfail. Take a look at tweet from Dennis Mulder (@dennismulder) which inspired me to write this post.

I really don’t understood to a text he shared through this tweet, but I know hashtags #ikea and #fail means something not good at all. This make me think about Ikea company, if they are watching hashtag #ikea in combination with negative words hashtags. So,  I tried to search the twitter for hashtags Dennis Mulder used in his tweet and I found 20+ tweets from September 1, 2012 to September 9, 2012. Half of it I really don’t understood cause I can read only English and Czech. But I found two that attracts me. One posted by Aaron Pinero (@aaronpinero).

This post is not really nice toward the Ikea service. And second from Dom Farr(@domfarr) about product he bought.

It is ugly to see someone talks about company like that, but it is better to know it. This is constructive feedback you can use in some way to make better services or start communication about that problem or make an apology to customer who felt disappointed to compensate the negatives.

Real power of hashtags in the real world

During writing this article I found real power of hashtag combination using search #lumia and #fail. Early September 2012 Nokia shared ad on the YouTube(Nokia deleted this video or I can’t find it on Nokia Channel). After few days(September 5, 2012tech magazine The Verge post an article that proves it is faked. The Twitter was full of negative tweets about faking the video. When you cheat you have to count with somebody who will catch your hand and tell the world. So, Nokia was catched and everybody was talking about this fake ad not only on the Twitter and Nokia’s image drop down.

The worst about it was that same morning Nokia together with Microsoft unveils new Nokia Lumia 820 and 920 with Windows Phone 8 on the press conference talking about it with passion showing the people what a great phone they made. I was watching live stream and was very pleased about what I see. On the Twitter was tons of tweets about Lumia and at this time Nokia Lumia was on the positive top. Now you can imagine how powerful the Twitter is(also other social networks) and how easy is to mess a shiny glass.

Don’t foget one really important thing. When something is great and people are tweeting about it they often use only company, product or service name hashtags without the positive word hashtags. When they are posting negative tweets they are using negative words hashtags. So, if anybody wants to know about you using company, product or service name hashtag, they will always see positive and negative tweets together.

Conclusion

Never ever underestimate the power of social networks(at this time talking about Twitter) and do whatever you can to catch negative tweets using combination of hashtags(company, product or service name) with negative words(fail, epicfail, etc) hashtags. You will be able to quickly react to current problems which can throw bad light on you. My opinion is that it is always better to know about problems or negative side effects of decisions you made to avoid them in the future. Next thing you can catch with this is when someone wants to damage your reputation with defamation(or slanders. I don’t know which word is better for this context). Ability to react is awesome, but you must have something to react to.

Thanks for reading. I will be pleased for every comment.

Follow

Get every new post delivered to your Inbox.

Join 663 other followers

%d bloggers like this: