Learning Python makes it difficult to learn a programming language. what methods or skills do you have to learn?

Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply: Which programming language is the most difficult?
Not C ++, not Lisp, Your first language.
Where is the most difficult language?
The most difficult to get started.

For example, the following code:


print "hello world!"
As a person who has been learning Python for nearly two years, I would like to share with you the following.

1. Quick start
Dive Into Python http://woodpecker.org.cn/peintopython/ "
This tutorial is an example of a quick start. I remember that on the first day of my career, the supervisor asked me to read this tutorial. after reading this tutorial in two weeks, I can understand the basic syntax of Python. If you need more flexibility, try Head First Python (Chinese version) "

2. Getting started
Python core programming 2: This book is divided into two parts: basic and advanced. The most important part is the solid foundation. The book I bought last year has been read three times, each time is a new feeling and summary. Then, in the advanced Python section, such as regular expressions, multithreading, multi-process, and network programming.

3. practice
In the course of learning, reading books is not enough, and practice is the most important. The so-called learning and application, such as exercises/learning some small scripts/In the course of "Python core programming 2, here are several sites for learning Python script instances:
(1). code sharing list-Python
(2). python code library
Https://searchcode.com/
(4). the best choice for github is to search more related projects, check people's code, and copy the wheel !!

4. advanced entry
For more information about Advanced Python, see Python core programming 2. We can learn from the following books:
(1). Writing high-quality code: 91 suggestions for improving Python programs "
(2). understanding python in depth

5. Python library learning
Learn standard libraries and third-party libraries commonly used in Python. for details, refer to the standard libraries commonly used in Python and what are the third-party libraries?
I personally recommend that you do not buy the Python standard library, which is commercially available on the internet. I started to copy it last year and I hope it will be regrettable. This knowledge is already detailed in the official Python documentation, and the translation of this book is 'unsatisfactory '.

6. website recommendation learning
(1). 11 resources for learning Python Programming (Recommended here: Online Python Tutor: a good helper for beginners of Python. with this tool, instructors or students can directly write Python code in a Web browser and execute programs in a step-by-step manner. Online Python Tutor )
(2). Python-tag (Cnblog user Vamei Python summary)
(3). Python-Zope user group in China
(4). PyZh-write Python articles together and read Python articles together

7. Application Development
  • Website Development-Django, flask, tornado. (All documents are complete)
  • Game development-PyGame
  • Graphic interface development
  • Server development
  • Big data (currently relatively) Python natural language processing, Using Python for data analysis"
These will be gradually involved in the learning process, and Django is recommended. For API development, asynchronous network framework tornado is favored. for small and beautiful web services, flask is more pythonic.

The Python learning path is smooth and far away. I have been exploring the path to interpreting the beauty of Python step by step ......

Updated on

In retrospect, from the beginning of 2013 to now, learning about python has not been interrupted. Here we recommend some books or methods.

Consolidation class: Python Learning Manual (version 4th) Bedside tables, desk heads, and pillows are all necessary. it covers basic python knowledge and is a good choice for consolidating learning.

Python3: Dive Into Python 3 See @ Liao Xuefeng's python3 tutorial Python-Liao Xuefeng's official website

Advanced class: Python Cookbook Chinese version, 3rd , Advanced Python Programming ", There is also a book written by French people," the path to Python Masters" "

Python Server development cannot be achieved Network programmingThis word is recommended for personal books as follows:
  • UNIX network programming: 1st volume: Set of API (version 3rd)"
  • Python network programming basics: A Comprehensive Guide to Building Network programs using Python"
  • Linux high-performance server programming"
I personally think that the environment is very important. a good company environment and development environment can help you get twice the result with half the effort and communicate with other colleagues (besides colleagues, Daniel, github, Zhihu, stackoverflow, and other platforms ), do not build a car behind closed doors.Please do not recommend those books with the same chicken soup? As you said, are those books more conducive to learning programming?

