Current location - Quotes Website - Excellent quotations - I really want to learn JAVA well, but I always feel that time is too short. Learning Java in universities feels like a formality, involving all aspects. What should we do?
I really want to learn JAVA well, but I always feel that time is too short. Learning Java in universities feels like a formality, involving all aspects. What should we do?
The Road to Java Learning: No detours are shortcuts (1)

Author: ∣ Source: China Java Technology Network ∣ Original address ∣2006-3- 14.

0. Introduction In the tutorial system of ChinaITLAB, the author found that the most frequently asked question was "How to learn programming? How to learn Java? " . If you answer many similar questions, you will inevitably feel bored, so you have the idea of writing this article. If someone asks a similar question again, I can tell him (her) to invite you to learn Java. I have read Sleepless in Java written by Mr. Cai in Taiwan Province Province, and some articles, such as The Method of Learning Java, make us really * * *, hence the title of this article. The road of software development is full of thorns, challenges and hopes. Java learning is the same, there is no shortcut. It is unrealistic to dream of being enlightened by five ducks like the virtual bamboo in Eight Dragons and easily gaining a skill. I cry to the sky every day, "God, please give me a sunflower book." I don't know, even if you get the sunflower collection, you may not become a "Dong Fangbubai" except for your own embarrassment, but the probability of becoming a "western loser" is higher. "If you don't take a detour, it is a shortcut", which is not unreasonable in the Buddhist scriptures.

1. How to learn programming? Java is a platform and a programming language. How to learn programming well is not only applicable to Java, but also to other programming languages such as C++. Some programmers think there is no difference between Java and C, so just use it. Why can they reach such a state? I think it's because there are similarities between programming languages. I understand the essence of programming, so I can do everything naturally. Of course, how to learn programming also has a lot to do.

1. 1 Cultivating interest is the motivation to keep you going. If you just write programs as a means of making a living, you will live very tired and feel sorry for yourself. Pay more attention to some interesting things in the industry and think more about Gates. I'm not advocating daydreaming every day, but do you think it's interesting that people don't have dreams? Perhaps, like many local farmers, they play mahjong, drink kungfu tea and worship the God of Wealth. There are tens of thousands or more accounts every month, creating a "profit-seeking class" out of thin air. Do you think this is the smell? If you have time to visit some programmers' forums, you will find that they are actually optimistic and humorous, and there will be sparks of wisdom from time to time.

1.2 Choose the programming language carefully. Men are afraid of going into the wrong business, while women are afraid of marrying the wrong person. Beginners need to be careful when choosing programming languages. Software development is not only about mastering a programming language, but also requires a lot of other background knowledge. Software development is not limited to a few fields, but has penetrated into almost every corner of all walks of life. If you are interested in hardware, you can learn C language/assembly language and enter the field of hardware development. If you are familiar with the knowledge and network of telecom industry, you can spend more time on C/C++ and enter the field of telecom software development. If you are familiar with the operating system, you can learn C/Linux and so on, laying the foundation for Linux kernel development/driver development/embedded development. If you want to get involved in the most widely used application software development (including e-commerce e-government system), you can choose J2EE or. Net, even a combination of lights. Each field needs different background knowledge. Doing application software requires familiarity with databases and so on. In short, you need to choose the right programming language according to your own characteristics.

