A letter to programmers

Source: Internet
Author: User
Tags epoll python sqlite

Source: http://coolshell.cn/articles/4990.html Author: Chen Hao

Moonlight blog published a letter to novice programmers in June 12, translated from An open letter to those who want
To start programming, my friend (whose id on this site is Mailper) told me that he wants to see a more operational Article on the cool shell. He also liked programming and technology, so I asked him to summarize some of his learning about Python and Web programming. So he sent me some of his experiences and experiences. I am not doing much about his experiences, but also adding an "advanced" section based on my experiences. This is an article completed by newbie and old guy based on our experience.

My friend named this article Build Your Programming Technical Skills. I really don't know how to translate it in Chinese, but during my writing, I think this is like a process of upgrading tasks for online games. Therefore, the title is called "Technical Training Level Strategy", and the question is a little big. Haha, this title is purely for fun. Here, I am only sharing my personal learning experiences with Mailper. (Note: Some of the technologies I have learned as a beginner (obviously outdated today), such as Delphi/Power builder, it also saves some of the technologies I have learned that are boring. Lotus Notes/ActiveX/COM/ADO/ATL /. NET


Do you think you have only done the same procedure as a small toy when you graduated from school?After entering the workplace, even if you have no experience, you can go through the following extracurricular exercises (complaints from friends: school courses are always based on theory,The job project does not see any practical effect, so it is better to start from the work needs)


  • Do not buy books or catch up with new technical terms,Basic things have been accumulated for a long time and will be used for at least 10 years in the future.
  • Let's review the history and look at the development of time online technology in history so that you can understand what tomorrow will look like.
  • Do it first. No matter how simple the example is,We recommend that you at least repeat it to see if you have understood the details.
  • You must learn to think and think about why, not that. We also need to think differently.

Note: You may wonder why the following things are very Unix/Linux. This is because I think programming in Windows may not be promising in the future, for the following reasons:

  • The current user interface is dominated by almost two things: 1) Web, 2) mobile devices iOS or Android. The GUI of Windows is no longer delicious.
  • More and more enterprises are constructing their systems using low-performance Linux and various open-source technologies. The cost of Windows is too high.
  • Microsoft's things have become too fast and not long-lasting. They are completely playing with programmers. For details, see Windows Programming revolution

Therefore, I personally think the trend in the future is that the frontend is Web + mobile, and the backend is Linux + open source. Basically, there is nothing to do with Windows on the development side.

Getting started

1. Learn a scripting language, such as Python/Ruby

It can free you from the fear of the underlying language. The scripting language allows you to quickly develop small programs that can be used. Practice Project:

  • Process a text file, or read a local file in csv (python csv, python open, python sys), and process it row by row (such as word count or log)
  • Traverse the local file system (sys, OS, path). For example, write a program to count the size of all files in a directory, sort the files by various conditions, and save the results.
  • Dealing with databases (python sqlite), writing a small script to calculate the number of entries in the database
  • Learn to debug with various simple and crude methods such as print
  • Learn to use Google (phrase, domain, use reader to follow tech blogs)

Why do we need to learn the scripting language, because they are too convenient. Many times we need to write some gadgets or scripts to help us solve the problem, and you will find that the formal programming language is too difficult to use.

2. Familiar with a programmer's editor (not IDE) and some basic tools

  • Vim/Emacs/Notepad ++, learn how to configure Code Completion, appearance, external commands, etc.
  • Source Insight (or ctag)

Instead of using Cool, these editors can view and modify code, configure articles, and logs faster and more efficiently.

3. Familiar with Unix/Linux Shell and common command lines

  • If you use windows, at least learn to use linux in a virtual machine. vmware player is free of charge. Install Ubuntu.
  • You must use less graphic interfaces.
  • Learn to use man to view help
  • File System Structure and basic operations ls/chmod/chown/rm/find/ln/cat/mount/mkdir/tar/gzip...
  • Learn to use some text operation commands sed/awk/grep/tail/less/more...
  • Learn to use some management commands ps/top/lsof/netstat/kill/tcpdump/iptables/dd...
  • Learn about various configuration articles in the/etc directory and view system logs under/var/log and system running information under/proc.
  • Learn about regular expressions and use regular expressions to find files.

