Open Course at Stanford University: notes on programming paradigm 1

Source: Internet
Author: User

Programming Paradigm Lesson 1 Reading Notes:


List several common programming languages (paradigms ):

C

Assembly

C ++

Concurrency programming (Parallel programming) (just a paradigm, rather than a language, you can use C/C ++ to Implement Parallel programming)


Scheme

Python

 

C is process-oriented and C ++ object-oriented. C language is used to call functions. Therefore, function A calls function B and function B calls Function C, just like A multi-level title. Therefore, A process is used to determine the function of A function, the first thing we see is a process (function) called through pointers.

 

C ++ is object-oriented, so it is accessed through "->" or ".". What we first see is a pointer or reference, that is, a complete object.

 


This series of courses will explain in detail how C/C ++ is compiled into an assembly language at the underlying layer, and will explain in detail the pointer, it is very complicated to use ** & p-> I = 7. Although the process may be a headache, it is helpful to understand the underlying layer, let you know why the crash occurred, rather than watching it crash. Of course, this usage is not worth advocating. Through these courses, you can become a senior C/C ++ engineer.

 

 

Assembly languages are very old and will not be detailed. There is a language called MITS, which is a bit interesting. You can study it. It will focus on how to compile C and C ++ into obj files and then generate executable binary files, the binary code (in the form of 0 and 1) generated by C and C ++ is similar.

C ++ removes the object-oriented part of C. Many awesome engineers tend to use C, although many excellent languages are better than C in different aspects.

 

Parallel programming is not really parallel. The original language, such as C/C ++, is actually executed after the execution is complete, while parallel programming is parallel execution (it feels like parallel execution is actually alternate execution, it's just that the switching frequency is very high, and users cannot see the switching process, so they think it is parallel execution ).

Parallel programming is not used in many places, but it is useful in network programming. One example is that two users get a certain amount of money from the ATM at the same time. For example, if the balance is 100, make sure they do not take the money at the same time. Convert this operation into a transaction ).

 

Scheme is a functional language that has deep roots in LISP. You may not know much about it. The functional language is the result returned by the execution dependent on the function. Traditional languages have defects, such as C/C ++. They may modify the struct during pointer passing and then return this value, causing confusion. The functional language determines the next execution based on the return value of the function. Therefore, this problem will not occur. This language is very interesting. You can learn it. It is actually more interesting than other languages (teacher primitive ).

 

Python is a young language. Many engineers on Google and facebook use this language for development. It is very suitable for network programming. Do not think that network programming is HTML or web pages, dynamic Web pages also need to deal with background database interaction and other issues. Python is only 16 ~ 17 years of history, so there won't be any defects like C/C ++ or Java. At the end of the course, there will be a big job. Building a web server will not be as big as Apache, however, it can parse XML, HTML, and background processing to generate dynamic pages. Python has many class libraries. It is an object-oriented language. It can be interpreted and interpreted while writing. There are also many function libraries that can be used to implement functional programming using Scheme, network Programming is very user-friendly.

 

In the past, the course was finally C ++ advanced programming, and later I used Java, but later I learned more about the content of another class, so I did not submit it to Java. Later I used python, and it worked well. The course was developed using python, and I could see the beauty of it.

 

At last, I will introduce other languages and paradigms, but I should have seen the programming paradigm that you have met in the next 15 years (this teacher is so confident)

 


The last course is over. The entire process is about 17 minutes. More handouts will be posted next week, and you will be asked to prepare a study report on the underlying principles of pointers in C/C ++. Over.

 

From my programming Park

Related Article

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.