Programmer’s technical leveling strategy [转载]

Author – Chen Hao

Moonlight Blog published “A letter to a novice programmer“, translated from “An open letter to those who want to start programming“, my friend (his id on this site isMailper) told me that he would like to see a more actionable article on Cool Shell. Because he is also a guy who likes programming and technology, so I asked him to summarize some of his learning Python and Web programming. So he sent me some of his insights and experiences, and I made a few additions and modifications to his experiences, and added a “advanced” section based on my experience.This is an article done by a newbie and an old guy like me based on our experience.

This friend of mine named this article Build Your Programming Technical Skills. I really don’t know how to translate it in Chinese, but in the process of writing,I think this is very similar to a process of playing an online game to upgrade tasks, so it is called “Technical Leveling Guide”, the title is a bit big, hehe, this title is purely for fun.This is just sharing Mailper and my personal learning experience.(Note: Some technologies that I have learned as a beginner (obviously outdated today) are omitted, such as: Delphi/Power builder, and some technologies I have learned that I find boring Lotus Notes/ActiveX/ COM/ADO/ATL/.NET…)

foreword

Do you feel like you just did little toy procedures when you graduated from school?After entering the workplace, even if you have no experience, you can go through the following extracurricular exercises (comments from friends: school courses always start from theory,The homework projects do not seem to have any practical effect, it is better to start from the needs of the work)

suggestion:

  • Don’t buy books indiscriminately, don’t chasing new technologies and new terms,The basics have accumulated over a long period of time and will be available for at least the next 10 years.
  • Look back at history and look at the development of technology on the timeline in history, and you can understand what tomorrow will be like.
  • Be sure to do it, no matter how simple the example is,It is recommended to at least knock it on your own to see if you understand the details.
  • You must learn to think, to think about why this is what it is, not that. Also think twice.

Note: You may be wondering why the following things are very Unix/Linux, this is because I think programming under Windows may not have a future in the future, for the following reasons:

  • The user interface nowadays is pretty much dominated by two things, 1) the web, 2) the mobile device iOS or Android. Windows graphical interface is not popular.
  • More and more companies are building their systems with low-cost, high-performance Linux and various open source technologies. Windows is too expensive.
  • Microsoft stuff is getting too fast, it’s not durable, they’re totally messing with programmers. For details, see “History of the Windows Programming Revolution

Therefore, I personally think that the future trend is that the front end is Web + mobile, and the back end is Linux + open source. There is basically 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 low-level languages, and scripting languages ​​allow you to quickly develop small programs that can be used. Practical project:

  • Process text files, or csv (keywords python csv, python open, python sys) Read a local file and process line by line (such as word count, or process log)
  • Traverse the local file system (sys, os, path), for example, write a program to count the size of all files in a directory and sort by various conditions and save the results
  • Deal with the database (python sqlite), write a small script to count the number of entries in the database
  • Learn to debug in simple and rude ways such as various prints
  • Learn to Google (phrase, domain, use reader to follow tech blogs)

Why learn scripting languages, because they are so convenient, many times we need to write small tools or scripts to help us solve problems, and you will find that regular programming languages ​​are too difficult to use.

2. Use 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)

Using these things is not for Cool, but these editors will be faster and more efficient to view, modify code/configure articles/logs.

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, install Ubuntu
  • Be sure to use the graphical interface sparingly.
  • 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 manipulation commands sed/awk/grep/tail/less/more …
  • Learn to use some management commands ps/top/lsof/netstat/kill/tcpdump/iptables/dd…
  • Understand various configuration articles in the /etc directory, learn to view system logs under /var/log, and system operation information under /proc
  • Learn about regular expressions and use regular expressions to find files.

Unix/Linux is much simpler than Windows for programmers. (See my blog post on CSDN four years ago, “Actually Unix is ​​very simple》) learn to use Unix/Linux, you will find that the graphical interface is too difficult to use at some point, which reduces the work efficiency considerably.

