preface

Only a bald head can be strong.

Welcome to our GitHub repository Star: github.com/ZhongFuChen…

I don’t know if you had this question when you were a student: how much difference is there between the project that the company does and the project that you practice in school? I used to practice some projects with videos in school, but I always felt that things made by the company would be much more difficult. I didn’t know the difference from the real projects of the company.

In general, I have been an intern for almost half a year. Please talk about the difference between the company’s project and my own project, welcome to add.

A, the difference between

Most of the projects we practice in the video are taught by the lecturers in local coding to explain the whole development process of a project, and what is the first thing we do when we go to the company? Clone the project locally.

There are two differences:

  • Often, a company does not develop a project from scratch. The framework and code of the project are already written. What we need to do more is iterate on the project (or fix bugs in the project).
  • A project often has several people working on it, which is a sure way to use a version management tool (SVN/Git). Therefore, it is best to learn how to use Git/SVN tools in advance before going to the company to do projects

For example, when you use Git, you create a new branch to change your code, and then merge it with the master branch.

Ok, now that the project is local, should we start the project locally? Ask a colleague. In the company to do projects, generally divided into several environments

  • Online (currently available to users)
  • Test (after writing the function, first see if there is any problem in the test environment, and then release it to the online environment.)
  • . Etc. (the name may be different, but the code that can’t be written locally just runs on the line)

Sometimes the environment is so complex (systems depend on each other) that it is difficult to launch a Clone project locally, or the data gap between the local and online data is too large. As a result, there may be times when you don’t need to start the project locally.

So the question is, how do I debug the code I’ve written? We can do this by pushing locally written code into the test environment, and then remotely connecting locally to the test environment to debug it.

Also, when we’re doing our own projects, after a try-catch, the habit might be e.prinintstackTrace ();

But the company’s projects won’t have e.prinintStackTrace (); The existence of such code. Because this printed error message has no date, grade, etc., it is not easy to analyze.

It is common for companies to write error information (or useful information) to logs.

  • Such as:LOG.error("send java3y article failed, {}", e);

So, there is a general problem, we go to the machine, check the log information is how. And the machine on the line, not directly connected, will pass through a fortress machine. What does a Fortress do?

SSH XXXXIP to the fort every time you log in to the online machine, and then enter the online machine IP connection to the fort, which is really troublesome. So the big guys would write scripts that would automatically log in to the Fortress and type the IP directly online

So, we logged on to the Fortress, and then we hooked up to the machine and went to check the logs. What about viewing logs?

  • directlycat console.logOh, what? When do we have to find out?
  • vim console.logWhat, I want to find out how to operate on Vim based on a certain keyword? iflogThe file is too big and vim is too blocked to open.
  • So, you still need to learn how to use inux commands
    • www.cnblogs.com/xiashan17/p…
    • Blog.csdn.net/qq_31617637…

Another point is that development in the company must apply for permission to operate the database/machine/various resources. Unlike our personal development of various root permissions, databases of various DDL/DML play casually.

DML/DDL database operations need to apply for permission, publish code to online also need to apply for permission, want to go online to view logs on the machine also need permission…..

The last

Conclusion:

  1. Version control tool
  2. Remote connection Debug Debugging
  3. No longer usee.printStackTrace();, butlog.error()To replace the
  4. All kinds of permissions need to be applied for and approved

Happy to export dry Java technology public number: Java3y. The public account has more than 200 original technical articles, massive video resources, beautiful brain map, attention can be obtained!

Think my article is good, give it a thumbs up!