Sunday, October 22, 2017

4 Common Mistakes For Beginner Java Programmer

One of the most complete programming language available is Java. Among its most essential characteristics: it’s concurrent, object-oriented and multipurpose; and designed so that its code can run from any machine or device, and its syntax is derived directly from the C and C ++ languages.

Since its official appearance in 1995 by Sun Microsystems, it has had many derivations according to its usage environment, extending more recently to the mobile and web applications, serving its (although failed) philosophy of running on every possible device in a single unique interface as a boost for the Android platform.

Given its versatility, it is currently widely used in various fields such as business, academic, scientific or business, among others. Also, many programmers prefer their syntax given their similiud with C and C ++, which makes them easier for them to learn and implement.

But, as in all areas of life learning, many programmers who are just getting started in this activity make some mistakes in code implementation when building their applications. Some of them will be explained below:

1. It must be understood that in Java, all are objects:

Even the main application code is an object of type void (). The programmer or student should be clear about the notions of object oriented programming (OOP) if he wants to understand the implementation to follow in Java, otherwise concepts such as inheritance, polymorphism, abstract classes or class instances will not be clearly understood.

2. Syntax errors:

Even this has been a reason for internet jokes, as one of the anguish that young programmers suffer when it comes to implementing. The termination commas of the statements (;), or the comparison symbols in the If (==) conditionals, are examples of cases for the Java virtual machine (JVM) not to interpret a code fragment and that waste time looking for where the error is. Must be careful with these details.

3. The NullPointerException error:

Some define it as the curse of programmers in Java. NullPointerExceptions are logic errors caused when a program attempts to access methods or attributes in a reference that is null. If our object has not been initialized or has been set to null with the = operator, then the method call or access to one of its attributes is invalid. This practice can be avoided by teaching from the programming logic with algorithms or pseudocodes the initialization of the variables to be used.

4. It’s necessary to know well which platform to choose according to the type of solution:

Although the Java standard is multipurpose, the same language has different forks or specializations for various implementations; for example, for web programming, there are solutions such as Javascript to be integrated within the HTML code, or JSP for creating dynamic pages in the style of PHP. Similarly, for mobile deployment for Android apps, there are GUI environments like Android Studio or PhoneGap. The mistake that is commonly made is to ignore those details and want to develop or integrate Java code that should go in one type of specific application in another, and is where many are wrong. It is necessary to document beforehand before proceeding.

No comments:

Post a Comment