4. Learn web basics (HTML/CSS/JS) + server-side technology (LAMP)

The future must be the world of the web, and the best website to learn the basics of the web isW3School.

  • Learn the basic syntax of HTML
  • Learn how CSS selects HTML elements and applies some basic styles (keyword: box model)
  • Learn to use Firefox + Firebug or chrome to view the structure of the web page that you think is cool, and modify it dynamically.
  • Learn to manipulate HTML elements using Javascript. Understand the DOM and dynamic web pages (http://oreilly.com/catalog/9780596527402) There are free chapters available online, which are enough.or see DOM .
  • Learn to debug Javascript code with Firefox + Firebug or chrome (set breakpoints, view variables, performance, console, etc.)
  • Configure on one machineApache or Nginx
  • LearnPHP, let the background PHP and the foreground HTML interact with the data, and form a preliminary understanding of the corresponding browser request of the server. Implement a form submission and inversion function.
  • Connect PHP to the local or remote database MySQL (MySQL and SQL are now enough)
  • Complete a network programming course from a prestigious school (for example:http://www.stanford.edu/~ouster/cgi-bin/cs142-fall10/index.php ) Don’t feel that you need more than one semester. College students choose 3-5 courses per semester full-time, and you can definitely keep up with it in your spare time
  • Learn a javascript library (such as jQuery or ExtJS) + Ajax (asynchronously read a server-side image or database content) + JSON data format.
  • HTTP: The Definitive Guide After reading the first 4 chapters, you will understand what happens when you use browsers every day on the Internet (proxy, gateway, browsers)
  • Be a small website (for example: a small message board, support user login, Cookie/Session, add, delete, modify, check, upload picture attachments, display in pagination)
  • Buy a domain name, rent a space, and make your own website.

Advanced deepening

1. C language and operating system calls

  • Re-learn C language, understand pointers and memory models, and use C language to implement various classic algorithms and data structures. recommend”computer programming art“, “Introduction to Algorithms“and”Programming pearls“.
  • Learn(MIT Free Course) Introduction to Computer Science and Programming
  • Learn(MIT Free Course) C Language Memory Management
  • Learn Unix/Linux system calls (Unix Advanced Environment Programming), to understand things at the system level.
    • Use these system knowledge to operate the file system, user (implement a small program that can copy the directory tree)
    • Use fork/wait/waitpid to write a multi-process program, and use pthread to write a multi-threaded program with synchronization or mutual exclusion. Multi-process multi-process ticketing program.
    • Use signal/kill/raise/alarm/pause/sigprocmask to implement a multi-process semaphore communication program.
    • Learn to use gcc and gdb to program and debug programs (see myDebugging programs with gdb“)
    • Learn to use makefiles to compile programs. (See my “write makefile with me“)
    • IPC and Socket things can be put into advanced practice.
  • Learn Windows SDK programming (Windows programming ,MFC programming)
    • Write a window, understand WinMain/WinProcedure, and the message mechanism of Windows.
    • Write some programs to operate the resource files or various graphic controls in Windows SDK, as well as the programming of drawing.
    • Learn how to use MSDN to view related SDK functions, various WM_ messages, and some routines.
    • There are many routines in this book, please don’t copy them in practice, try to write your own routines.
    • Don’t be too proficient in these things, because the GUI is being replaced by the Web, the main thing is to understand the programming of the Windows graphical interface. @virushuo Said: “I think GUI is really not so popular, but it is very important to fully understand how GUI works. Including mobile device development, it is still very difficult without basic knowledge. Or mobile device development must understand GUI work, or in win that Learn as you go, or learn on mac/iOS”.

2. Learn Java

  • The learning of Java is mainly to see the classic Core Java “Java core technology programming“and”Java programming ideas“(There are two volumes, I only linked the first volume, which is enough, because it is enough to understand the graphical interface of Java)
  • Learn JDK, learn to consult Java API Doc http://download.oracle.com/javase/6/docs/api/
  • Learn about the differences in compilation and execution between Java, a virtual machine language, and C and Python. Think about “cross-platform” technology from C, Java, Python.
  • Learn to use IDE Eclipse, use Eclipse to compile, debug and develop Java programs.
  • Build a Tomcat website and try JSP/Servlet/JDBC/MySQL web development. Try to use JSP and Servlet to realize the small PHP project mentioned above.
3. Web Security and Architecture
  • Learning HTML5, there are many, many tutorials on the Internet, beforecool shellIt has also been introduced a lot, and I will not list it here.
  • Learn about security aspects of web development (referenceSina Weibo was attacked,as well asThis article by Ruby)
  • Learn the rewrite mechanism of HTTP Server, the reverse proxy mechanism of Nginx,fast-cgi(Such as:PHP-FPM)
  • Learn about static page caching techniques for the Web.
  • Learn Web asynchronous workflow processing, data cache, data partitioning, load balancing, and horizontal scaling architecture.
  • Practical tasks:
    • Make some web animations using HTML5 canvas.
    • Try SQL injection, JS injection, and XSS attack in the web application you developed earlier.
    • Change the previously developed web application to a website constructed on Nginx + PHP-FPM + static page cache

4. Learn about relational databases

  • You can install MSSQLServer or MySQL to learn databases.
  • Learn the paradigms of database design in textbooks, 1NF, 2NF, 3NF,…
  • Learn about database storage, triggers, views, indexing, cursors, etc.
  • Learn SQL statements and understand various concepts of table joins (seeDiagram of SQL Join“)
  • Learn how to optimize database queries (seeMySQL optimization“)
  • Practical tasks: Design a forum database, at least satisfy 3NF, use SQL statements to query the latest articles of this week, this month, the articles with the most comments, and the most active users.

5. Some development tools

  • Learn to use SVN or Git to manage program versions.
  • Learn to use JUnit to unit test Java.
  • Learn the coding standard or coding guideline for C and Java. (I wrote a very simple article about the C language N years ago – “Programming training”, you can look up such things online, a lot).
  • Recommended readingCode Daquan“”refactor“”clean code

Advanced in-depth

1. C++/Java and Object Orientation

I personally think that learning C++ well, Java is just a little effort. But the learning curve for C++ is quite steep. However, I think C++ is the language that needs to be learned the most. See two interesting articles “C++ Learning Confidence Map” and”Learn C++ in 21 Days

  • Learn(MIT Free Course) C++ Object Oriented Programming
  • read my”How to learn C++ wellThe books recommended in “At least twice (if your understanding of C++ can be as deep as I wrote “C++ virtual function table analysis” or “C++ object memory(superior)(Down)”, or “C/C++ trap of returning inner static members“That would be very good)
  • Then reflect on why C++ does this and Java doesn’t? 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:
    • Implement a BigInt in C++ that supports 128-bit integer addition, subtraction, multiplication and division operations.
    • Use C++ to encapsulate the capacity of a data structure, such as a hash table.
    • Wrap and implement a smart pointer in C++ (be sure to use templates).
  • Design Patterns“Must be read once, twice or more, and think about the application scenarios of these 23 modes. Mainly two points: 1) favor composition over inheritance, and 2) favor interface over implementation. (also recommendsIn-depth understanding of design patterns“)
  • Practical tasks:
    • Implement a memory pool using the factory pattern.
    • Use the strategy pattern to make a class that aligns text files to the left, right and center.
    • Implements a command line calculator using command mode with support for undo and redo.
    • Use the decoration model to implement a hotel’s room price pricing strategy – peak season, service, VIP, tour groups, and other factors that affect the price.
  • Learn the usage of STL and its design concepts – containers, algorithms, iterators, functionons. If possible, please read its source code.
  • Practical tasks:Experiment with various skills in object-oriented, STL, design patterns, and graphics programming with the Windows SDK
    • Make a game of Snake or Tetris. Different levels and difficulties are supported.
    • To be a file browser, you can browse the files in the directory, and can perform different operations on different files, text files can be opened and edited, and executed files can be executed, mp3 or avi files can be played, and picture files can be displayed.
  • Learn the design of some class libraries in C++, such as: MFC (see Mr. Hou Jie’s “In-depth understanding of MFC》), Boost, ACE, CPPUnit, STL (STL might be too hard, but it would be great if you could understand the design patterns and designs in it, if you could dig into theCopy-on-write technology of STL string class》That’s very good, ACE needs a strong system knowledge, see “Strengthen the understanding of the system” later)
  • Java is a true object-oriented language, with as many design patterns as possible, Java is the best language for learning object-oriented design patterns (seeDesign Patterns in Java).
  • Recommended readingEffective Java” and “Java puzzles
  • Learning Java framework, there are many Java frameworks, such as Spring, Hibernate, Struts, etc., mainly to learn Java design, such as IoC.
  • Java’s technology is also rotten, focusing on learning J2EE architecture and JMS, RMI, and other message passing and remote calling technologies.
  • Learn to use Java to do Web Service (The official tutorial is here)
  • Practical tasks: Try to build a remote invocation program of a Web Service with a network under the Spring or Hibernate framework, and pass messages through JMS between the two Services.

