Wednesday, December 24, 2014

Holidays are efficiency killers

First of all, let me state that this post is a personal opinion. And, like any opinion, it relates to an individual's personal feeling and it's subject to interpretation. You can disagree with it. Also, note that I'll be using Christmas and the first day after New Years Eve as examples and I think they are actually the only two exceptions to my opinion.

So, I think Holidays are efficiency killers. Don't get me wrong, I'm even more addicted to my personal life than I am to my work, but there's just something wrong with our current calendar. Let me explain: This year, both Christmas and the first day after New Years Eve are on Thursday. For the "typical job", what that means is that we work 3 days, stop one day, then work Friday and then there's the weekend. This is bad news. It's a rhythm breaker. What I mean is that I like holidays, just like everyone else, but in our current world, we should consider adapting the holidays to a more logical calendar. It would be like a "disk defragmentation tool":


If you're spending the weekend 400km away from your work and someone tries to schedule a meeting to that same location on a Thursday, what would you do? Probably postpone the meeting to Friday right? That's efficiency: take the best out of the available resources in order to achieve a given task. If your birthday is on a Wednesday, you'll probably postpone the celebration party to Friday or Saturday because that way people can take the most out of the night (assuming they don't work on weekends). Why not do the same with holidays? If a holiday is on Thursday, why not move it to Friday? Apart from religious beliefs and similar issues, I can see no disadvantages on this "defragmenting" process. As a professional, It would be great: no rhythm breakers (not only for me, but because everyone else's rhythm breaking affects my work). As a life lover, three days in a row would allow much more fun and travelling.

As I stated in the first paragraph, I think Christmas and the first day after New Years Eve are actually the exceptions to the "defrag rule". And I know that due to religious, political and even financial issues this would be hard to implement, but it would be great...

Thursday, December 18, 2014

What's unique about Shark Tank (US)

I love Shark Tank (US). Until this show, I was only addicted to one TV Series in my entire life: It was the 90's, a series called Seinfeld (a name inherited from one of it's creators, a genius man by the name of Jerry Seinfeld). There's a big difference from Seinfeld to Shark Tank: while the first was a TV Series written by geniuses and cannot be replicated across countries or cultures, Shark Tank is actually replicable. The format is just the materialization of something that happens everyday: entrepreneurs pitch investors. And it happens everywhere around the world.

So, in Canada you have Dragons Den, in the US there's Shark Tank, and in Portugal we'll have Shark Tank too. As a marketplace of ideas, they all work great. If you just want to see ideas, then your time is well spent watching either one. However, there's one thing that you won't get anywhere else but the American Shark Tank: The entertainment show. It's just something that the Americans are really good at: setting up a Hollywood production. And that's why Dragons Den is miles away from Shark Tank as an entertainment show. And that's why the Portuguese version won't be as amazing as the US version. It will be good to see ideas and how entrepreneurs materialized those ideas, but as an entertainment show, I'm out!

Don't agree? Take a look at the Shark Tank's Top Secret Gag Reel below.


Wednesday, December 10, 2014

The power of feedback

Feedback is essential. Not just Feedback: but constructive feedback! We all know this, but do we really put it into practice every day?

Everybody recognizes that no work is done without a team and teams rely on people that need orientation. Nowadays, we even use "buzz words" like 360-degree evaluations which are based in a full 360-degree feedback input (if it's good or bad that's another topic). So, feedback plays a particularly important role in teams and individuals. It's a key element to a continuous improvement process because it's supposed to direct efforts towards improvements.

But how to give feedback? Where should you focus your feedback? How to be assertive and direct peoples efforts to the right track? There are 3 basic levels of focus:

  1. Task level
    – The focus is on a task, something an individual has to do;
    – It's where the focus should be and where there's higher margin to enable improvements;
    – Example: Feedback about writing a Word document.

  2. Learning level
    – The focus is on behaviours, something an individual can learn to improve daily processes;
    – Useful if it can lead to a better behavior in order to perform a task. Efficacy;
    – Example: Feedback about posture in a business meeting.

  3. Self
    – Dangerous: high probability of emotional reactions;
    – Comparison with the "ideal person" is a red flag;
    – Example: Feedback about the person's intelligence.


This is theory, but let's see examples (of negative feedback):

   "You're late. You're lazy. This can't happen again."
   "If you could be here 10 minutes earlier it would be great. It would allow us to talk more before the meeting and that would be awesome."

In the first quote, the focus is on the self. He's not the perfect stereotype, he's lazy. Now, turning tables, in the second quote the focus is no longer on the Self but on behavior. Yet, the message is the same: you're late!

   "You don't know how to work with Powerpoint."
   "Why not do a Powerpoint workshop? It would be of great value to your daily tasks and you could help us even more."