1.3 Be down-to-earth, fast-food learning is not advisable to share a story first. A child likes biology very much, and wants to know how those butterflies come out of pupa shells and become butterflies to fly. Once, he went to the grassland and saw a pupa, so he took it home. Then he watched. A few days later, there was a crack in the pupa. He saw the butterfly inside struggling and wanted to scratch the pupa shell and fly out. This process lasted for several hours, and the butterfly struggled very hard in the pupa, but it couldn't get out. The child couldn't bear to look at it and thought it was better for me to help him, so he picked up scissors and cut them on the pupa to let the butterfly break out of the cocoon. But after the butterfly came out, it became bloated and could not fly because its wings were not strong enough. The lesson of this story is: haste makes waste. Impetuousness is the most common mentality of modern people. Who can blame? Perhaps it is because poverty has lagged behind for so many years. Just like the Great Leap Forward, everyone wants to stride into the capitalist society. Nowadays, software companies, customers, governments, schools, training institutions and so on are full of impetuousness. Take the IT training industry in Shenzhen that I am familiar with as an example. In fact, some people flaunt that "100% jobs will be obtained through training", but in fact many students have signed up, which is simply contempt for programmers all over the world. If the social environment is like this, we can't change it, only ourselves. The tranquility of the city center is precious. Many beginners of C++/Java have developed a Hello World program with VC/JBuilder without learning. They rushed to announce to the world that "I can develop software" and wrote "proficient in VC/Java" on their resumes. As a result, I went to the software company for an interview, either being sent away three or two times or being refuted to pieces. I didn't know until I hit a wall everywhere. I picked up C++ Programming Thought and Java Programming Thought and studied them seriously. If I know this, why should I know it? "Pay attention to simplicity and convenience now, and the road will be long in the future", which seems to be an exhortation in Buddhist scriptures.

1.4 Practice more and practice faster. In Peng Duanshu's Disciples Rules, there are stories of poor monks and rich monks. Once upon a time, there were two monks on the border of Sichuan. One is poor, the other is rich. One day, the poor monk said to the rich monk, "I'm going on a pilgrimage to the South China Sea. What do you think? " The rich monk said, "It is thousands of miles away from the South China Sea. How do you get there? " The poor monk said, "I just want a water bowl and a rice bowl." The rich monk said awkwardly, "I planned to buy a boat to the South China Sea a few years ago, but I haven't made it yet. You'd better not go! " A year later, the rich monk is still raising money to rent a boat, but the poor monk has returned from a pilgrimage to the South China Sea. This story can be interpreted as: anything, once considered, should be on the road immediately, don't wait until it is ready to do anything. If you are ready to consider things before you go on the road, others may beat you to it. Software development is an engineering discipline, focusing on practice. It is fundamentally wrong for software developers to say that "a gentleman talks but doesn't do it". They advocate "first strike is strong", but don't be afraid. Most of them are gentle and not violent, although sometimes they look like "Bill Gates". Some senior experts believe that the secret of learning programming is: programming, programming and reprogramming. I deeply agree. Not only should we practice more, but we should also practice quickly. When we are reading a book, don't wait until you fully understand it before typing the code. Instead, we should code while reading. The various situations in which the program runs can make you grasp the knowledge points faster and more firmly.

1.5 Multi-reference program code is one of the most important achievements of software development, which permeates the thoughts and souls of programmers. Many people were moved by the sad love story in The Legend of the Sword and the Chivalrous Man, and the tragic ending was even more beautiful. Why did it end in tragedy? It is said that the programmer who wrote the legend of the sword and the chivalrous man was lovelorn and arranged such an ending. He put his feelings into the game, but it made many sword fans sigh. Refer to many code examples. For Java, there are references [4.3], the source code of API classes (src.zip file in JDK installation directory), and you can also study some open source software or frameworks.

1.6 strengthening English reading ability is not necessary for learning programming, but you can't do it at all. At least things like Java API documentation (reference [4.4]) should be understandable, even guessing and confusing; Open a "Kingsoft PowerWord" next to it. The more you watch, the more skilled you will become. Learn English while learning Java, kill two birds with one stone. In addition, many softwares need to be downloaded from English websites. You should be able to find them. These are the most basic requirements. Good English is of great help to your study. If you speak English well, you have a better chance to enter the management, and then you can become a "pickpocket" who exploits programmers.

65438+7000 people have to ask others. When I solved students' problems in the online tutoring system of ChinaITLab online school, I found that most students can solve them with a little thinking. Before consulting others, you should answer the following questions. Did you search for a solution to the problem on Google? Have you checked the Java API documentation? Have you checked the related books? Have you ever written code tests? If the answer is "yes" and the solution has not been found, it is not too late to ask others. You know, the ability to think independently is very important to you. You know, programmer's time is precious.