Neither C++ nor Java can be learned in a short period of time. C++ is very deep, and Java is wide. I recommend choosing one of the two. My personal learning experience is:

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

2. Strengthen system understanding

Important to read the following books:

  • The Art of Unix Programming“Understand the design and development philosophy, ideological and cultural system, principles and experience in the field of Unix systems. You will definitely have a feeling of enlightenment.
  • Unix Network Programming Volume 1, Sockets“This is a book that you will understand network programming after reading it. It is important to note the difference between TCP, UDP, and the multiplexed system calls select/poll/epoll.
  • TCP/IP Explained Volume 1: Protocol– This is a book that you can be a cyber hacker after reading it. Understand the working principle of Ethernet, understand the TCP/IP protocol, working principle and how to tune TCP.
  • Practical tasks:
    • Understand what is blocking (synchronous IO), non-blocking (asynchronous IO), multiplexing (select, poll, epoll) IO technology.
    • Write a network chat program with a chat server and multiple chat clients (the server uses UDP to Multicast or Broadcast some or all of the chat clients).
    • Write a simple HTTP server.
  • Unix Network Programming Volume 2, Interprocess Communication“Semaphores, pipes, shared memory, messages, etc. IPC… These techniques may seem a bit old-fashioned, but they are still worth knowing.
  • Practical tasks:
    • Mainly practice various methods of IPC into program communication.
    • Try to write a pipeline program, the parent and child processes exchange data through the pipeline.
    • Try to write a shared memory program, two processes exchange a C structure array through the shared memory.
  • Learn”Windows Core Programming“This book. Master CreateProcess, Windows threads, thread scheduling, thread synchronization (Event, semaphore, mutex), asynchronous I/O, memory management, and DLL.
  • Practical tasks:Use CreateProcess to start a Notepad or IE and monitor the running of the program. Implement the simple HTTP service I wrote earlier with a thread pool. Write a DLL hook program to monitor the closing event of a specified window, or record the keystrokes of a certain window.
  • With the basics of multi-threading, multi-process communication, TCP/IP, sockets, C++ and design patterns, you can look into ACE. Use ACE to rewrite the above chat program and HTTP server (with thread pool)
  • Practical tasks:With all the above knowledge, try
    • Write a server to transfer large files to the client, requiring more than 80% of the 100M bandwidth. (Note that disk I/O and network I/O may be very problematic, think about how to solve it, and please pay attention to the maximum unit MTU of network transmission)
    • Understand the working principle of BT download and simulate the principle of BT download in a multi-process mode.

