Hello all, if you are in software development then you know that creating an application is easy but creating a maintainable application that can pass the test of time in production is rather difficult and that's the main reason experienced Sofware developers are paid higher salaries compared to many other jobs. In this article, I am going to share with you some tips on creating maintainable Java applications which will help you not just in the new year, but also in all the coming years in your software development career. One aspect of development, which is often overlooked by developers is to create applications that are both easy to maintain and support. Since software spends 90% of its lifetime in maintenance mode, it's very important that your application is easy to configure, support, and maintain.
Ads 970x90
Tampilkan postingan dengan label best practices. Tampilkan semua postingan
Tampilkan postingan dengan label best practices. Tampilkan semua postingan
Jumat, 12 November 2021
Sabtu, 06 November 2021
Does Standard Column Width of 80 On Coding Make Sense in Modern Era of Big Monitors?
One of the oldest coding practices is to keep line width 80, and many of us follow it blindly but have you ever thought about why we have this practice in the first place? I believe it was to make your code more readable in the age of small monitors so that the whole content can fit on the screen, or it might have originated from the age of punch cards, which was used to be 80 columns wide. This sounds reasonable when we think about those old days but do you think this rule makes sense now? We are now living in the age where most of the developers have got large monitors, which can show up to 180 characters, doesn't this is wastage of precious monitor space? It also makes your code unnecessary long, than it actually is.
Selasa, 19 Oktober 2021
10 Examples of Optional in Java 8
Null is bad, it can crash your program. Even its creator called it a billion-dollar mistake hence you should always try to avoid using nulls whenever you can. For example, you should not return a null String when you can return an empty String, similarly never return null collections when you can return an empty collection. I have shared many such tips in my earlier article, 10 tips to avoid NullPointerException and my reader liked that a lot. But, I wrote that article a couple of years ago when Java 8 was not around and there was no Optional, a new way to avoid NullPointerException in Java, but, things have changed now.
Selasa, 27 Juli 2021
Avoid Using System.exit() on Java Web Application - Best Practice
I have recently come across a code snippet, where the programmer was using System.exit() if the application failed to acquire necessary resources after a couple of retries. His reasoning was that the application cannot function if essential resources like the database are not available or there is no disk space to write records in the File system. Ok, I hear you; but System.exit() in Java Web application, which runs inside either web server or application server, which itself is Java program is not a good idea at all. Why? because invoking System.exit() kills your JVM, invoking this from Tomcat or Jetty, will not only kill your application but the most likely server itself. This can be potentially dangerous if that server also hosts other critical applications, which is not uncommon at all.
Selasa, 24 November 2020
How to write Thread-Safe Code in Java
thread-safety or thread-safe code in Java refers to code which can safely be used or shared in concurrent or multi-threading environment and they will behave as expected. any code, class, or object which can behave differently from its contract on the concurrent environment is not thread-safe. thread-safety is one of the risks introduced by using threads in Java and I have seen java programmers and developers struggling to write thread-safe code or just understanding what is thread-safe code and what is not?
Sabtu, 18 April 2020
10 Things to Remember while doing Database Server Migration
Hello guys, recently, I have to work on a high profile project which involves migrating a live database from one server to another server as part of their data center exit program. This was one of the critical projects to pull off because we can't afford any mishap or data loss or production outage. There are a lot of things that I learned and would like to share with you guys. All these lessons not just apply to migrate databases like Microsoft SQL Server, Oracle, or MySQL database from one server to another but to any production process, you are migrating from another server. These are the things we learn from experience but as I have said in the past, you can only learn a few things