Archive for category .NET
Tech Interview – Refactoring IV – SOLID Refactor
Posted by Viktor Peller in .NET, Design Patterns, Interview, Refactor, SOLID Principles on August 27, 2017
In this part we are going to refactor the parsers and the factory method more, utilizing design patterns and the SOLID principles.
Tech Interview – Refactoring III – Simple Refactor
Posted by Viktor Peller in .NET, Code Smell, Interview, Refactor on July 24, 2017
In the previous part we looked over the MainWindow class and found some improvement points. Those were common mistakes with simple fix. We skipped a big switch block, because it needed more work, and today we are going to refactor that part. We will not refactor it to its final form, though, first, we just make it better. In a second blog post, we will improve the code more.
Tech Interview – Refactoring II – Code Smells
Posted by Viktor Peller in .NET, Code Smell, Interview, Refactor on July 22, 2017
In this part we are going to take a look at the source code and try to answer the question that usually sounds like “what problems can you see at first look” or “what do you dislike when you look at this code” or “how would you change the code to make it better”.
Tech Interview – Refactoring I
Posted by Viktor Peller in .NET, Interview on July 20, 2017
In this series we are going to solve a programming test which was designed for interviews to see how a candidate can solve practical problems. During the test, we need to refactor and improve a small application.
In defence of C# (null <= null)
Posted by Viktor Peller in .NET, C# Specification, Internals on April 11, 2014
I read a funny remark on ‘null’ comparison recently which at first glance seems to be surprising, but uppon further investigation becomes understandable. The following program demonstrates: The output of the program: False True How can the ‘Less than or equal’ operator be false, when it has the same value on both sides? And why […]
Do experts use ++i?
Posted by Viktor Peller in .NET, Internals on March 29, 2014
Not so long ago I’ve read a note in a blog comment. It said that experts above a certain level should write their for-loop as the following: The important part is the ++i. Why is this better? A vast majority of developers use i++, I haven’t any idea as to why. I use i++, too, […]
What does Object.GetHashCode() return?
Posted by Viktor Peller in .NET, Internals on March 18, 2014
There are some misconceptions about Object.GetHashCode(). Two of them are quite prevalent: The implementation of Object.GetHashCode() derives the hash value from the reference (as a memory pointer value) of the instance The return value of Object.GetHashCode() is unique to the instance. No other instances will have the same hash value. These two claims may look […]
Recent Comments