Can you pick on the difference? The first sentence is totally focused on the Self. The second has the exact same topic, the exact same problem, but now the focus is at the task level.


These two examples are a deviation of framing techniques: people react in different ways depending on how the information is presented to them. The Framing effect is actually more specific and even more interesting. Take a closer look at the "Research" topic in the WikiPage. Humans...


Tuesday, December 2, 2014

How focused are you?

Psychological factors play a huge role in our daily interaction. It's also one of the most interesting topics in project management.


Ready? Take a look at the following video:




How did you do? Here's another: Who did it?



What you witnessed belongs to Cognitive psychology. "Selective attention is simply the act of focusing on a particular object for a period of time, while simultaneously ignoring irrelevant information that is also occurring. This occurs on a daily basis and can be seen in how people pay attention to something and how much attention is given at that time. Because it is impossible to give attention to every stimulus in our environment, we use selective attention to select what stimulus are important as events occur."


Monday, November 17, 2014

.NET Core Open Source – Written by Humans!

The .NET Core is now OpenSource. It's on GitHub. For the more fanatics, Microsoft had already release "a working implementation of the ECMA CLI and the ECMA C# language specification" back in 2001 and 2006. It was the Shared Source Common Language Infrastructure (SSCLI), also known as Rotor. Now it's the official core. You can read the release info here: .NET Framework blog.

But, guess what: They are human at Microsoft. And they write like "normal" people. Take a look:


We're doomed! (Source: ConcurrentExclusiveSchedulerPair.cs)


Maintenance (Source: Parallel.cs)


Zombies... (Source: Scheduling.cs)


Curve ball (Source: DebugTypeDescriptor.cs)


Legacy (Source: isymwrappercore.cs)


I can't prove it! (Source: EventLogInternal.cs)


Don't touch (Source: compareinfo.cs)


I don't understand (Source: methodbuilder.cs)


Hooker? (Source: console.cs)


Note:
This was adapted from another blog. You can read part of the original article here (pt-BR).


Friday, September 26, 2014

Don't be human – Cognitive Bias

One of the most interesting topics I came across at the executive masters in project management was related to human (psychological) factors, more specifically Cognitive Bias. A Cognitive Bias is "a pattern of deviation in judgment, whereby inferences about other people and situations may be drawn in an illogical fashion". There are lots and lots of Cognitive Bias, but here goes one of my favorites:

Negativity Bias is a kind of Cognitive Bias where one tends to notice and remember negative events and information rather than positive. For instance, It's a beautiful sunny day, you have your perfect clothes for that important meeting. On your way to the office, just before entering the building, a pigeon comes along and "does it" on you. "Damn! Bad luck! How is this possible? Argh". If the meeting doesn't go just perfect, you will remember "that damn pigeon". And you'll focus on that. You'll talk about it with your friends. But, how about all the other 3472840 days that no pigeon ruined anything? Why focus on the one time it hit you?

Here's a small article on Negativity Bias: How Negativity Creates Fear

Thursday, September 25, 2014

Empty string is different from NULL

I've been working with SyBase for 6 years now and it can still surprise me with strange behaviors. Take a look at the following SELECT statement:


In SQLServer (2005 onwards), executing the above script will yield equal results for all the 3 fields:


Copy and Paste the above script in Sybase, run it and you'll get a different result:




The first field is obvious. The second likewise: single quote marks, although empty, do not represent NULL value. Empty is different from NULL. However, the LTRIM and RTRIM return NULL when working on an empty string, as opposite to the SQLServer that returns an empty string. To me it was useful to have the SyBase behaviour in a recent project but, logically speaking, I think SQLServer's method is the best. Empty string is different from null.


Wednesday, August 20, 2014

throw new TooManyAndroidStudioHeadachesException();

I swear I tried! I gave it an honest shot. But it just keeps on stressing me out. At first, it was that "Gradle mix" that was explosive for me, but now even the IDE "blew up". In just a couple of days, all this is hurting my efficiency. I spend too much time fiddling with the IDE rather than focusing on what matters.

(click to enlarge)


I hope that in a near future the Android Studio does come a big hit. I really hope it improves in the future because we need it as a reference IDE. For now, however:

throw new TooManyAndroidStudioHeadachesException("Back To Eclipse");

(The article applies to the Beta versions of Android Studio)

Thursday, August 14, 2014

Give them what they REALLY want!