For programmers, Unix/Linux is much simpler than Windows. (See my CSDN blog post "Unix is actually very simple" four years ago.) When you learn to use Unix/Linux, you will find that the graphic interface is too difficult to use in some cases, greatly reducing work efficiency.

4. Learning Web BASICS (HTML, CSS, and JS) + server-side Technology (LAMP)

The future will inevitably be the world of Web, and the best website for Learning WEB basics is W3School.

  • Learn the basic HTML syntax
  • Learn how CSS selects HTML elements and applies some basic styles (Key Words: box model)
  • Learn to use Firefox + Firebug or chrome to view and dynamically modify the webpage structure that you think is amazing.
  • Learn how to manipulate HTML elements using Javascript. Understanding DOM and dynamic web pages (http://oreilly.com/catalog/9780596527402) online with free chapters, enough to use. Or see DOM.
  • Learn to use Firefox + Firebug or chrome to debug Javascript code (set breakpoints, view variables, performance, console, etc)
  • Configure Apache or Nginx on a machine
  • Learn PHP, let the backend PHP interact with the front-end HTML, and form a preliminary understanding of the server's corresponding browser requests. Implements a form submission and reverse display function.
  • Connect PHP to the local or remote database MySQL (MySQL and SQL are used up now)
  • Follow a prestigious Network Programming Course (such as: http://www.stanford.edu /~ Ouster/cgi-bin/cs142-fall10/index. php) Don't think it takes more than one semester, college students are full-time one semester to choose 3-5 courses, you can certainly catch up
  • Learn a javascript Library (such as jquery or extjs) + Ajax (asynchronously reading a server image or database content) + JSON data format.
  • HTTP: the definitive guide after reading the first four chapters, you will understand what happened when you access the Web browser every day (proxy, gateway, browsers)
  • Create a small website (for example, a small message board that supports user login, Cookie/session, addition, deletion, modification, and query, upload image attachments, and display on pages)
  • Buy a domain name, rent a space, and create your own website.
Advanced training

1. C language and operating system calls

  • Re-learn the C language, understand the pointer and memory model, and use the C language to implement various classic algorithms and data structures. We recommend "computer programming art", "Introduction to algorithms", and "programming Pearl".
  • Learning (MIT free course) Introduction to computer science and Programming
  • Learning (MIT free course) C language memory management
  • Learn about Unix/Linux system calls (advanced UNIX environment programming) and system-level things.
    • Use this system knowledge to operate the file system. (implement a small program that can copy the directory tree)
    • Use fork, wait, and waitpid to write a multi-process program, and use pthread to write a multi-thread program with synchronization or mutual exclusion. Multi-process, multi-process ticket buying procedure.
    • Use signal/kill/raise/alarm/pause/sigprocmask to implement semaphore communication between multiple processes.
    • Learn to use GCC and GDB to program and Debug Programs (refer to my "debug program with GDB")
    • Learn to use makefile to compile programs. (Refer to my "Write makefile with me")
    • IPC and socket can be put into advanced practice.
  • Learning windows SDK programming (Windows programming, MFC programming)
    • Write a window to learn about winmain/winprocedure and Windows message mechanism.
    • Write programs to operate windows SDK resource files or various graphical controls, as well as graph programming.
    • Learn how to use msdn to view related SDK functions, various WM _ messages, and some routines.
    • There are many routines in this book. Please do not copy them in practice, and try to write your own routines.
    • Don't be too familiar with these things, because the GUI is being replaced by the web, mainly to understand the programming of the Windows GUI. @ Virushuo said: "I think the GUI is really not that popular, but it is very important to fully understand how the gui works. Including mobile device development, it is still very difficult without basic knowledge. Or mobile device development must understand GUI work, learn from win, or go to MAC/IOS ".

2. Learning Java

  • Java learning mainly refers to the classic core Java "Java core technology programming" and "Java programming ideas" (there are two volumes, I only chain the first volume, enough, because you can understand the Java graphical interface)
  • Learn JDK, learn to view Java API Doc http://download.oracle.com/javase/6/docs/api/
  • Let's take a look at the differences in compilation and execution between Java and C and python. Think about cross-platform technology from C, Java, and python.
  • Learn how to use ide eclipse, compile, debug, and develop Java programs using eclipse.
  • Create a tomcat website and try JSP/servlet/jdbc/MySQL web development. Use JSP and servlet to implement the small PHP project mentioned above.
3. Web security and architecture
  • I have learned many HTML5 tutorials on the internet, and I have introduced many tutorials in the past. I will not list them here.
  • Learn about web development security issues (refer to Sina Weibo's attack and Ruby's article)
  • Learn the rewrite mechanism of HTTP server, reverse proxy mechanism of nginx, fast-CGI (such as: PHP-FPM)
  • Learn about the static page caching technology of the web.
  • Learn about the architecture of asynchronous Web workflow processing, data cache, data partitioning, Server Load balancer, and horizontal scaling.
  • Practical tasks:
    • Use HTML5 canvas to make some Web animations.
    • Try to perform SQL injection, JS injection, and XSS attacks in the Web application developed earlier.
    • Change the Web application developed earlier to construct the website in Nginx + PHP-FPM + static page Cache

4. Learning relational databases

  • You can install MSSQLServer or MySQL to learn databases.
  • Learn the paradigm of Database Design in textbooks, such as 1nf, 2nf, 3nf ,......
  • Learn about database storage, triggers, views, indexes, and cursors.
  • Learn SQL statements and understand the concepts of table join (see the SQL join illustration)
  • Learn how to optimize database queries (see MySQL optimization)
  • Practical Task: design a forum database that meets at least 3nf. use SQL statements to query the latest articles of the week, the most comments, and the most active users.

5. Some development tools

  • Learn to use SVN or git to manage program versions.
  • Learn how to use JUnit to perform unit tests on java.
  • Learn coding standard or coding guideline in C and Java. (I wrote a very simple article about C language N years ago-programming cultivation. You can check this on the Internet ).
  • Read "code Daquan", "refactoring", and "clean code".

1. C ++/Java and object-oriented

I personally think that learning C ++ and Java is just an easy task. However, the learning curve of C ++ is steep. However, I think C ++ is the most important language to learn. Refer to the two interesting articles: "C ++ learning confidence map" and "learning C ++ in 21 days"

  • Learning (MIT free course) C ++ Object-Oriented Programming
  • Read the books recommended in my "how to learn C ++ well" at least twice (If your understanding of C ++ goes deep into the C ++ virtual functions as I wrote table parsing or C ++ object memory storage Board (I) (ii), or the trap of returning internal static members in C/C ++)
  • Then I want to reflect on why C ++ is doing this, but Java is not? You must learn to compare the differences between C ++ and Java. For example, Java initialization, garbage collection, interfaces, exceptions, virtual functions, and so on.
  • Practical tasks:
    • Use C ++ to implement a BigInt that supports 128-bit integer addition, subtraction, multiplication, and Division operations.
    • Uses C ++ to encapsulate the capacity of a data structure, such as hash table.
    • Encapsulate and implement a smart pointer in C ++ (you must use a template ).
  • The design pattern must be read for more than two times. Think about the application scenarios of these 23 patterns. There are two main points: 1) Love combination rather than inheritance; 2) Love interface rather than implementation. (We also recommend "in-depth design patterns")
  • Practical tasks:
    • Implement a memory pool in factory mode.
    • You can use the policy mode to create a class that can align the text file left, right, and center.
    • Use command mode to implement a command line calculator and support undo and redo.
    • The modification mode is used to implement a hotel room price pricing strategy-peak season, service, VIP, tour group, and other factors that affect the price.
  • Learn STL usage and design concepts-containers, algorithms, iterators, and functions. If possible, read the source code.
  • Practical tasks: Try to use object-oriented, STL, design patterns, and WindowsSDK Graphic programming skills
    • Make a snake or Tetris game. Different Levels and difficulty are supported.
    • As a file browser, you can browse the files in the directory and perform different operations on different files. You can open and edit a text file and execute the file, mp3 or avi files can be played, and image files can be used to display images.
  • Learn the design of some class libraries in C ++, such as: MFC (let's take a look at Mr Hou Jie's "Let's get started with MFC"), Boost, ACE, CPPUnit, STL (STL may be too difficult, but it would be great if you can understand the design patterns and designs. If you can go deep into the STL
    String-type copy-to-write technology, which is very good. ACE requires a strong system knowledge. For more information, see "enhanced understanding of the system ")
  • Java is a real object-oriented language, and there are no more Java design patterns. It is also the best language for Learning Object-oriented Design Patterns (see the design patterns in Java ).
  • We recommend that you read objective Java and Java
  • There are many Java frameworks, such as Spring, Hibernate, and Struts, to learn about Java design, such as IoC.
  • Java is also a poor technology, focusing on J2EE architecture and JMS, RMI, and other messaging and remote call technologies.
  • Learn how to use Java for Web Service (the official tutorial is here)
  • Practical Task: try to build a Web Service Remote Call program under Spring or Hibernate framework, and pass messages through JMS in two services.

