Null References: The Billion Dollar Mistake
Null
is clearly evil. We as human tend to forget to check null
, and boom… crash!!!
Null
is clearly evil. We as human tend to forget to check null
, and boom… crash!!!
Exceptions are a very common concept in most of languages nowadays. In this article we will discuss why exceptions are needed, checked vs. unchecked exceptions, and why C# doesn’t have checked exceptions.
This article is about my personal explanation of the famous design patterns: Model View Controller (MVC), Model View Presenter (MVP), Presentation Model (PM), and Model View ViewModel (MVVM).
Builder Pattern and Factory Pattern are pretty similar in a way: both of them encapsulate the details of object-creation processes. However, in cases there are many complicated processes to create various representations of objects, and those processes share a common trait, Builder Pattern is the better choice.
Let’s say we have two processes to build a house: Asian process and European one. We will start with Factory Pattern and gradually adapt it to Builder Pattern. A possible implementation of Factory Pattern could be:
Object persistence – for example, saving/loading objects to/from a database – is easy, especially when using an ORM framework. It is easy because it breaks principles of OO design.
Have you ever hesitated between these two implementation of the Factory Pattern:
In recent years, Entity-Component System (ECS) has been recognized as the most notable architecture for game development. There are many good articles about the architecture that can be found on the Internet, some of them are:
Wikipedia defines imperative and declarative programming as:
Every line of code that uses the new
keyword may violate the Dependency Inversion Principle (DIP). Indeed, a class after new
must be always concrete:
Trong phần trước chúng ta đã tìm hiểu về hệ tọa độ đồng nhất. Trong phần này, trước khi đi vào các phép biến đổi, chúng ta sẽ nói một chút về không gian xạ ảnh (projective space).