So you just had a long hard week of stressing work. You're exhausted, it's Friday night and you decide to go to a fancy restaurant to relax with a friend. Sitting at the restaurant, while enjoying a glass of wine, the waiter comes in and asks for your order. You're in a mood for risotto and you decide to go for the salmon risotto. The waiter takes your order and leaves while you keep enjoying your wine and the company of your friend. So far, so good!

But then the chef comes out of the kitchen to your table and says: "Hello. You've asked for the salmon risotto right?" You nod affirmatively. The chef continues: "Well, the risotto takes a while and must be prepared at a special temperature. Have you ever cooked risotto? It has its tricks. Let's do something: I'll go in the kitchen and gather the ingredients while you wash your hands and we'll meet in the kitchen in a while ok?"

How would you react? The Chef wants you to cook?
Awkward moment. After all, you took the option of going to the restaurant knowing it would be more expensive than if you were to cook the same meal at home. You took the option of paying more for the atmosphere, the convenience. If you wanted to cook your own risotto, you'd do it at home.

So, the point is: although it's common to say "give a man a fish and you feed him for a day, teach a man to fish and you feed him for a lifetime", this is not true for every occasion. Sometimes, the man just wants the fish. Sometimes, the client just REALLY wants the fish.


(click to enlarge)



The cooking example was adapted from the book $100 Startups

Tuesday, June 24, 2014

Preliminaries are as important as the act

So, it's a "sexual" quote. True. But apply the idea to a public presentation. Most people don't give the appropriate importance to the preparation (preliminaries) and just focus on the presentation (the act). And the normal "How to do good Presentation" stuff focuses on "the event itself", like "avoid repeated words and fillers", "talk with good voice tone", "don't turn your back to the audience", etc. However, just like in a negotiation or a simple business meeting, the preparation is as important as the event itself. If you do your homework right, the event is just a fun thing to do. Here's 10 quick tips from my personal experience on the prep side of things:

1. Know your stuff: You might not be the best in the world on the topic you will be presenting, but you damn sure need to be the best prepared man on what you're going to speak about. You don't need to be a Database Master Guru, but if you're going to talk about SQLServer Analysis Services, You MUST study that topic thoroughly and some other topics around wisely. You MUST be prepared for a wide variety of questions.

2. Know your audience: If it's "an open event" to anyone, this is harder and you have to choose a path:
  – Either adapt your presentation so it can be understood by a wide variety of profiles;
  – In your event abstract, clearly state who is the presentation for. Is it going to be too Tech? Very low Tech? Very business focused?
If you do know who your audience is (e.g.: A classroom of .NET enthusiasts), then prepare the presentation for them. It's crucial in order to capture their attention.

3. Know the venue: Talking in a class room with a small projector with low definition is one thing. Talking in an open event, in a room that can host 200 people and has a big high resolution projector, that's another story. All the details WILL be caught. If your projection is bad, it will be noticed.

4. Be Creative: Develop good, well structured and visible info for projection. Avoid crazy colors, follow good practices. A Powerpoint slide with 3000 lines of red text with dark blue background IS NOT a cool thing. A demo that doesn't work is not a cool thing. Showing something and not talking about it it's worthless. There's lots of info on the web about this, read it!

5. Control+C && Control+V: Errors and the Copy/Paste technique are dangerous. The worst thing you can do is having a presentation full of errors, either grammatical, business ones or any other kind. Even worse, something copied from the web without being quoted or investigated. Copying some statistic from a bad source is worse than not having that statistic. Having someone from the audience correcting you IS NOT nice. Keep in mind: pt-PT is different from pt-BR. Don't mix them.

6. Google is your friend: If you're talking in an announced event, with an abstract info pre-released, expect people to Google you and your topic before going in. Do the same. Anticipate questions that might arise, cover all possible angles. No pain, no gain.

7. Prepare your speech: You don't have to memorize a full two hour speech, but it's useful to memorize some checkpoints, some keywords, some speech flow. "Talk this, from here follow to there, which works as introduction to the next topic, which leads to the other...". Presenting for two hours is a Workflow, keep that in mind so that you can keep your audience alert all the time. Articulate ideas, don't brutally jump topics, "connect" your presentation from start point to the end.

8. Like your own voice: Others hear your voice different than what you hear. That's due to the "Skull effect". Record yourself and listen to the recording. See some of your previous presentations. Learn to vocalize for the audience and not how you like when you talk.

9. Build up Confidence: "We're not rational animals: we're rationalizing animals". Rationalization involves twisting and distortion of facts and reasoning to suit your own purposes. We try to explain everything, we confabulate to go after what we believe in. Same thing here: You have to believe in yourself and be master of your acts. The audience will "feel" the nervous in you. Talk to a mirror, present to your wife, girlfriend, friends, family. If your embarrassed in front of the people you love, how will you feel with strangers?

