There are also a lot of private messages from small partners backstage asking me ,
“ I have a little c Language foundation , learn Python Will it be faster ”,
“ I did 2 year Java, I work overtime every day , I feel that I can't improve my skills , Change careers now Python Will it be easier ”,
“ I haven't touched programming before , Where should we start ”,
“csdn There are many posts on it , Why can't I understand ”
<> So brother Feng combined his own experience and the experience of these little partners , Several points are summarized , Where it is easy to get out of touch in the learning process , I hope it will help you in your study !
The test scope in the figure below , Have you all experienced it
<> If the icon is drawn by yourself from beginning to end , Definitely not wrong ,
Charge down, brother , Let's take a look at the experience of programming .
From ignorant contact to practice makes perfect strain .
<> one , Fundamentals of programming
<>1 . Environment installation
Here's a suggestion for the novice Xiaobai , According to the step-by-step configuration of teaching materials ; Because the configuration of each step , It's all about whether the software behind you can run normally ;
If an error occurs in the configuration process , Reinstalling the system is also faster than finding errors , That's why programmers' computers look so clean .
<>2 . Language foundation
<>1 ） variable
identifier ： Any place where you can name yourself is called an identifier .
such as ： Class name , Variable name , Method name , Interface name , Package name …
Naming rules for identifiers ：—> If the following rules are not observed , Compilation failed ! Strict compliance is required
from 26 English letters case ,0-9,_ or $ form
Number cannot start
Keywords and reserved words cannot be used , But it can contain keywords and reserved words
Java Strictly case sensitive in , Unlimited length
The identifier cannot contain spaces
<>2 ） condition / branch
The following example , Enter age , Print different content according to different ages , use python in if How to implement the statement ：
age = int(input(" Please enter age ：")) if age >= 18: print(" You're an adult ") else print（" under age "） print
(" Test complete ")
<>3 ） loop
<>4 ） keyword
Keywords are pre-defined in computer language , Identifier of special significance , Sometimes called reserved words , There are also variables of special significance . They are used to represent a data type , Or represent the structure of the program, etc , Keywords cannot be used as variable names , Method name , Class name , Package name and parameters .
We need to be familiar with the usage of each keyword .
<>5 ） function
1, A function is a function code block that can be used multiple times , A closed （ space ）, It can be called at will in the code . Using function encapsulation can reduce the development of repeated code , Improve code utilization . Functions can pass parameters , Use the pre-defined content in the function to process the incoming different data parameters .
2, Functions are also objects , Can also be a value , It can exist in variables , Arrays and objects .
3, Functions can be passed as arguments to functions , And returned by the function , In addition, functions have properties .
4, Functions always have a return value （ In addition to constructors , Constructor returns constructor function calls by default , When the constructor call is executed , Return is displayed ）
<>6 ）API file
API There are various forms according to different languages and functions , But they all have one thing in common ： The user makes a request ,API（ occasionally ） Returns a response . The task of the technical documentation engineer is to describe in detail what the request contains , What is the form of the request , And what is the returned data .
API Although the structure of documents is diverse , But I think a good job API Documents need to be presented to readers ：
• Syntax of operation
• What can I do
• What variables are involved in the operation , Including system settings , Effective value , And data type – Boolean value , character string , wait
• What is the return value of the operation
• Error messages that may be encountered during operation
• Examples of requests and responses
<> two , Advanced programming / Project start
Here we need to distinguish between programming methods
<>1 . Process oriented
C Language can be simply understood as , It is a memory driven language , Language based on manual data storage – Maximize performance .
It is generally used in the fields of algorithms and data structures , Not here .
<>2 . object-oriented
OOP pattern , It can be simply understood as , It is one that has many DIY Ready container , You just need to give sufficient conditions , It can run .------- It's like filling up your car , Start up and run , You don't need to build an engine yourself .
<>1 ） class
In the object-oriented definition , The basic characteristics of some classes are also specified ：
（1） encapsulation ： Protect internal operations from damage ;
（2） inherit ： Continue to expand on the original basis ;
（3） polymorphic ： Carry out concept transformation within a specified range .
（4） example ： Now? csdn Many direct introductions , How to use it ;
<>2 ） Interface
The interface only defines some methods , Without realizing it , Mostly used in programming , Just what kind of function does the design need , But it doesn't realize any function , These functions need to be by another class （B） After inheritance , from
class B To realize one or all of them .
Beginners don't have to design , Understand this , How to implement the framework , To have a better understanding .
<>3 ） frame
frame （Framework） It is the reusable design of the whole or part of the system , It is expressed as a group of abstract components and the method of interaction between component instances ; Another definition is that , Framework is an application framework that can be customized by application developers . The former is defined from the aspect of application, while the latter is defined from the aspect of purpose .
Three classic frameworks :Spring,Struts,Hibernate.
<> three , Project advanced / exception handling
Now it's time for programmers to work overtime
<>1. Code debugging ,debug
You will break points in the code , Track code execution , Check out , Which branch has an exception , Or which data processing is not timely .
<>2. Exception capture try/catch
There are many modules , Checking code by code is obviously impractical , At this time, you can locate the general module problem in advance .
<>3. Log query log
The destination where we can control log information delivery is the console , file ,GUI assembly , Even socket servers ,NT Event recorder for ,UNIX
Syslog Daemons, etc ; We can also control the output format of each log ; By defining the level of each log information , We can control the log generation process in more detail .
<> summary ：
Learning programming is actually a slow and hot thing , There is no shortcut .
It won't happen , Check the data first , Ask the elder again , Don't jump to the next step blindly .
Step by step , Take every step steadily .