Seven Thoughts on Programming Learning

original
2012/07/12 12:38
Reading number 349

The contributions of the ancient Chinese thinker Confucius include his opinions on many things, from ordinary fortune cookie messages to obviously absurd jokes, such as "Man who stand on toilet is high on pot.".

He once said a phrase that is helpful for people to learn programming:

  • I hear and I forget
  • I see and I remember
  • I do and I understand

For most people, sitting in the classroom is far from the ideal way to learn programming. It may be helpful to read books that introduce programming concepts, but it is not comparable to the practical skills obtained by effectively reading and thinking about other people's source code until understanding.

However, there is really no better way to accumulate programming skills than to like to write programs by yourself. You can only learn a little by reading, but you can gain a lot by programming. Find the things you want to simplify, and write some program code to make them easier to handle through automation.

Unfortunately, figuring out what can be done can sometimes be the hardest part of programming learning. Based on personal experience, the answer seems to be that you can do it in a moment rather than in a flurry, and find solutions to problems by writing programs through insight.

When seeking this insight, because people who are just starting programming usually have very limited knowledge, drawing a flowchart can help you prepare in advance in the way you like. Please do this, at least at the beginning, including figuring out the process of your daily use of computers, and simplifying and drawing the most used part. Once you've sorted it out, focus your early learning on programming skills that are particularly useful in those situations. Such opportunities are scarce to some extent. You may need to change the computing environment to provide such opportunities.

The most important thing to do is to find a way to motivate yourself to write code.

Here are some suggestions on how to take action to learn programming.

1. Database Management Systems (DBMSes)

Such as PostgreSQL Oracle、Microsoft SQL Server, And Informix, a professional and durable database management system, provides script functions through stored procedures or stored functions. Perhaps the most widely recognized language options are TransactSQL used by Microsoft SQL Server and Sybase, and PL/SQL used by Oracle. PostgreSQL provides a PL/SQL like program called PL/pgSQL to extend into SQL, but it also provides a selection range of other languages, including PL/Perl, PL/Python, PL/Ruby, and PL/Tcl.

Although this programming opportunity is limited to a specific set of problem areas, if you are a DBA (database administrator) or your work involves database development reports, you will experience this is very useful.

2. Plug in

Many new computer games provide the ability to write and load plug-ins. For example, World of Warcraft provides a plug-in system using the Lua scripting language. With the popularity and wide use of Firefox, modern web browsers often provide flexible plug-in systems; In the simplest case, Firefox plug-ins are written in JavaScript. Open source browsers are often more attractive than closed source browsers in plug-in development, and the plug-in system of Chromium browser is likely to become the second goal of plug-in developers, because of Google Chrome browser's high-profile marketing strategy and unlimited licensing policy.

PurpleEndurer Note Lua programming language is a concise, lightweight and extensible scripting language. Lua is pronounced/'lua/(lu ah), which means "Luna" (moon) in Portuguese. See: http://zh.wikipedia.org/zh-cn/Lua

Many other applications have plug-ins and extension systems, which can provide ample opportunities to cultivate these rapidly developing coding skills, including some terminal emulators and console based text editors, such as Vim. (A bit of good news: I contributed some code to the urlpicker project.)

3. Practical problems

You can try to solve the problems provided by the general list in the code task, which is specially designed to provide internships for programmers. Project Euler is a popular project regardless of programming language, including "a series of challenging mathematical/computer programming problems". The Oula project has collected hundreds of questions, which generally range from easy to difficult, enough to keep you busy for a long time.

PurpleEndurer Note : For the Oula project, visit: http://projecteuler.net

Other examples include RubyQuiz, which has been popular on ruby talk mailing lists for many years. In addition, CodeKata is a small and short-lived project of Dave Thomas. Dave Thomas is one of the co authors of The Pragmatic Programmer.

PurpleEndurer Note : About CodeKata http://codekata.pragprog.com/

These options are not suitable for self-motivated exploratory learning tasks, because they can scratch your scalp. But if you find the fun in them, they can be used for programming practice education like other methods.

4. Smartphones

