Some insights and complaints of a Xiaobai (if others say they have zero foundation before learning programming, then I am a negative foundation)

In 2000, when I was in junior high school, I took the English course for the first time, and I started to fall down from the second class. I tried my best to memorize it, but I couldn't memorize it. After listening to English for 3 years, I couldn't understand anything. In 2006, I graduated from a vocational secondary school in Qingdao, and then worked part-time for ten years. During this period, I worked as an electrician for migrant workers, Foxconn, Ping An Insurance, and courier delivery. . Not a single job is computer-related. All the computers I have access to can only be accessed by playing games in Internet cafes. By this year, I will be 29 years old, with the speed of old hands and the head of elm.

First of all, I think the biggest foundation and advantage of learning programming is: interest. . .

  Others, my English is not good, my typing speed is slow, I am stupid, etc., my poor memory, these can be overcome.

  My English is also not good enough to have a vocabulary of up to ten words before learning programming, and I still don't understand English grammar.

  For example, before I wanted to create a class, it was basically (create a human) class ren(), and I didn’t want to use class person(), because I couldn’t remember the classes I wrote myself, and I was always worried about the variable naming problem. .

  During my learning to program, I spend half of my day familiarizing myself with those variables and code methods. Now a project can easily add up to hundreds of tables, table names, field names, etc. . .

  So from the beginning, it's important to develop a good habit of naming variables.

As for other problems, the typing speed is slow, the more you practice, the better your memory is. The more you study, the better your memory will gradually improve, and if you get up early and go to bed early, you will have enough energy.

A programmer, like a designer, does things and learns in a planned way.

Let's talk about the summary since learning python, and add it later depending on the situation.

First, learn programming, and later work on development, processing data, etc., such as current mobile games, mobile apps, computer games, apps, crawlers, and website development. Of course, if there is development, you need to consider later updates and add functions. Change it to a more professional buzzword, that is: the development code cannot be written to death.

Python is a strongly typed, dynamic language in terms of language types. Its strength is data processing, and the rise of artificial intelligence in recent years has brought python to fire because of python's data processing capabilities.

The data type of python is not much different from other languages. The biggest difference is in the structure. I think it is the problem of code indentation. Many other languages ​​use {} to represent a code block, while python uses code indentation, which is indented by 4 bits. Represents a block of code.

  This is also the reason why the python code is concise and beautiful.

Python's more useful data types: strings, lists, dictionaries.

The main logic of python is if; else. Basically in the project, each class needs to use if and else to judge.

The power of python is that it has many modules and packages. And each module, package usage method basically uses string, list, dictionary form

 

About bug handling

  When I was just learning, I often used debug, and finally found it useless. At most, I knew the order of code execution. Someone else told me later, the correct way to eliminate bugs.

  First of all, it depends on what type of bug it is. If the bug is related to the path, it is mostly a problem of environment variables.

  For example, I reported an error some time ago, and the translation is that a table in my current database is illegal. . At that time, I couldn't understand it, and finally solved it with the help of an old operation and maintenance.

  The old operation and maintenance did not know where the problem was. He just looked at the environment variables habitually and found that my environment variables were a bit messy, so he helped me sort it out, and the bug was gone.

  Speculation: I created a project yesterday and used the database, and today I created another project and still use that database. The operating system thinks that the project in this database was in use yesterday, so the prompt is illegal.

 

  There are many types of bugs. In domestic Baidu, it is difficult to find the answer. Many of my Baidu bugs were asked by someone who made a bug and asked under other people's blogs, but there was no answer. So if you have the conditions, FQ goes to Google to search, and you can basically find the answer. unconditional

  Or if you don't use it, it is recommended that you use Google Chrome, Baidu to look at your question, then find an English answer, and then right-click to translate the entire page into Chinese.

 

Regarding the execution order of django: after a django project runs:

  1  wsgi.py

  2 settings.py (configuration file, where you can register your database and configure your own app)

  3 urls.py (where the path is written, also known as the routing system, through which you can find the view functions in views.py)

  4 views.py (view function, here is the main logic part of a project backend)

 

 

A commonly used py file for a django project:

  I have now created a project cnblog and created an app at the same time

  Commonly used under the app are:

    __init__.py (generally used to connect to the database, for example, to connect to mysql, you need to import

       import pymysql

       pymysql.install_as_MySQLdb()

        )

    admin.py (django's own background management system)

    models.py (classes written here will create corresponding tables in the database)

    views.py (put the main logic code of the backend here)

  cnblog project:

    settings.py (configuration files are here, such as middleware)

    urls.py (routing system)

  templates (the front-end page is placed here)

 

The above is generally written in this way by default. In fact, it doesn't matter where it is written, as long as it can be found when importing the module. But it is still recommended to write that way, so that others can understand your code.

 

Developer Professionalism:

  Don't write the code to death, write the code so that others can understand it, and work overtime if you have nothing to do (at least in China).

 

Summary: Learning this matter is the same for everyone. If you can learn it, you will be very happy, but if you can't learn it, it will be very painful. Learning is not something that can be achieved overnight, believe me, genius has nothing to do with you and me. As long as you are interested, everything else is not a problem, learn a little bit every day, and you will soon stand at the level that your previous self looked up to.

    

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325332508&siteId=291194637