In today’s web development landscape, HTTPS isn’t just for production—it’s a necessity for local development and testing. Modern browsers enforce strict security policies, and features like authentication cookies or service workers require HTTPS even during development. Using localhost works, but it often comes with hidden restrictions. Instead, adopting a dedicated local development domain (like .test …
Author Archives: timdinh
Embracing Clean Code: Why Quick Hacks Are OK—But Only Temporarily
Introduction If you’ve been coding for more than a minute, you know the feeling: you’re under pressure to get a feature out ASAP or fix a critical bug. In these scenarios, writing quick-and-dirty code can seem like the fastest way to save the day. But here’s the catch: leaving that messy code forever will come …
Continue reading “Embracing Clean Code: Why Quick Hacks Are OK—But Only Temporarily”
Do not returns null
If you create a method that return a list and you don’t have data, always return empty list instead of null. This would allow the caller to iterate the list without checking. As an example, consider the 2 blocks of code below, which is better? Having said that, if you write caller side code and …
C# Exception Handler
Given the code below, how would you add exception handling in your code? Some developer would handle like this While other do something like this Which style is more readable?
Startup configure method
Did you know that you can inject any object in the Configure method of your startup class? For example if you want to inject ICustomer.
Date and time arithmetics
One of our developer wrote this code He is combining the date and time but in a clumsy way. What he’s doing is composing a string then convert it to DateTime. A lot of junior developers do this way for some reasons. What a lot of developers tend to forget is that using date and …