3. System Architecture

  • load balancing. HASH type, pure dynamic type. (You can search for some on Google ScholarArticles about load balancingread)
  • Multi-layer distributed system – client service node layer, computing node layer, data cache layer, data layer. J2EE is a classic multi-layer structure.
  • CDN system – Nearest access, marginalized content.
  • P2P system, study the algorithms of BT and eDonkey. for example:DHT algorithm.
  • Server backup, dual-machine backup system (Live-Standby and Live-Live system), how do two machines monitor each other by heartbeat? Cluster master node backup.
  • virtualization technologyUsing this technology, the operating system can be switched or reconfigured and deployed as an application.
  • LearnThriftbinary high-performance communication middleware, supports data (object) serialization and various types of RPC services.
  • LearnHadoop. The core design of the Hadoop framework is: MapReduce and HDFS. The idea of ​​MapReduce is widely circulated by a paper by Google. In a simple sentence, MapReduce is “decomposition of tasks and aggregation of results”. HDFS is the abbreviation of Hadoop Distributed File System (Hadoop Distributed File System), which provides underlying support for distributed computing storage.
  • To understandingNoSQL database(some say it might be aOverhyped Technology), but because ultra-large-scale and high-concurrency pure dynamic websites are becoming mainstream, and SNS websites have rigid requirements such as real-time in the process of data access, which makes NoSQL databases gradually become the focus of attention. And there is a great trend to replace relational database and become the mainstream data storage mode in the future. At present, there are many NoSQL databases, most of which are open source. The more well-known ones are: MemcacheDB, Redis, Tokyo Cabinet (upgraded version is Kyoto Cabinet), Flare, MongoDB, CouchDB, Cassandra, Voldemort, etc.