The biggest new craze in the application development industry is smart phone applications. This kind of device usually requires developers to use a specific language that can maximize the device's functions as an application platform, at least in an officially recognized way.

An emerging industry of smart phone development system is rising, which allows developers to write their own code in other languages that are not native to the smart phone platform, and then convert them into native language applications. Because there is no need to learn the official application development language of any specific smartphone platform, Web applications have also become a method of smartphone application development. Another solution to choose a language more than a platform is to use a device like Nokia N900, which runs the Linux system issued by Debian, and can run a wide range of software - including many software not designed for smart phones.

Books and online tutorials focusing on various methods of developing smart phone applications have emerged, especially for Android and iPhone devices. Some third-party frameworks can "compile" code written from HTML+JavaScript to Ruby or Python into "local" applications on multiple platforms, sometimes including not only smart phone platforms, but also desktop systems. Perhaps the most exciting thing about this situation is that these frameworks and related IDEs do not tend to try to solve all programming problems, which is the same as the main frameworks of excellent programming methods, such as Visual Studio and NET framework is different. This makes it possible to significantly simplify the development process by narrowing options to a manageable problem area. The result is that the software development style is very acceptable to beginners.

The disadvantage is that when learning how to program, you may have difficulty writing new smartphone applications every day. However, if your smartphone's operating system is a Unix like system (such as N900), the same gadget development project is very useful in both workstations and servers.

5. Spreadsheet

If you use a spreadsheet program with a powerful macro system, you will have a quick way to read other people's (or things's) code and write your own code. First, record the tasks that you have executed many times and usually need to take several tedious steps into a macro. Next, open the source code of the macro, read and edit it to make it more suitable for general use. This is a very limited method and will not bring much progress, but it may help you get on the road and naturally like simple script code.

The most common spreadsheet program that uses such scripts is probably Microsoft Excel. VBA used by Excel is a poor language, but if you use Excel extensively in your daily work, this may be a skill you should master anyway. OpenOffice.org uses a similar macro system in roughly the same way. LibreOffice, like Microsoft Office, provides the opportunity to learn code.

In any case, the threshold for writing programs is slightly higher than writing simple command line shell script code, because menu options and buttons need to be clicked to enable them. The cost of entry is similar to starting a new project with a major IDE in the market, but it is a "project" that has shrunk significantly. It would be a good idea to ensure that this is not only an opportunity to write scripts in the daily development environment, but also a great help to take advantage of it.

6、Unix

If you regularly use some UNIX like systems, you will have a huge advantage in finding ways to exercise your initial programming skills. UNIX provides more opportunities to use simple script automation than any other common home operating system, thanks to the great flexibility of script management on the platform. In the least complex case, an administrative script may simply save a series of shell commands to a file. On this basis, we can use simple cycle and condition structure, input and output processing, file reading and writing, and scheduled tasks to expand.

After enjoying writing simple shell scripts, spend some time learning how to use Perl Python It is worthwhile for any Unix system administrator to write management scripts with Ruby. The key skills of using these languages in the Unix environment include accessing text streams through UNIX pipes and redirects, processing command line options, reading and writing files, and searching and manipulating text using regular expressions. Administrators also want to know the common basics of programming, such as processing output, loops (or recursion in some cases), and make decisions based on clearly defined criteria by using conditional judgment structure programming.

Writing Unix command line tools is a fertile ground, and there are many opportunities to apply the great power of scripting languages to programming. Due to the flexibility and simplicity requirements of management script development, the scope of writing tools can range from the simplest examples of some useful tools to powerful server processes, and even large-scale parallel task automation, load balancing, heuristic filtering, and some other interesting problem solving jobs. These problems have aroused the interest of the best programmers in the world.

Although almost all general operating systems have some ability to use management scripts, quite a few of them are used for narrow purposes, while others are relatively balanced. Unix is superior in terms of application conditions of management scripts, because Unix like systems such as major Linux distributions and BSD Unix systems share the same basic running environment design, They can all benefit from the portability between the management script and the script platform - as long as you write these scripts according to the portability requirements (for example, by using sh or Perl instead of bash, choose the system standard sysctl value instead of the proc file system of the data source).