1.8 Read more good books, including Yan Ruyu. Bill? Gates is a well-read man. Although he didn't finish college, at the age of nine, Bill? Gates has read all the encyclopedias, so he is proficient in astronomy, history, geography and so on. Gates is not only the richest man in money, but also the richest man in knowledge. I often recommend books to students when I give them classes. Later, some students couldn't bear to complain, "God, when can I finish reading so many books?" And "learning software development makes me feel like a thief." At this time, my answer is generally "don't worry, when shall I show you my study?" Up to now, the money spent on technical books every month is in 400 yuan, and it is only at a medium level among software developers. " The student fainted on the spot. (Note: these students are just learning software development) Good books in the field of Java development will be specially commented in another article by the author. This article can be used as a companion to this article.

1.9 If you use the right tools, you must sharpen them first. Software development includes requirements collection and analysis, building use case model, building analysis and design model, programming implementation, debugging program, automatic testing, continuous integration and other activities. Without the help of tools, it can be said that it is impossible to move forward. Tools can improve the development efficiency, make the software quality higher and have fewer bugs. A weapon that combines hands. The realm of flying flowers picking leaves can hurt people is very high. It's almost impossible to win without pushing. You have a sword in your hand and a sword in your heart. In another article, the author will specifically explain how to choose the right tools (this article can also be used as a companion to this article).

2. The learning route of software development has been Confucianism for more than two thousand years. The golden mean goes deep into the bone marrow. It is not the doctrine of the mean, but finding the correct route and law of learning software development. As far as the career planning of software developers is concerned, we can roughly divide it into three stages: software engineer → software designer → architect or project management division. Soldiers who don't want to be marshals are not good soldiers, and programmers who don't want to be architects or project management division are not good programmers. We should try to go up. Let's first sort out the main technologies that need to be learned to develop application software.

A. Basic theoretical knowledge, such as operating system, compilation principle, data structure and algorithm, computer principle, etc. , are not unimportant. If you don't want to be a computer scientist, you can adopt the principle of "learning when necessary".

B. A programming language, now basically an object-oriented language, Java/C++/C# and so on. If you do WEB development, you have to learn HTML/JavaScript and so on.

C. A methodology or idea is now basically an object-oriented idea (OOA/OOD/ design pattern). The resulting component-based development CBD/ AOP and so on.

D. Relational databases, such as ORACLE/SqlServer/DB2/MySQL, etc.

E. JBuilder/Eclipse/VS.NET, an IDE integrated development environment to improve productivity.

F. A UML modeling tool, modeled with ROSE/VISIO/ pen.

G. software process, RUP/XP/CMM, etc. Many activities of software development are organized through software process, which makes the development process professional and standardized. Of course, there are other software engineering knowledge.

H. understand project management, architecture and framework.

The correct route should be: B → C → E → F → G → H. There are still some points to be added:

1). What A and C need to add is to gradually understand programming theory and thinking in practice. Although new technologies are constantly emerging, the update speed is dazzling; But the change of programming theory and thinking is very slow. Mastering programming theory and thinking will give you a clear feeling. At present, the object-oriented thought is quite critical and one of the powerful technologies. You need to put more time into it, and the return will surprise you.

2). For the database, it is autonomous learning, so the timing is up to you.

3) Programming language is the main line of learning software development, and the rest are auxiliary lines.

4). Software engineers focus on B, C, E and D; Software designers pay attention to B, C, E, D and F; Architects focus on c, f and h.

3. How to learn Java?

3. 1 Java learning route

3. 1. 1 Basic grammar and Java principles are the foundation, and the foundation is unstable, just like building a skyscraper in the sand, which is quite dangerous. The same is true of learning Java. You must have a solid foundation, so that you can master J2EE and J2ME. It is a good way to take the SCJP (Java programmer certified by Sun Company) exam. One of the reasons is that you will study harder in order to pay the exam fee of 1200 yuan. Another reason is that the SCJP exam can lay a solid foundation, which requires you to be as familiar with the basic knowledge of Java as JDK. But you must not think that just because you have passed SCJP is great, you can win the favor of software companies and get a high salary. This idea is also very dangerous. Getting the "real" SCJP can only prove that your foundation is passable, but there is still a long way to go before the actual development.