The subject said that Python is difficult, and everyone does not think about why he thinks Python is difficult. Maybe he thinks Python syntax is difficult? Isn't that against common sense?

Obviously, the subject did not understand what he was doing during programming.

It is recommended that the subject buy a booklet to learn the C language. Really. Learning C language at the same time does not allow you to make software faster, but it helps you understand what you actually do. I also learned programming in the middle of the road. I understand that just like me, people who study programming in the middle of the road do not eventually learn how much code they can work on, either because of low IQ or poor memory, but they have no way to match the code with what happens in the computer in reality. Many books take this solution for granted. they think that the more advanced the interface encapsulation, the more natural the language design is, the more conducive it is to learning. But in fact, the more advanced interfaces and languages, the more conducive to the user to learn more complex knowledge, but not conducive to learning programming itself.

The more advanced languages are used, the more simple they are. the more advanced programming models such as object-oriented, templates, and functional programming are mixed. These things are often mixed with the most basic things in the same textbook, making beginners even more confused.

You can buy The C Program Language or something else, get to know The memory and CPU, understand what The variable and variable type are, and what The if is, what is C language code, and what is compilation. These things can give you a general grasp, and then look back at Python at least I don't feel like I don't know what I'm talking about. After writing a few lines of code in the C language, you can understand why Python is available, where it is simple, and what concepts it introduces for this simplicity.

Also, don't worry about object orientation. In fact, most programmers cannot understand what it is.

I used to have a colleague who is engaged in production and prefers programming. He wrote all the gadgets used in their department using vb6. It was also seconded to R & D to participate in the development of MIS systems. At that time, I was an intern and he was actually at a higher level than me. One time, he asked me what is a pointer to his certificate ...... I thought he was entertaining me.

Another former colleague, Big Brother, is said to be a soft starter of this science. he has worked in java and has done so. net, also said to be web, run our department to write C ++, there was a business trip to tune the bug to midnight, I was thinking to help the predecessors to see the problem, then we can see that the old man built mutex in the code on the stack and wanted to lock the function ...... What do you mean he can't do? It can work very well. Are you talking about him as a layman? It cannot be considered a layman. But ...... Some things are like this. you didn't understand what you were doing at first. the longer the time, the more trouble you have. I have always opposed Python as the first language.

Python is very simple for people with basic program concepts, but it is not necessarily simple for new users.

(I am a newbie. I have never learned c at all. many of you have actually learned c at your undergraduate level, but you have not learned it yet, but many things have concepts .)

Simple writing does not mean simple concepts., Many concepts that we take for granted, one Beginners with no foundationIs hard to understand. For example, dynamic type and duck typing, it is very likely that a newbie has not established the concept of data type connection. For example, is there a new concept for introspection? Without programming experience and data structure concepts, will it be difficult to understand why list and list parsing are important and what is the use of dictionaries? What are the OO mechanisms of lambda, higher-order functions, generator, and Python?

I still think there are two ways to get started: one is Assembly + C or Pascal, and the other is fig (scheme ). These two paths start from the computer, and from the mathematical concepts, Lay a solid foundation,After entering the door, consider other things.

Hmm ~ If you have a programming language. It takes several hours to learn PYTHON.
If you have no foundation, you have no idea about programming. You may need 3 ~ 6 months to understand what programming is.
For non-English countries, it takes more time to understand programming. Because programming is essentially a description. However, non-English countries look at a bunch of abstract English characters to make programming much more mysterious. This will give you a better understanding of some mathematics courses in the university and even interest in statistics ....
Then you can discard Python. the recommended "pe into python" on the top floor is a very bad book. Today, this book is no longer helpful for beginners or programmers in other languages.

This book was written 10 years ago, and a lot of content is outdated (of course this is not the point)

The point is that this book is not considered by new programmers at all. For example, if the first program in this book is as follows, I don't know what the author is thinking, but it crashes after I saw it ( Of course, it was written for experienced programmers.)


def buildConnectionString(params):
    """Build a connection string from a dictionary of parameters.

    Returns string."""
    return ";".join(["%s=%s" % (k, v) for k, v in params.items()])

if __name__ == "__main__":
    myParams = {"server":"mpilgrim", \
                "database":"master", \
                "uid":"sa", \
                "pwd":"secret" \
                }
    print buildConnectionString(myParams)
First of all, for those who want to learn programming well, no matter which language they start with, the language itself is not what we should be most concerned about, at least not as a beginner's first concern. It can also be said that it makes you feel difficult. Not necessarily the language itself(Such as syntax), The whole programming idea and programming structure. In fact, the syntax and operations of the python language you have learned are compared to those of c/c ++ and java. Relatively simple Getting started.
Your understanding before learning programming What is programming, Why do we need programming?? After learning about the objects we want to learn, we can learn from which aspects to learn. As for my own understanding, programming in a narrow sense is actually writing different code for different languages ( What is programming?), And the purpose of programming is to use programming languages to communicate with computers and manipulate them to work for us and implement what we need (algorithms such as algorithm )( Why do we need programming?). However, you can choose a programming language based on what you need to implement. for Android, for example, java and xml, for ios, object c. Therefore, as I have previously described, programming languages serve us to communicate with computers, just as we learn the languages of a country in the world to communicate with people in a country, instead of learning a language to learn a language, Language is not the ultimate goal of learning programming, but the beginning!
After learning why we need programming, let's discuss how to learn it well. In fact, getting started with programming should be a learning idea and a deep understanding of what is a programming process. As for the language to be selected, it is not that important at the very beginning. you can even use pseudocode to learn it. however, to make it easier for beginners to learn, a language that can be actually implemented can help beginners better understand programming. That is why the first course in most schools (at least most of the US computer science (computer science) undergraduate courses) is called intro to computer science with XXX language (computer science entry in XXX language ). An annoying statement againHere, with also demonstrates that the xxx language is a tool to help us get started with computer science, Getting started with computer science is our focus, not XXX language courses.. Some computer training institutions in China have to speak out here. in order to quickly cultivate programmers, they advocate the strong language of XXX, and focus only on cultivating students' programming language learning. In this way, we can only imitate others' program callers, rather than computer science workers we once hoped.
Well, with so many things said, let's take a look at some things to help you get started with computer science faster.
In the first lesson of computer science, apart from the reasons why I want to learn programming and the theory of programming, the first practical thing is the Hello World that all programmers know (at least for most cases ).
In python, print "Hello, World! "
In java: public class ClassName {
Public static void main (String [] args ){
System. out. print ("Hello, World! ");
}
}
In c ++ is: # include
Int main {
Std: cout <"Hello, World! ";
Return 0;
}
The three actually mean the same thing, that is Output string (a string) through the system)


If there is output, there is input, such as input () (python) and cin (c ++. Input and output are available in almost every programming language, and are also one of the most basic means of communication between people and computers..

Then we generally start to introduce Data type)Such as int, double, long, and boolean (it is relatively simple in python, because variable is defined (variable) the system can automatically identify the initialization value of the variable or the data type of the value ). It should be emphasized that although the data type looks simple, we know Information exchange is the most basic purpose, whether it is communication between people or between people and computers. in computer science, information exchange is based on data exchange, therefore, data is very important to computer science.With the future study, we must gradually master and skillfully use various data types, and determine when to use the data types. Abstract data type will be learned in the future ).

Then I learned something. Judgment statement(If/else statements, switch statements, etc.) and Loop statement(While loop, for loop, do while loop, etc.), which involves a very important data type ( Boolean value), Which is simply right and wrong ( TrueAnd False). Although the basic concepts of boolean are well understood, boolean is the basis of boolean algebra. The basic Boolean algebra is involved in discrete mathematics, For computer science students or want to learn computers well, mathematics is very important, especially discrete mathematics.Unlike the indifference of many universities or training institutions to mathematics, on the contrary, they should pay attention to the cultivation of mathematical ideas in computer learning. Discrete mathematics is the foundation of computer science, while calculus linear algebra is the basis of discrete mathematics. Therefore, the mathematics courses arranged in the university should not be ignored by students and teachers. In the future, whether it is data structures or algorithms, the foundation of mathematics will help you learn computer science well.

The next step is to learn Function). In essence, a function abstracts the process of communication and operation with a computer to form a method that is convenient for multiple times. Therefore, a function is also called a method in programming ).This allows us to have a similar solution when performing operations of the same type, instead of repeatedly inputting a large amount of similar content each time. In computer science, simplicity is a good habit, and functions are a foundation for simplifying programs. A function is usually composed of a return type or a function's data type ( What we want to obtain through the function), Parameters( We give the function the required), And Function subject( How functions work). A function exactly represents a way for people to communicate with computers. a person gives function parameters and a function returns values (or sometimes a function is of the void type, that is, no value is returned, however, void is usually used to complete the specific operations we need ), It also happens to be a method of information exchange.


When learning c ++, it will also involve the pointer concept. this is a very important concept in c ++ and something to pay attention to in the future, once you learn it, you will understand it.

After learning the basic computer programming concepts I mentioned earlier (although I have not covered them in detail ), OOP (object-oriented programming Object-Oriented programming). A large number of or even basic components are involved in advanced programming languages, which is also a future programming trend.In fact, if you only use what you mentioned before for programming, you can become process-oriented programming in a narrow sense. In fact, OOP is another method that simplifies our programming after the function, so we can make things more abstract but convenient. By defining our own data types Object)To manage and operate data. Attackers can communicate with computers in depth and purposefully. Three cores of object-oriented programming (important but not limited to): encapsulation, inheritance, and polymorphism ).Encapsulation is to assemble the data types we define into a whole to form available objects (a bit like the mold on the factory assembly line ), inheritance is to obtain some features of a parent class and apply them in the new subclass (just like some features inherited by children from their parents ), polymorphism is the implementation of some of the abstract methods we have defined that can be used or redefined (in short, a thing can present multiple states on different objects ).

Object-oriented programming not only simplifies and facilitates our programming, but also protects the privacy of data during the exchange process.Private objects can only be known and owned by their own objects (just as their wallet can only be controlled by themselves). public objects can be displayed in the main function (main function) used for other data. This clearly defines the boundaries of data usage, which is also an epoch-making progress in programming history.

After talking about this, we simply describe the context of the computer and will learn the data structure (how to manage our data) and algorithms in the future. Hope to help you.

As for the skills, I think the most important thing is that you learn the programming method, that is, what I have repeatedly stressed, not only focus on the programming language itself, but will continue to learn in depth, constantly master and understand the main ideas of programming.

We recommend some websites for you:
Python Learning Website: http://www.codecademy.com/

Computer science introductory course: CS 61A Fall 2013: Structure and Interpretation of Computer Programs
This is an entry-level course at the University of California, Berkeley. it was initially taught in python. Sorry, I am late. I didn't think programming is simple when I first came into contact with Python.

Apart from my college homework written in C, Python should be the first language I came into contact with. at that time, I had an internship in a company that was very popular with Zhihu. I didn't say my name, so I was just in case I had to drop my mouth. I remember it was very difficult to write code at the time and I had no idea how to do it. I guess your current situation is similar to mine at the time. Then I used a stupid method. this method may be helpful to people who first came into contact with programming:

Find some code with complete functions, run the code to implement this function, and insert materials into the code that do not understand, or read books, and add comments to the code. Well, after you add comments to several projects, you should know how to write them. Please give up. the difficulty of one thing is to block people who do not meet the specifications. Even py finds it difficult to mix in the industry.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.