Chapter 16: Best Practices

This chapter will go through some points that you should know if you want to become a full stack developer, or if you want to progress further in your software development career. We will also go over some best practices that are worth keeping in mind when you're working in the field of software development.

In this chapter, we will answer the following questions:

  • What kind of technologies should you know?
  • Which best practices are important to you?

What to learn next

To become a full stack developer, you have to be able to work with both the backend and the frontend. That sounds like quite a challenging task, but if you focus on the right things and don't try to master everything, it is possible. Nowadays, the technology stack available is huge, and you might often wonder what you should learn next. There are multiple factors that can give you a few hints about where to go next. One way to find out is to browse job opportunities and see which technologies companies are looking for.

There are multiple approaches, and no single right path, when it comes to setting out on learning new technology. Studying a course in web programming is a really popular starting point, and it gives you the basic knowledge to start the learning process. The process is never-ending because technologies are developing and changing all the time.

An understanding of the following technologies is necessary if you want to become a full stack developer. This is not a complete list, but it is a good starting point.

HTML

HTML is the most fundamental thing that you should learn in web development. You don't have to master all the details of HTML, but you should have a good basic knowledge of it. HTML5 introduced a lot of new features that are also worth learning.

CSS

CSS is also a very basic thing to learn. One good aspect is the fact that there are lots of good tutorials available for both HTML and CSS. It is worthwhile learning about the use of some CSS libraries, such as Bootstrap, which is widely used. CSS preprocessors, such as SASS and Less, are also worth learning.

HTTP

The HTTP protocol is key to developing web applications and RESTful web services. You have to understand the basics of HTTP and know its limitations. You should also know what kinds of methods exist and how to use these with different programming languages.

JavaScript

JavaScript is definitely a programming language that you should master. Without JavaScript skills, it is really hard to work with modern frontend development. ES6 is also good to learn because it makes JavaScript coding cleaner and more efficient.

A backend programming language

It's hard to survive without knowing a few programming languages. If JavaScript is used for frontend development, it can also be used in the backend with Node.js. That is the benefit of Node.js; you can use one programming language in both the frontend and the backend. Other popular languages for backend development are Java, C#, Python, and PHP. All these languages also have good backend frameworks you can use.

Some frontend libraries and frameworks

In this book, we used React.js in the frontend, which is currently a popular option, but there are many other options that are also good, such as Angular and Vue.js.

Databases

You should also know how to use databases with your backend programming language. The database can be either a SQL or a NoSQL database, and it is good to know both options. You should also know how performance can be optimized with the database you are using and the queries you are executing.

Version control

Version control is something that you can't live without. Nowadays, Git is a really popular version control system, and it's really important to know how to use it. It is also worthwhile getting familiar with repository management services, such as GitHub and GitLab.

Useful tools

There are also many different tools that can help to make your development process more efficient. Here, we are just mentioning a number of tools that might be useful for you. Gulp.js is an open source JavaScript toolkit to automate your tasks in the development process. Grunt is similar to the JavaScript task runner, which you can use to automate your process. webpack is a JavaScript module bundler that creates static assets from your dependencies. create-react-app, which we used in the previous chapters, actually uses webpack under the hood.

Security

You have to know the basics of web security and how to handle these issues in web development. A good way to start learning is to read the OWASP Top 10 project (https://owasp.org/www-project-top-ten/). Then, you have to learn how to handle these issues with the frameworks you are using.

Best practices

Software development always involves teamwork, and therefore, it is really important that everyone in a team uses common best practices. Here, we will go through some basic things that you have to take into account. This is not the whole list, but we will try to concentrate on some basic things that you should know.

Coding conventions

Coding conventions are guidelines that describe how the code should be written in a specific programming language. It makes the code more readable and easier to maintain. Naming conventions define how variables, methods, and more should be named. Naming is really important because it helps developers understand the purpose of a certain unit in a program.

The layout convention defines how the structure of the source code should look – for example, indenting and the use of spaces. The commenting convention defines how the source code should be commented on. Quite often, it is good to use some standardized ways of commenting, such as Javadoc with Java.

Most software development environments and editors offer tools that help you with code conventions. You can also use code formatters, such as Prettier for JavaScript.

Choosing the proper tools

You should always choose the proper tools that best fit your software development process. This makes your process more efficient and also helps you in the development life cycle. There are many tools to automate tasks in the development process, and it is a good way of avoiding mistakes that occur in repetitive tasks. Of course, the tools you use will depend on the process and the technologies you're using.

Choosing the proper technologies

When starting to develop an application, one of the first things to decide is which technologies (programming language, frameworks, databases, and so on) you should use. Quite often, it feels safe to select technologies that you have always used, but that's not always the optimal choice. The application itself normally imposes a number of limitations in relation to the technologies that you can use.

For example, if you have to create a mobile application, there are several technologies that you can use; but if you have to develop a similar application that you have made many times, it might be wiser to use technologies that you are already very familiar with.

Minimizing the amount of coding

A common good practice is to minimize the amount of coding. This is really sensible because it makes code maintenance and testing much easier. DRY (short for Don't Repeat Yourself) is a common principle in software development. The basic idea of DRY is to reduce the amount of code by avoiding repetition in it.

It is always a good practice to split your source code into smaller components because smaller units are always easier to manage. Of course, the optimal structure depends on the programming language you are using. One good statement is also Keep it Simple, Stupid (KISS), which should guide you in the right direction.

Summary

In this book, we covered the technologies that you should be familiar with if you want to become a full stack developer. We started to develop our backend using the Spring Boot framework. We also learned to create the REST API and how to secure your backend. Next, we started to learn the basics of the React frontend library. Then, we developed a frontend to our existing backend using React. We also learned the basics of unit testing and how to deploy your frontend and backend.

Questions

  1. Why are coding conventions important?
  2. Why should you try to avoid excessive coding?
  3. Why are naming conventions important?

Further reading

Packt has other great resources available for learning about full stack development. These are as follows:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.142.144