3. 1.2 OO After understanding and mastering the basic syntax and operating principle of Java programs, you can realize the object-oriented thinking in the Java language. Object-oriented is a methodology; It is a programming idea independent of language; It is the basis of CBD component-based development; It belongs to one of the strong technologies. When you need to switch to other object-oriented languages because of your work in the future, you will feel particularly familiar and kind, and learning is as simple as drinking cold water.

The basic process of developing with object-oriented thinking is:

● Investigate and collect requirements.

● Establish a use case model.

● Identify the analysis classes and the static and dynamic relationships between classes from the use case model, so as to establish the analysis model.

● Refine the analysis model into a design model.

● Implemented by specific technology.

● Testing, deployment and summary.

3. 1.3 learning basic API when developing software, not all functions need to be realized, which is the classic sentence "there is no need to reinvent the wheel." We can use ready-made classes, components and frameworks to build our applications. For example, SUN Company has written many classes that realize some underlying functions, as well as the classes included in the JAR file we downloaded. We can call the methods in the class to complete some functions or inherit them. So what methods are provided in these classes for us to use? What are the number and types of parameters of this method? Does the constructor of the class need parameters? It is impossible for an engineer of Sun Company to make an international call or even travel across the ocean to tell you how to use the class he wrote. They can only provide us with documents. Java DOC document (Reference 4.4) is such a document, which can be said to be a communication document between programmers. A basic API refers to a class that implements some underlying functions, such as string processing/input/output and so on. We also call it class library. One way to get familiar with API is to look up Java DOC document (Reference 4.4), and the other is to use the code prompt function of IDE such as JBuilder/Eclipse.

3. 1.4 Learning specific APIs Java involves a wide range of fields. Different fields have different APIs, and no one is familiar with all APIs. For ordinary people, they are only familiar with the API to be used in their work. If you do interface development, then you need to learn APIs such as Swing/AWT/SWT; If you develop online games, you need to have a deep understanding of network API/ multimedia API/2D3D, etc. If you are doing WEB development, you need to be familiar with APIs such as Servlet. In short, you need to choose to learn a specific API according to the needs of your work or the development direction of your interests.

3. 1.5 Use of development tools When learning basic grammar and basic object-oriented concepts, we recommend using Editplus/JCreator+JDK from the perspective of training language ability. At this time, don't rush to get into the integrated development environment such as JBuilder/Eclipse, so as not to pay too much attention to the powerful functions of IDE and distract attention from Java technology itself. After this stage, you can get familiar with the IDE. Programmers' daily work includes many activities, such as editing, compiling, debugging, unit testing, version control, maintaining model and code synchronization, and updating documents. Almost every activity has special tools. If you use these tools independently, you will be miserable. You need to switch constantly on the taskbar full of tools, which is inefficient and error-prone. In JBuilder, Eclipse and other IDE, editors, compilers, debuggers, unit testing tools JUnit, automatic building tools ANT, version control tools CVS, DOC document generation and update have all been automatically integrated, even UML modeling tools can be integrated, and rich wizards are provided to help generate framework codes, which makes our development easier. It should be said that the development trend of IDE is to integrate almost all tools used in software development. From the perspective of development efficiency, using IDE is the only way, and it is also a milestone in the transition from a student to a professional programmer. Ides used in Java development mainly include Eclipse, JBuilder, JDeveloper, NetBeans and so on. Eclipse and JBuilder have the largest market share. JBuilder is the overlord of Java integrated development environment in recent years. It was developed by Borland Company, which is highly praised by programmers. In the smoke-filled Java IDE war, JBuilder beat IBM's Java vision era with its rapid version update and made great contributions. IBM has been unprofitable in Visual Age for Java, so it simply contributed to the open source community and became the predecessor of Eclipse. It's really called "another village with a bright future". Eclipse, reborn from the ashes, has won the favor of programmers (including almost all hardcore programmers) with its open plug-in extension mechanism and free open source, and has great development potential.