10. Train your presentation: Train just like you're going to present it. You'll see how much time it will take, what's missing, where your struggling. Improvise can be awesome, but there’s only two types of people that master this: natural born "talents" and "experienced speakers". If you don’t fit on any of these, avoid improvise too much.

Bottom line, if you're going to host a two hour presentation, be aware: it will probably take you 20 hours to really prepare it.


Monday, June 23, 2014

PHP Tools for Visual Studio

Simply put, I think Visual Studio is the best piece of software Microsoft ever released. It's miles away compared to other products in the Microsoft product line. So, whenever I can I try to use VS for development.

PHP is one of my favorite and "oldest" loves: it's simple, cheap, easy to use and well documented. It's one of the best choices for most common Web scenarios and nowadays, 14 years later, I still use it whenever I can. But, no "super special" Integrated Development Environment (IDE). Can you see where this is going? Well, PHP tools for Visual Studio. IntelliSense, Cool Debugging, Code Navigation, etc.

You can download them from the Visual Studio Extensions Gallery:
And here's another nice "gadget":


Monday, June 9, 2014

Why OutSystems grabbed my attention

Before I start, let me state 2 things. When I mention OutSystems, I'm:

  – Referring to the OutSystems Platform and not to the company itself;
  – Ignoring they have a Java version. Never used it.

Having said that, although in my day-to-day tasks I'm naturally moving away from the hard development, I like writing code. I'm that guy that likes to be awake at 4 a.m. when everything is quiet and develop stuff just for fun or personal use. Go figure! I have a huge passion for the .NET Framework and C# is just a beautiful, well-structured language. Add an outstanding IDE like Visual Studio and you get the point: It's (almost) a perfect world! So, going to a higher level of abstraction where you're not so focused on code but more on business logic was not an easy jump. But I jumped. I now acknowledge that I enjoy working with OutSystems. And there's one simple reason why OutSystems was able to gain my "respect": It just works! That's a huge compliment. And I'm far from being an OutSystems expert.