These works are also applicable to other languages except very high-level, dynamic and interpretive languages. C, C++, Haskell, Objective-C, Objective Caml, And a large number of other options are just suitable for writing various simple Unix tools. For many of these languages, even if you want to complete a simple project like a small management tool, you must learn a wider range of skills, which is higher than languages like Perl, Ruby and Bourne shell. However, compared with GUI application development, system programming, and other frequently used tasks (especially those on other platforms), these tasks are much less arduous for beginners of programming.

In fact, given that the Unix philosophy has provided a large number of commonly used tools for many years, these tools are strictly divided (most of them) and work well. Part of the value of UNIX like environments for novice programmers is to make full use of the power of the Unix command line environment to encourage users to think like programmers, rather than audiences.

7. Web Page

This is a dangerous suggestion. Learn programming by playing JavaScript. It's not because JavaScript It is a bad language, but because of the pursuit of dynamic user experience, the web page has been messed up by the unrestricted abuse of JavaSciprt, so it may be considered irresponsible to indulge novice programmers on the web page. There are also some positive uses of JavaScript in web pages, and it can make novices more and more interested in the idea of writing desktop applications running in browsers, which gives us many reasons to start learning JavaScript as early as possible in our programmer's career.

In fact JavaScript It is the most common and separate client-side web script, which also means that JavaScript is probably the simplest language and can be learned by reading other people's code. Find any web page with dynamic elements on the client side, then right-click and select the option to view the source code of the page. You will find that it is full of scattered fragments of JavaScript. For more complex dynamic pages, (X) HTML pages may even reference a separate. js file of pure code.

Carefully check the code before uploading it to the public access Web server; Make sure it is good. If you want more useful scripts to be launched locally, browser extensibility allows you to apply arbitrary scripts to the pages you view - and only for your personal browsing experience. Firefox Greasemonkey is an example.

Ask for feedback on the code

Another great way to improve your programming skills is to ask for feedback from experts around you and master the knowledge they share with you. They may not always agree with each other, but if you think they are respected excellent programmers, what they say can at least prompt you to think about new ideas and review old ideas in new ways.

There are many ways to ask for feedback. Here are some:

  • When starting work, choose a program language with a strong and beneficial community. For example, Ruby programming language has ruby talk mailing list, and Perl programming language has PerlMonks website. Join one of these communities (or one like it), learn the culture and best practices of the language, and get the most effective help.

  • Pair up with another programmer. Pair programming is a fashionable practice and has been respected by the rise of agile development methods. Two people work together on a project, but often only one of them actually writes code at any given time. Groups of programmers take turns writing code. When one of them enters the code, the other reads the code behind them to ensure that they all get a lot of coding time. Continuous conversation about code can help ensure that the best way to solve a given problem gradually emerges and is eventually adopted. Anyone with insight should realize the potential value of pair programming when trying to explain a problem to another person.

  • Seek mentors The places to find mentors can be programming language communities, friends or colleagues, open source software development projects, and heavyweight technical conferences. The school may be another good place to find a mentor. A mentor is a mentor who likes you, dormitory roommates and even the research team, and has a less traditional and more respectful coaching relationship. At the beginning of the programming process, one-on-one relationship with a mentor is sometimes the most valuable way to get feedback. If you are lucky enough to find a good mentor, you should take advantage of this resource and never take it for granted.
  • Create a project on a code hosting website (such as Bitbucket or GitHub). Tell your programmer friends to post it on their own Weblog or Twitter, and encourage others to read your code and provide feedback. Ensure that the problem tracking system is turned on, so that people can submit bugs or suggestions for improvement through the interactive function of the code hosting website.

In the process of practicing skills and getting feedback from experts, you should be able to learn the basic knowledge of programming in your own way and gain practical and useful experience.

Now start to write code!

Expand to read the full text
Loading
Click to lead the topic 📣 Post and join the discussion 🔥
Reward
zero comment
four Collection
zero fabulous
 Back to top
Top