After writing so much, looking back on it, I feel quite a sense of accomplishment. I hope you will not be frightened. I have been studying continuously for the past ten years, and I am also studying today. Life is a process of continuous learning and leveling.However, there must be omissions and mistakes, and I hope you can add and correct them.. (I will update this article from time to time based on your feedback) Welcome to my Weibo (@left ear mouse) and twitter (@haoel) communicate with me.

—– Updated 2011/07/19 —–

1) Some friends wonder why I said web+mobile at the beginning of this article, but did not mention iOS/Android front-end development later. Because I have a feeling in my heart that UI on mobile devices will eventually be replaced by Javascript too. You can take a look at google+ on your iPhone or Android and you’ll see.

2) Some friends say that I have too many things here to learn for the sake of learning, and I agree very much. I also said earlier in the article to think about it. In addition, don’t think that these things I am talking about are some new technologies, more than 95% of this guide is all basic. And it’s all tried-and-true basic technology. It’s the technology that lets you know everything, and it’s the technology that allows you to find a good job.

3) Some friends say that after learning these things, it is 40 years old, it is better to think about how to make money. I want to tell everyone, firstly, I am not yet 40 years old this year, secondly, there is no limit to learning, and thirdly, I don’t think it is difficult to earn money, and the difficulty is how to make you worth so much money? Whether it’s part-time work or starting a business, what makes your own value and your company’s value more valuable? I dare not say elsewhere, for Internet or IT companies, technical strength is definitely one of them.

4) A friend said that technology is a tool and should not be so obsessed. There is nothing wrong with this sentence. Sometimes we need to raise our heads to look at things other than technology, or we don’t think about it when we make technology. Why there is this technology, why not something else, the problem is not the technology, the problem is that we die, read dead books, and become tech nerds.

5) For NoSQL, it is relatively popular recently, but I am a bit conservative about it, so I just say that I understand it. For Hadoop, I think it has huge potential in distributed systems, so it needs to be learned. For relational databases, it is indeed a very important thing. This is my negligence and is added in the original text.

(End of the full text, please indicate the author and source when reprinting)

Share your love