C/C ++ programmers must be familiar with open-source projects.

Source: Internet
Author: User

As an experienced C/C ++ programmer, you must have handwritten code for various functions, such as database access and network communication, the classes that encapsulate log operations, the classes that encapsulate file access, the UI library, and so on have also been applied in actual projects. But let's look back and think about it, in fact, the code you have previously written can only be used in a specific project or in a specific environment. For yourself, to apply the Code in different projects, you only need to copy the code, you can change it because you are familiar with the code you write. The problem is, when you use these encapsulated libraries for others, is it convenient for others to use them, Is it common for cross-platform platforms, and the performance is good enough,
Is multithreading supported? Is the function powerful enough? It can be applied to various needs. If you have done all of the above, it proves that you have spent some time on this database, and have been continuously improved and optimized.

In daily development, as a programmer, there is no need to re-develop many things and you can use them directly. After all, it has been more than N years since the 21st century. We do not have to re-invent the wheel (it is undeniable that we can learn a lot in the process of inventing the wheel, so I came here ).

Next, I want to help new people with my years of development experience and where to write.

I. Network

The network library must master ACE and libevent, a heavyweight network library and a lightweight network library. Think about it. Now the program does not need a network. If you do not understand the network, you will be unable to proceed. The premise for getting familiar with these two open-source libraries is that you must understand the principle of socket. The recommended good book is UNIX network programming. You can simply read this book, you don't need to worry about other windows Network Programming. Because of network programming, you have learned the Berkeley socket, and you can perform network programming on any platform, you do not need to learn network programming in windows, because the network in windows is also developed from Berkeley socket,
If you are studying windows Network Programming, you have to study network programming on linux and unix that day. No.

Ii. Database

For databases, open-source Mysql and open-source PostgreSQL only need to understand one of them. commercial databases can master one Oracle, and file databases can master sqlite. However, please note that you should not be confused by the above database name. The essence of the database is SQL statements. You must understand the basic principles of the database, be familiar with the SQL language, and understand database optimization, stored procedures. I understand the principles of the database and can easily master any database, so I don't care whether it is Mysql or Oracle.

Iii. Log operations

We recommend that you be familiar with the log4cpp logstore for log operations. It supports multiple threads and redirection of logs to the network. The log functions you can think of are all available.

Log, one is to facilitate troubleshooting and easily record some situations where the program is running. This is required.

Iv. Management Background

As we all know, writing a program is intended for other users rather than for their own purposes. Therefore, in terms of ease of use of the program, it is important to give the other party more management interfaces that can be directly viewed. Provide a web management interface for the program, so that users can log on to view various information about the program.

Here I have a convenient http implementation for web backend management, which can be easily integrated into applications. Enter the listening port in IE to view the program status. The Code has not been carefully organized. If you have any need, you can leave a message to me and send it to everyone.

5. Read the configuration file

All programs must have configuration files to facilitate the configuration of some projects and provide flexibility for the program. Therefore, write programs must have encapsulation classes for reading configuration files.

6. Memory Pool

All processes need to allocate memory. For C/C ++, It is very challenging to allocate and manage memory.

We recommend nedmalloc, an open-source memory pool. Nedmalloc is a cross-platform high-performance multi-thread memory allocation library, which is used by many databases.

VII. cache Library

As we all know, memcache is the most used cache library. It is particularly useful for database development.

8. Script

Script is a very interesting thing and has many functions. In fact, we only need to write a script to complete it. The code is small and the development speed is fast.

The scripts that must be mastered are commonly used in perl, an ancient language, but have powerful functions. I can assure that the. net and java jobs can definitely be done by perl. C is competent, and perl is not necessarily competent. As a script language integrated with linux and unix systems, perl must be learned.

Lua language, which is widely used in the gaming industry. It is not recommended.

Python script, which has powerful functions and is recommended.

The above are common functions used by all programs.

In different application fields, you need to master different open source libraries, such as game development. You may need to master the Open Source UI library CEGUI and the Open Source 3D engine OGRE.

Distributed development may involve distributed file system libraries.

I will introduce it to you today, and I will gradually improve it.

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.