Some of the programming languages and technologies we work with look like they were designed by Psychologists in order to stress test you. Some try to be cool (and don't work at all), others are way too complicated for what they're worth, lots of others just aren't useful for most case scenarios and there's even the ones that fit in the "Rubiks Cube" for human logic: Insane! Why on earth is this even considered as acceptable? Who architected this? Who implemented it? Why do people use this?

OutSystems fits in the VisualStudio & .NET bag: It's intuitive, it's well designed, it's well architected, it's well implemented. OutSystems is an easy learn with outstanding capabilities. It's built on top of the ASP.NET and that's an invaluable boost because it leverages all the brilliant stuff you have in the .NET Framework and takes it to a new "speed" level.

Although OutSystems is not "for geeks" (far away from being), it just feels like VisualStudio: "Developed by developers for developers". Technology is just a means to an end, but there are some technologies that I like more than others. OutSystems is in the good ones!

The focus now is on Cloud and Mobile. You can try it for free, check the OutSystems WebSite.


Wednesday, April 30, 2014

Projects versus Operations: where Gold plating fits

Simply put, in project management, Gold Plating "refers to the addition of any feature not considered in the original scope plan". PMI actually red flags gold plating as being a bad practice (PMBOK Guide). I agree. In a "project context" it's a bad practice to do something that's out of scope and not included in the project plan. That simple.

However, in an "operations context", I'm a fan of the "Deliver more than expected" mindset (Larry Page). If, on your day-to-day normal operation, you have a small time window to go beyond what's required, DO IT!

Suppose your work is to monitor a farm of specific apps or whatever. You saw an opportunity to improve your daily work and, as expected, you develop a tool to ease your life. Cool, just normal work. BUT, if you can go further on and build a small documentation and make it available to all the company, BETTER. If it's so good and you can pitch it to another client with similar environment, amazing. If another client (and another, and another...) ends up buying it, PERFECT!

So,
    – In Projects: "Deliver as expected".
    – In Operations: "Deliver more than expected".


Friday, April 11, 2014

OutSystems: A Good Example!

OutSystems is an extraordinary platform (made in Portugal). If you Reverse Engineer their code, you can see some really amazing uses of the .NET capabilities (even WeakReferences and the idea of WeakDelegates). Pretty cool.

Here's a good example:
Converting a string value to a decimal can be done using an OutSystems Built-in function just like below:

(click to enlarge)


But, as you can see in the debugger, converting 223,6 to a decimal goes wrong. Why? Well, if you reverse engineer the code from the OutSystems Platform you end up with the TextToDecimal function:

(click to enlarge)


They use the "long version" of the Decimal.TryParse method. And that's the good example. By using it, they made the TextToDecimal CultureInvariant. That is, not dependent on Machine configuration. It's culture-insensitive. So, invoking the reverse engineered method actually yields similar result as expected. The "dot" version converts, the one with the comma doesn't:

(click to enlarge)


Now, my machine's current culture is Portuguese:

(click to enlarge)


So, using the short version of Decimal.TryParse doesn't behave as the above:

(click to enlarge)


As you can see, it's the opposite of the first version presented above. This is because my current NumberInfo understands the comma (,) as the decimal separator.

(click to enlarge)


And according to the MSDN documentation, when using the no culture constructor, the CultureInfo (and NumberInfo) defaults to the CurrentInfo:

"Parameter 's' is parsed using the formatting information in a NumberFormatInfo object initialized for the current system culture. For more information, see CurrentInfo."

This second version represents problems. Imagine your machine is pt-PT but the production environment is en-US. Bad out come.
Extra point to OutSystems. A case of good development.


Thursday, April 10, 2014

The mobile app economy is far from open

Shamelessly quoting Mark Cuban:

"I bet you think the mobile internet is open. That if you write the next great mobile app there is nothing that can stop it from fulfilling its destiny. That if you create a mobile content app that blows away netflix there is nothing that can stop it. Wrong!"

Interesting thought. You can read the full article here.


Tuesday, February 11, 2014

The not so good Android Studio

Repeating myself, I'm a Microsoft Technologies fan. Love PHP, MySQL and so on, but I admit my core is Microsoft. Nevertheless, technology is just "a means to an end" and I don't mind working with other techs. By now, Android world is very attractive to me. A couple of months ago I went back to eclipse, something I haven't touched since graduating. I'm not a big fan of eclipse. I'm a Visual Studio fanatic. It's almost the perfect IDE. I feel like it's very focused, totally oriented to efficiency and efficacy. It feels like it was developed by developers for developers. From all the tools I've worked so far, it's a 10 out of 10!



So, going back to eclipse felt strange to me. But OK... Yesterday I finally got the time to install Android Studio. I was excited: an alternative to the typical Eclipse, NetBeans and so on. I thought "a focused IDE to Android development". But no. It feels pretty much "eclipse" to me. In the very first run it even "blew up" (Gradle Exception).



I know that my opinion is "biased" and that these big players don't like to replicate ideas, but this is a case where it should be shamelessly copied. So, not keen to Android Studio for now. There are a couple of "VS Android" attempts out there, I'll be trying some of them in a near future if I get the time. Check them out (usefull links):




(The article applies to the Beta versions of Android Studio)

Thursday, January 9, 2014

Warning: Don't ignore Warnings!

In my opinion, treating compiler warnings as errors is a best practice. If and only you are absolutely certain that those warnings should not be appearing, then you can suppress them using "In Source Suppression (ISS)", #pragma or the VisualStudio menus. You can see more info here. I never did.

Having this in mind, the "Warning al1056". Marking an assembly with the AssemblyCultureAttribute using a non-empty string will make that assembly look like a satellite assembly. Even if it isn't. Take a look at the following code:


In the AssemblyInfo.cs we said that the AssemblyCulture was "pt" (Portuguese). If you look at the metadata for the generated assembly, it will look like it's a satellite assembly, despite the fact that it's just a class library. Just like any assembly, you can reference it and loaded at runtime. Now, if we create another Visual Studio Project (e.g.: Console App), reference the above assembly and call the "GoToSleep" method, it will successfully build as expected:


However, it will show the "Warning al1056", stating that the "Referenced assembly 'cAfonsoWorker' is a localized satellite assembly". According to the assembly linker warning and error reference:

"An assembly created using the AssemblyCultureAttribute attribute was referenced in the creation of the current assembly. The AssemblyCultureAttribute attribute indicates the file is a localized satellite assembly and it is not normal to reference a satellite assembly. You should probably reference the main parent assembly instead."

When you run your application you will get a "FileNotFoundException" stating that "Could not load file or assembly 'cAfonsoWorker, Version=1.0.0.0, Culture=pt, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." This happens because Visual Studio happily ignores the AssemblyCultureAttribute and copies the assembly into the bin folder (Debug and Release) when building the console application. However, at runtime the CLR will try to load what it thinks is a satellite assembly which, by definition, has to be located in a specific subfolder. In this case, if we move the linked assembly to the specific culture subfolder (Debug\pt or Release\pt), it will work as expected.


You can read more info here: Dennis Dietrich's Blog