Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Paulo Zemek
(Non-)Nullable Reference Types
Background Before starting, I must say that I am a great supporter of safety-features in programming languages, and I had proposed what I called the "required" keyword for C# more than 10 years ago. Yet, I keep seeing more and more people talking how great nullable reference types are in C# and, well, I am really unpleased on how badly the feature was implemented into the language, and this post is all about it.
BigDecimal in C#
Download Pfz.Math11.zip - 606.9 KB Introduction C# (and .NET in general) right now don't come with a BigDecimal class. They only provide us with a BigInteger class. It's funny that, to me, the only real difference between a BigInteger and a BigDecimal is the fact that the big decimal has a decimal separator (the dot, in American Standard) to divide integer numbers from the fractional/float numbers.
The Double-Checked Triple Lock Pattern for ReaderWriterLockSlim
Download ReaderWriterLockSlimExtensions.zip - 4.1 KB Introduction In C# we have the lock keyword, which can lock any object in an exclusive way. That is, once one thread holds the lock, no other thread will be able to acquire the lock until the first thread releases it. Such a lock is called exclusive (or sometimes a "full" lock) as there is no way for two threads to hold the lock at the same time. An alternative to a full lock is a reader-writer lock.
Patterns and Frameworks - What's wrong?
Before Starting This article actually became bigger than I wanted, which made me postpone it for a while... yet, I am not sure how to correctly fix it to be the perfect article size, so I am publishing it like this anyways. I hope it is good enough for most readers. Most of this article focus on patterns, frameworks that try to solve those patterns, and the problems that badly conceived frameworks cause, including creating new patterns.
Code Style & Readability - Grouping Things Together
This is another article about code readability. This time focusing more on how we should group members together, and also showing some cases of just bad rules that some places and people seem to enforce for no actual benefit. Background In the article Code Style & Readability I talked about code style focusing mostly on how to indent things.
Code Style & Readability
Lately I see an excessive use of code-formatting tools. The basic argument is that if the code follows a strict standard, it is easier to read. Yet, what is easier to read for a computer is not necessarily easier to read for humans, and this article will present situations where understanding the code style is more important that just following a "simple recipe" that can make things really weird. Introduction What code do you think is easier to read and will pass the formatting validation tool?
MVVM-B - B from Business logic
Background I have a friend that's studying how to develop iOS apps. In one of our many conversations, he told me he is using MVVM. I actually didn't know MVVM was being used for iOS development and, out of curiosity, I decided to search on the internet about iOS MVVM Best Practices. I was surprised on how much bad material I found. In one case, the article explained correctly about Model, View and ViewModel... but continued by showing an example that had just a View and a ViewModel.
The 6/2(1+2) Ambiguity
We will take a look at a simple math problem that can be interpreted differently. This article is an attempt to unify Math and C++ parsing logic in the future. Introduction I recently saw a post about a simple math problem, to which I was sure there was a clear answer. I got impressed how many people get it wrong by so many different reasons, and even more impressed about how everybody was focusing at the "wrong part" of the equation.
Exception Treatment - Should I catch this exception?
Introduction In this article I will be focusing exclusively on how C# and .NET deal with exceptions and when to catch them. It might be relatable to how other languages use them (I know for sure it is to some extent similar to exceptions in both Java and C++) but it is definitely very different to how Python uses exceptions, as there it is used to stop iterators, something we can, but should never do, in C#.
POLAR - Creating a Virtual Machine in .NET
Download release - 353.53 KB Download source - 497.64 KB POLAR - Paulo's Object-oriented Language with Assembly-like Runtime Before starting, I must say that this is an advanced topic. I tried to make it simple and correct what, in my opinion, are common errors when explaining the process of compilation. But, either way, the virtual machine has assembler(-like) instructions. So, being assembler, it is a hard topic.
Public API Events and Breaking Changes
Introduction When writing public APIs, one of the things we must take into consideration are possible breaking-changes in the future and, by default, we must avoid them. This is easier said that done, but the thing is: There are some techniques that can help us at least reduce the amount of breaking changes we will cause if things change in the future. For this article, I am focusing on breaking changes that happens because events changed.
The Dispose(bool disposing) Pattern is Broken
In .NET, the relationship between Dispose() and finalizers is confusing. In this post, we take a look at the Dispose pattern, the snowball effect of the pattern and why the pattern is broken. Then, we take a look at one of the solutions, namely, SafeHandles. Finally, we reanalyze the problem. Introduction Since .NET appeared, one of the most confusing things was the relationship between Dispose() (from the IDisposable interface) and finalizers.
The Dispose Pattern is Broken
Introduction Since .NET appeared, one of the most confusing things was the relationship between Dispose() (from the IDisposable interface) and finalizers. Original Idea The original idea was very simple: The Garbage Collector does the memory and resource cleanup for us, so we don't need to manage memory and resources manually. In practice, things got much more complicated. The Garbage Collector might not run when we need it to run (as it is said, it is "non-deterministic").
Non-Intrusive Frameworks
Introduction Many times I talked about non-intrusive frameworks as part of a different talk. Lately I had to deal with this kind of architecture again and I tried to find a concise explanation on non-intrusive frameworks but, instead of finding good explanations, I found questions with answers like "How can a framework be non-intrusive... you want to use it, without referencing it?" and that's really off and not helpful. So... What makes a framework intrusive or non-intrusive?
If we have good developers, good unit-tests and good code-reviewers, we don't need debuggers
Introduction This article is all about writing code that doesn't fail. But, if it does, having an acceptable way to figuring out what was wrong is perfect. The title of this article (that is the "If we have good developers, good unit-tests and good code-reviewers, we don't need debuggers") is something I heard at Google... and to me represents a lot of what is wrong with the company.
SimpleList - A C# to C++ comparison
SimpleList - A C# to C++ comparison Please Sign up or sign in to vote. A beginner article about how to write a simple list class in C# and in C++. SimpleList - A C# to C++ comparison implementing a SimpleList Introduction on how a very simple list class works internally, and many of the differences between C# and C++ in its implementation. This article is all about understanding the basic differences in how to implement a very simple collection class in C# and in C++.
Expandable IoC Container
Learn how to create a very small (less than 3kb) yet very expandable IoC container. I recently wrote the article Software Architecture in which I talked about the first "fix" to many frameworks and I think that such fix is usually required in many IoC containers. But even if some of them don't need any fix, I usually work in companies that don't like to use external code (aside from the .NET framework).
GetOrCreateValueDictionary - CodeProject
After discussing with a friend about concurrent value generation, without duplicates, I created a new . If you are interested in it, download the new sample, or read a brief explanation of the changes at the end of the article.
WriteableBitmap in Universal Apps
It seems that reading and writing pixel/color information from/to bitmaps is the most unstable thing in .NET. Windows Forms do it in a very specific manner. WPF do it differently. Silverlight do/(did, depending on how you think about it) differently again and finally, Universal Apps, which are mostly based on WPF and Silverlight principles, do it differently again.
PropertyPathObserver - A New Way of Creating Bindings - Portable
In the past I presented the MathBinding markup extension. I created it because I considered WPF's excessively complicated when I needed some simple math on top of a property. Then I tried to create the same for Universal apps, but I couldn't. I don't know if I didn't find the right documentation or if it is simply impossible to create a markup extension when developing Universal Apps. So, I started playing with different ways of doing Bindings.
Understanding and creating a .NET like List
A List is like a resizable array. The main points are: Surely there are other methods on the .NET implementation but I am not covering all the methods as many of them are there simply because it is good to have them. The real point is that a list works pretty similar to an array, but can be resized while an array can't (don't be fooled by the static method as it actually does a copy of the array instead of resizing one like the name suggests).
MathBinding - CodeProject
In this article I will present a WPF markup extension that allows users to declare bindings using complex math formulas. The article is divided in two main parts: The first part is probably what most developers will want, even those who don't have experience with WPF.
Fluent and Imperative Animations
See the Cyberminds57 animation - External Source and requires Silverlight 5 See a Shoot'em Up game made with this library - External Source and requires Silverlight 5. You can see a tutorial on how to use this library to write a game at Shoot'em Up .NET[^]. You can also contribute to this library using CodePlex. Click here to see that particular animation running (Requires Silverlight 5).
Infinite Maps (for games or similar)
I recently saw a news that super computers were used to create a really huge map, that could take 4 billion years to be explored completely. That’s big, huge… and I saw many people saying that it is actually magic. It is not magic. It’s pure science. Or better: It is magic. Every time something really big happens, it is magic for those who can’t understand what’s really happening.
Things that Developers aren’t Supposed To Do
I recently saw the post Your Developers Aren’t Bricklayers, They’re Writers and I must say that I loved the post. In this post there are references to things like “The best programmers are up to 28 times better than the worst programmers” and, even if this might be true for some cases, I am of the opinion that the best programmers simply can’t be compared to the worst ones. That’s because the worst developers will never get the job done and will probably destroy the work of the other developers.
Software Architecture - Examples
On the article Software Architecture I said that I usually start the architecture of applications by thinking only on how to solve a problem using the idea of a technology, not considering any limitations of actual implementations. Only later I try to chose a technology and in many cases decide to write my own because the existing ones don’t accomodate my needs.
Security Issues - Overview and Examples
Lately I am dealing a lot with security issues and, as I am thinking about security all the time, I decided to write this post. Yet, don’t expect me to talk about the newest cases. So, first, what is considered a security issue? I don’t have a perfect answer but maybe we can say that if anything in an application can be used in a manner that wasn’t expected and it can make you lose money or somehow cause you trouble, then it is a security issue.
Travelling Salesman - Genetic Algorithm
I recently published the article An alternative introduction to Genetic and Evolutionary Algorithms, in which I presented an Evolutionary Algorithm that's capable of finding some math formulas. The important traits there were the creation of populations, the selection of the best results when we don't have a satisfactory result and the reproduction with mutation.
Security Issues - Overview and Examples
Lately I am dealing a lot with security issues and, as I am thinking about security all the time, I decided to write this post. Yet, don't expect me to talk about the newest cases. So, first, what is considered a security issue? I don't have a perfect answer but maybe we can say that if anything in an application can be used in a manner that wasn't expected and it can make you lose money or somehow cause you trouble, then it is a security issue.
C++: Smart-pointers, "this" and callbacks
I usually write C# articles but lately I am dealing with C++ more often, so this post is about C++ (yet I keep some C# comparisons). It is all about a common but hard-to-find problem in C++: Smart-pointers, methods that keep a reference to the "this" instance and calling anything that can clear the smart-pointer and kill the object (usually callbacks) before we finish using any information of that variable. Simply put, the variable is not a smart pointer.
Things that Developers aren't Supposed To Do
I recently saw the post Your Developers Aren’t Bricklayers, They’re Writers and I must say that I loved the post. In this post there are references to things like "The best programmers are up to 28 times better than the worst programmers" and, even if this might be true for some cases, I am of the opinion that the best programmers simply can't be compared to the worst ones. That's because the worst developers will never get the job done and will probably destroy the work of the other developers.
Breaking Changes and Unity
In the post Design and Implementation Mistakes - Mostly .NET one of the most important points was the "program to interfaces, not to implementations", in the sense that we must not use something that's not documented simply because we saw the actual implementation or discovered it somehow (like the actual type returned when the signature shows an abstract type, if the result is singleton or not etc).
Deployment, SOA and Scalability
I recently saw a question in a forum about SOA (Service Oriented Architecture) and a very "strange" deployment strategy, where each web application had a copy of the same service instead of sharing the service. This question made me think about the scalability of SOA and about new deployment strategies (or better, old but rediscovered ones).
Software Architecture - Examples
On the article Software Architecture I said that I usually start the architecture of applications by thinking only on how to solve a problem using the idea of a technology, not considering any limitations of actual implementations. Only later I try to chose a technology and in many cases decide to write my own because the existing ones don't accomodate my needs.
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Paulo
Contact Paulo, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack