Do not use object-oriented programming to distract novice programmers.

Source: Internet
Author: User

Editor's note: the original author James Hague is a corrective measure.ProgramRecovering programmer, who has been designing video games since the 1980s S, belongs to the enthusiast level and has compiled Nintendo games in assembly languages.

When someone asks me "to teach my son/daughter/other people with no programming experience, what kindProgramming LanguageIs it the first choice ?", My answer has not changed over the last five years, that is, Python.

This answer may be a bit surprising. It is a non-mainstream programming language that some people talk about, but I support python.

Python is widely used in simple and interesting scenarios, but it is very effort-consuming to use C language. (Seriously, a basic spelling check program can use several lines of PythonCode.) Some key points are very easy to solve, but there is a tricky mismatch between them and core language features. Erlang has two major features. For example, try allAlgorithmIs the most natural manifestation. Smooth sailing in Python. Arrays, dictionaries, and configurations occupy a large part.

When using python as the getting-started programming language, you must note that it avoids its object-oriented features. You cannot avoid it because it will associate some useful methods of basic data types, but it doesn't matter. You only need to take advantage of the provided methods and do not talk about how to create classes. In particular, avoid any object-oriented design ideas that include data in classes.

The changes from process-oriented to object-oriented bring about changes from thinking about problems and solutions to thinking about architecture. It seems to be as simple as process-oriented Python programs and object-oriented programs.
However, the latter is always longer and is filled with additional interfaces, indentation, and comments. Charm is to put the scattered code into the class, add all the small methods, and pre-design the methods that do not know when they can be used.

When you try to help someone learn how to proceed from a problem and implement code, what you don't want to see most is that they are tossing around on Artificial Engineering jobs. Some people stick to the content of Object-Oriented Knowledge and create crazy class systems, but do not focus on what they should learn. Others are not interested in programs because of an additional layer.

In some ways, this is indeed the case. You need to discuss how to create objects in Python, but be as patient as possible.

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.