Both C ++ and Java can not be learned in a short time. C ++ is very familiar with Java and Java is widely used. I suggest you select either of them. My personal learning experience is:

  • In-depth study of C ++ (I have been exploring C/C ++ for more than 10 years)
  • Learn various Java design patterns.

2. Enhance system understanding

Important: Read the following books:

  • Unix programming Art: Understanding the design and development philosophy, ideological and cultural system, principles, and experience in the Unix system field. You will have a feeling of being overwhelmed.
  • Unix Network Programming Volume 1, socket this is a book that you will understand network programming after reading it. Pay attention to the differences between TCP, UDP, and select/poll/epoll for multiplexing system calls.
  • Details of TCP/IP 1: Protocol-this is a book that allows you to become a web hacker after reading it. Measure the test taker's understanding about the working principle of Ethernet, the TCP/IP protocol, the operating principle, and how to optimize TCP.
  • Practical tasks:
    • Understand the IO Technology of blocking (synchronous IO), non-blocking (asynchronous IO), and multiplexing (select, poll, epoll.
    • Write an online chat program that has a chat server and multiple chat clients (the server uses UDP to add some or all of the chat clients to Multicast or Broadcast ).
    • Write a simple HTTP server.
  • Unix Network Programming volume 2, inter-process communication semaphores, pipelines, shared memory, messages, and other IPC ...... These technologies seem to be a bit old, but they are worth learning.
  • Practical tasks:
    • It mainly implements various methods for communication between IPC and program.
    • Try to write an MPS queue. The Parent and Child processes exchange data through the MPs queue.
    • Try to write a program with shared memory. The two processes exchange a C struct array through the shared memory.
  • Learn the book Windows core programming. Master CreateProcess, Windows Thread, thread scheduling, thread synchronization (Event, semaphore, mutex), asynchronous I/O, memory management, DLL.
  • Practical tasks:Use CreateProcess to start a notepad or IE and monitor the running of the program. Implement the simple HTTP service previously written in the thread pool. Write a DLL hook program to monitor the closing events of a specified window, or record the keys of a window.
  • With multithreading, multi-process communication, TCP/IP, socket, C ++ and the basic design mode, you can study ACE. Use ACE to rewrite the preceding chat program and HTTP server (with thread pool)
  • Practical tasks:Through all the above knowledge, try
    • Write a service terminal to send a large file to the client, and the 80% M bandwidth must be used for more. (Note: disk I/O and network I/O may be very problematic. Think about how to solve it. In addition, pay attention to the maximum unit MTU for network transmission)
    • Measure the test taker's knowledge about how BT downloads work and use multi-process methods to simulate the principles of Bt downloads.

3. System Architecture

  • Server Load balancer. HASH type, pure dynamic type. (You can search for some articles about Server Load balancer in Google)
  • Multi-layer Distributed System-Client Service Node layer, computing node layer, data cache layer, and data layer. J2EE is a classic multi-layer structure.
  • CDN system-access to the nearest node, and content is marginalized.
  • A P2P system is used to study the algorithms of BT and donkey. For example, DHT algorithm.
  • Server backup, dual-Machine backup system (Live-Standby and Live-Live systems), how do two machines monitor each other through heartbeat? Back up the master node of the cluster.
  • Virtualization technology. With this technology, you can switch the operating system as an application, or reconfigure and deploy it.
  • Thrift is a binary high-performance communication middleware that supports data (object) serialization and multiple types of RPC services.
  • Learn Hadoop. The core designs in the Hadoop framework are MapReduce and HDFS. The idea of MapReduce is widely circulated as mentioned in a Google paper. A simple sentence explains MapReduce as a "Summary of task decomposition and results ". HDFS is short for Hadoop Distributed File System, which provides underlying support for Distributed Computing and storage.
  • Understanding NoSQL databases (some people say it may be a transitional hype technology), but because ultra-large scale and high concurrency pure dynamic websites are becoming mainstream, SNS websites have rigid requirements such as real-time data access, which makes NoSQL databases increasingly popular.
    The focus has become a trend in replacing relational databases with mainstream data storage models in the future. Currently, many NoSQL databases are open-source, most of which are well-known: MemcacheDB, Redis, Tokyo Cabinet (upgraded to Kyoto Cabinet), Flare, MongoDB, CouchDB, Cassandra, Voldemort, etc.

After writing so much, I think I have a sense of accomplishment. I hope you will not be scared. I have been learning for the past 10 years. Today I am also studying. My life is a process of continuous learning and training.However, there must be something missing or wrong. I hope you can add and correct it.. (I will update this article at any time based on your feedback.) You are welcome to chat with me through my microblog (@ left ear mouse) and twitter (@ haoel.

-- Update 2011/07/19 --

1) Some may wonder why I mentioned web + mobile at the beginning of this article, but I did not mention iOS/Android front-end development later. I have a feeling in my mind that the UI on mobile devices will eventually be replaced by Javascript. You can use the iPhone or Android to check google + and you will understand it.

2) A friend said that I have too many things to learn. I agree very much. I also mentioned before the article that I want to think about. In addition, do not think that these things I am talking about are some new techniques. more than 95% of this strategy is the foundation. They are also proven basic technologies. That is, the technology that allows you to get a better job.

3) Some friends say that they have finished learning all these things, so it's better to think about how to earn money. I want to tell you, first, I am not 40 years old this year, and second, I have no end to learning. Third, I don't think how hard it is to make money, but how can I make you worth so much money? Whether working or starting a business, what makes your own value and the value of your company more valuable? I dare not say anything else. For Internet or IT companies, technical strength is definitely one of them.

4) Some people say that technology is a tool, so we should not be so obsessed with this sentence. Sometimes we need to look up more to see things other than technology, or when we are doing technology, we don't have to think about why this technology exists. The question is not about technology. The problem is that we read dead books, read dead books, and become technical geeks.

5) NoSQL is very popular recently, but I am a little conservative about it, so I just want to know about it. For Hadoop, I think it has great potential in distributed systems, so we need to learn. For relational databases, it is indeed very important. This is my negligence and I will add it in the original 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.