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.
Friday, October 4, 2024
10 Examples of Optional in Java 8
Why use SLF4J over Log4J for logging in Java? Example
Every Java programmers know that logging is critical for any Java application, especially server-side application, and many of them are already familiar with various logging libraries e.g. java.util.logging, Apache log4j, logback, but if you don't know about SLF4J, Simple logging facade for Java, then it's time to learn and use SLF4J in your project. In this Java article, we will learn why using SLF4J is better than using log4j or java.util.logging. It’s been a long time, since I wrote 10 logging tips for Java programmer,I don’t remember anything I have writing about logging.
Labels:
best practices
,
core java
,
logging
,
programming
Top 10 Coursera Courses and Certifications to Learn Web Development in 2024 - Best of Lot
Hello guys, If someone asked me 10 years ago about how to learn web development and get a job I would more likely say that you have to go to college and get your Bachelor’s degree and then try to get a job or internship. In short, it was only possible to become a web developer by spending years on education and thousands of dollars, now the internet has changed the game nowadays. These days many online platforms like Coursera, Udemy, Pluralsight, CodeCademy, and Educative appeared to the world allowing people to take online training courses in almost any industry and web development is one of them.
Labels:
coursera
,
courses
,
online resources
,
web development
Top 6 Courses to Learn IntelliJIDEA and Android Studio IDE for Java and Kotlin Programmers in 2024 [Best & FREE]
There is no doubt that IntelliJ IDEA is THE best IDE for Java development, even though Eclipse may still be probably used by more people because it's FREE, IntelliJ IDEA is the most feature-rich and complete IDE. The Android Studio, which is the official IDE for Android development in Java, is also based upon IntelliJ IDEA, which further cement its place as the IDE Java developer should learn. The only thing which stops many other Java developers and me from moving from IntelliJ IDEA in the past was the lack of resources. Since Eclipse was free from the start, there are tons of resources, like books, courses, and tutorials are available.
Top 5 Free Courses to Learn Kubernetes for Developers and DevOps Engineers in 2024 - Best of Lot
Hello guys, DevOps is becoming an essential skill in today's Programming and
Software Development world and Kubernetes is an important concept and tool for
DevOps engineers. It takes container-based deployment to another level and allows you to
manage it on the scale. You can use Kubernetes to scale your container
environment or let Kubernetes do all the work for you by leveraging its
auto-scaling feature. Many DevOps beginners think that Docker and Kubernetes
are the same but they are not.
Docker
provides a container to deploy your application and commands to interact with
those but container but Kubernetes is actually a container management
technology, which decides how many containers are needed and deal with other
management aspects.
Thursday, October 3, 2024
How to replace NULL with Empty String in SQL Server? ISNULL() vs COALESCE() Examples
We often need to replace NULL values with empty String or blank in SQL e.g. while concatenating String. In SQL Server, when you concatenate a NULL String with another non-null String the result is NULL, which means you lose the information you already have. To prevent this, you can replace NULL with empty String while concatenating. There are two ways to replace NULL with blank values in SQL Server, function ISNULL(), and COALESCE(). Both functions replace the value you provide when the argument is NULL like ISNULL(column, '') will return empty String if the column value is NULL.
Labels:
Microsoft SQL Server
,
SQL
,
SQL Interview Questions
Top 5 Courses to Learn Python 3 in 2024 - Best of Lot
If you are a Programmer or a Computer Science graduate and thinking of
learning Python in 2024, then you have come to the right place. In this
article, I am going to share some of the
best online courses to learn Python 3 in 2024. Python is one of the most
popular programming languages, and it's used in many domains, like
Web development, Automation,
Data Science,
Machine learning, etc. In recent years, Python has also become a default language for Data
Science and Machine learning Projects, and that's another reason why many
experienced programmers are learning Python in 2024.
10 Books Every Java Programmer Should Read - Best of Lot, Must Read
If you are a Java programmer and wondering what to read to improve your knowledge of Java and become a better Java developer, then you have come to the right place. In this article, I am going to share some of the best Java books ever written. In fact, this is my list of all-time great Java books. They have withstood the test of time and emerges as more and more successful years after years. It doesn't matter if you read them this year or reading them next year, you are always going to learn a lot, and that's why I call them all-time great books.
The OCAJP 1Z0-808 - Best Books and Mock Exams for Java 8 OCA Certification
From the last couple of months, I have been helping a few developers to prepare for Java 8 associate certification with exam code 1Z0-808, also known as OCAJP 8. From my experience, both for preparing for Sun certification and helping other developers to get Java certified, I can say that two keys to be successful in Oracle Java SE certification are choosing an excellent study guide/course and buying one or two top quality mock exam simulators. When I say success, it doesn't mean just passing the exam but scoring above 90% because passing score 65% is not very difficult to achieve and anybody can pass OCAJP 8 by just a couple of month of practice but to score 90% and above is not that easy, you need to prepare and prepare hard.
2 Books to Prepare Oracle Java Certification Exams - OCA and OCP Java SE 6,7, 8 OCPJP 8
There was a time when Sun Certification was very hot and programmers feel proud of being Sun Certified Java Professional(SCJP). After Oracle took over Sun in early 2010, it changed names of all the examination from SCJP to OCPJP or OCJP, and now OCA and OCP for Java SE 7 and Java SE 8. I see there is a lot of confusion among certification nowadays, but essentially they are of the same level at previous SCJP. Since Java gets new language features with every new release, subsequently a new certification title is introduced. I am not agreed with upgrading your Java certification with every release, it doesn't make much sense to me, but many programmers prefer to get certified and keep it updated.
Labels:
books
,
core java
,
Java Certification OCPJP SCJP
,
online resources
Top 10 Free Java Programming Books, EBooks and PDF for Beginners and Experienced Programmers
Who doesn't like free stuff? Well, I do like and many Java programmers like me simply love free Java books, eBooks, and PDFs. Fortunately, the Internet is full of free books and eBooks but unfortunately, many of them are of not good quality. Most of the eBooks which are freely available either are sample chapters of popular Java programming books or they are simply old and out-of-date. In my last article, I have shared a lot of such books and the feedback was that most of them, even though they are good in the past, have simply not up to the mark. The search goes on and while browsing the net a couple of days back I hit the jackpot when I found these free Java books from O'Reilly.
Wednesday, October 2, 2024
5 Reasons to Use Composition over Inheritance in Java and OOP - Example
Favor composition over inheritance is one of the popular object-oriented design principles, which helps to create flexible and maintainable code in Java and other object-oriented languages. Many times I have seen people suggesting use composition instead of inheritance, in fact, my favorite books like Head First Design Patterns also advocate this design principle. The Head First books have their own way of explaining, why composition is better than inheritance, and though it's long it's quite interesting and informative. It was the first chapter of this book, which helped me a lot in understanding this key OOP concept.
Labels:
best practices
,
core java
,
design patterns
,
programming
Difference between char, varchar, nchar and nvarchar data types in SQL Server? Example
What is the difference between char and varchar in SQL, followed by nchar and nvarchar, is one of the popular SQL interview questions, and surprisingly not every programmer knows this basic difference. If you go with the name, which you should, then you can figure out that char is a fixed-length data type while varchar should be a variable-length data type. Though all char, varchar, nchar, and nvarchar are used to store text or String data there are subtle differences between them. As I said char is fixed length, which means a variable or a column like Zipcode char(10) will take only 10 bytes to store data, including space.
Top 5 Books to Learn SQL and Database Design for Programmers and DBAs - Best of Lot
The database design and modeling are one of those topics which rarely get the attention they deserve, especially at the start of the project, but once things have gone out of hand, then everybody talks about them. Comments like - this database is designed poorly, the schema is not performing well, you cannot add a new column easily, etc. becomes very common. The most problem with database design is that it is mainly done by application developers like Java or C++ developer who knows SQL, but they are not the expert on how to design tables and schema.
Top 6 Courses to learn D3.js for Data Visualization with JavaScript in 2024 - Best of Lot
If you have done any Data visualization work then you might have heard about D3 - one of the excellent JavaScript libraries, which allows you to create beautiful interactive data visualization for the web. It's prevalent among Data Scientists and Data Analysts who often need these visualizations and charts to present data insights to stakeholders and business people. If you are not familiar with D3, no need to worry because, In this article, I am going to share some of the awesome courses to learn D3 in 2024. These courses teach you the basics of data visualization with D3 by binding data to a web page’s elements and customizing the elements based on that very data. You will also learn how to build different kinds of charts like Bar charts, Pie charts, Mind maps, etc using D3.js
Labels:
courses
,
D3
,
Data Science
,
Data visualization
,
JavaScript
,
online resources
Subscribe to:
Posts
(
Atom
)