3. 1.6 learning software engineering for small projects, you may feel that software engineering is unnecessary. As the project becomes more and more complex, the necessity of software engineering will be reflected. See the section "Learning Route of Software Development".

3.2 After the learning route established by the learning point, we also need to summarize the learning points of Java. These points have been mentioned more or less in previous articles, but I think we should pay special attention to summing up these places and not be suspicious of my mother-in-law.

3.2. 1 Check API files frequently. Programmers write some classes well, which is very fulfilling and wants to contribute to your suffering colleagues. At this point, you should use the "Javadoc" tool (included in JDK) to generate standard Java DOC documents for peers to use. J2SE/J2EE/J2ME DOC documents are tools for programmers to communicate with each other, and almost everyone has one, except novices. The official download address of J2SE DOC document is:, and you can download it by searching CHM version on google. You can also view it online:. Treat DOC files like quotations from chairman Mao, read them in the morning and read them before eating and sleeping. When you need a function, you should first check the corresponding DOC document to see if there is a ready-made implementation. If there is, don't bother to use it directly. When you can't find it, you should consider realizing it yourself. The use steps are generally as follows: ● Find a specific package, which is generally organized by function. ● If we need to use classes and class naming specifications, we can guess one or two from the class names. ● Choose a builder. Most ways to use classes are to create objects. Choose the method you need.

3.2.2 Book Search/Google-> Write code test->; Check the source code->; Ask others how to solve our problems. Don't rush to ask others at this time. Simple questions and thoughtless questions will make others look down on you. You can look for books first, search in Google, and most of the problems will be basically solved. And like "how to use some classes/methods", DOC document is the answer. If you have questions about some knowledge points, write a code to test it, which will leave a deep impression on you. For some questions, you may need to look directly at the source code of the API to verify your idea. Ask others as a last resort.

3.2.3 Learning the design idea of open source software There are many open source tools, components and frameworks in Java field, such as JUnit, ANT, Tomcat, Struts, Spring, Jive Forum, PetStore and so on. These are the treasures left by our predecessors. Would you like to go to Baoshan to analyze these tools and frameworks empty-handed and understand their design ideas? Maybe one day I can write a XXX framework or something. Analyzing open source software is actually a convenient way to improve your technical and practical ability.

3.2.4 Importance of Norms Without rules, there would be no Fiona Fang. The specification here has two meanings. The first meaning is technical specification, which means downloading JSRXXX specification and reading more specifications. This is the most authoritative, accurate and latest textbook. The second layer means programming specification, if you use many unique algorithms, personalized variables and naming methods; At the same time, there are no comments on the program to show how deep your programming skills are. This kind of code is a gobbledygook to others. It is difficult to understand, let alone maintain, and it is inevitable to be ruthlessly swept into the garbage dump. View or download Java coding specifications here, some of which are in Chinese. Well, if you want to know where I am, please refer to section 3.2.2.

3.2.5 is not limited to Java. Unfortunately, fortunately, there is still a lot to learn. Unfortunately, because there are too many things to learn, I have no time to spend with my wife, family and girlfriend, which leads to physical and mental exhaustion and even depression in severe cases. Fortunately, it is not easy for others to take your job. They or they need to pay a lot to realize their wishes. Java should not be studied in isolation. Need to learn data structure, OOP, software engineering, UML, network programming, database technology and other knowledge. It will be more effective to learn by horizontal and vertical association. For example, when learning Java collections, find a book about data structures; Review database technology when learning JDBC; The principle of "learning when necessary" is still adopted.

4. Conclusion It should be emphasized that learning software development is really difficult and hard, and it takes a lot of effort, but don't give up halfway. If this article can help friends who have been wandering outside Java, the author is also gratified. Haha, why does it sound so old-fashioned? I can't help it Under the long-term radiation of computer, I am becoming a little old man. Finally, I advise all programmers, especially MM programmers, to stay away from computers as soon as possible after finishing their work. According to Hu Bo Luanbao, computer radiation will modify some small black spots on fair skin, which looks very bright ...