In which project would you advise me to speed up with C ++

I know that C ++ is a very complex language that requires many years of practice to master.

Given this, you know a small project (about 1k loc) that checks all the main features of C ++ (inheritance, pointers, memory management, etc.).

The fact is that I am a Java / Python programmer, and I really want to learn C ++, so I have been learning C ++ for some time, but have not tested anything that I learned outside of the small exercises.

I want to take all this knowledge and put it into practice.

+6
c ++ project
source share
14 answers

By doing this, you will get many bad habits. It is much better to take an internship in a company that has high competence in C ++ development and trains under the guidance of.

C ++ looks like a grenade without a protective pin - it looks cool, and you heard that all the "real professionals" use it, but you do not know when it will explode. A huge number of opportunities that can be used for good or evil, not knowing whether it is good or evil. This is why the manual should be here.

+11
source share

Memory manager. This should make you think:

  • Free Store Management
  • pointers (of course!)
  • inheritance (you want your driver code to use this)
  • templates (another way to pass the manager around is driver # 2)
  • designing user data structures (memory block)
  • efficient use of standard containers.
  • (moving, defining empty blocks, defragmentation)
+8
source share

Effective C ++ and More Effective C ++

In addition, select the (small?) Personal project that you want to write, and do it in C ++. You are not going to learn C ++ by reading a project with 1000 lines.

+6
source share

I am not sure of anything that checks all the basic functions. There are a lot of them, and some of them are rarely used together (templates and virtual functions come to mind. Both reach a form of polymorphism, so you often use one or the other depending on your needs.)

A suitable project in which it touches on all the important functions can be something simple, for example, writing the right container class, similar to std :: vector or std :: list. Ensure exception safety, iterator validity, appropriate time complexity for all operations, and every other requirement specified in the standard.

The problem with this, as well as with most other projects, is that you will not know when you are done. Creating a mutable array can take 50 lines of code and 20 minutes of your time. And then the beginner will think that he did it. To make it safe for exceptions, you should be able to identify all the places where the class can be thrown into an inconsistent state except.

This is a kind of common problem with C ++. It is easy enough to think that you will receive it, and the compiler, of course, will not notify you of those aspects that you forgot to process. So you might think your code is perfect, and yet it will break into all sorts of odd special cases.

As sharptooth said, writing a code in its own way is risky for a language as dirty as C ++. It's easy to fall into the trap of "I wrote the code, it compiles and seems to be running, so it is correct." Of course, you can publish your code here or on other sites for review, or maybe just replenish your coding by reading documents for up-to-date high-quality C ++ code (most developer libraries, as a rule, have exhaustive documentation that states as a rationale for various design decisions, and how it safely handles all the weird special cases that tend to occur in C ++. Of course, the C ++ standard itself would be another great resource. In any case, it can elp you determine what problems to look for)

+5
source share

When I studied C ++, I used it to write my own language for writing adventures in the style of the Colossal Cave. Like in most computer languages, he never saw the light of day, but he taught me a lot of C ++.

Whatever you choose to avoid when learning C ++ is graphical programming, which is a trap that depletes all your thoughts and is likely to teach you bad C ++ habits in the process.

+4
source share

I would recommend creating a text game. It really helped me strengthen my C ++. It doesn't take too much time and you can use all the features you want. Create your own game. This is more fun.

Another great idea is to write a simple math library supporting matrixes of vectors, etc. But with today's libraries, this is only academic use.

+3
source share

To learn C ++, it’s useful to take a look at a lot of well-written C ++ code. I think the Qt library is not bad for this, so I suggest: write a Qt application.

See how they use C ++ and create their own graphics components in a similar way.

Ideas: - Stock chart widget widget that connects to one of the financial websites and resets history data. - Simple Excel like a spreadsheet widget.

+3
source share

Depends on what area you want to work in. But nothing worth doing right is included in less than 1000 lines of code.

If you are planning on writing games, try writing a Tetris clone.

If you think that you will use sockets, etc., it will help to create a simple client / irc.

Do you have a specific itch that needs to be scratched? When was the last time you thought, "That sucks, could I do better?" Can you do better?

+2
source share

I would recommend writing a Tetris clone. You can learn a lot of C ++ concepts with this and learn a 2d library like SDL or maybe OpenGL throgh SDL.

It is always good to have a project with visual results, and at the end you can reproduce it.

+1
source share

There seem to be two topics emanating from the answers:

  • You need to choose a project that can include more than 1K LOC to get real project experience.

  • You also need to contact an experienced C ++ developer who will help you solve problems and avoid language related errors.

You can get around both of them by downloading sourceforge.net and sign up for help with an existing C ++ project. Until you mind that your code is open source, you should be able to find an existing project to learn from experienced developers who can help by looking at your code and making recommendations.

+1
source share

Interactive World: A Matrix where each position can be a Void or a Being. A creature is something with several attributes: age, time, gender, kinship, etc. Capable of several interactions: fights, sex and children, friendship, etc. Some have special skills, depending on their fathers (inherited professions) ... like the ability to kill, the ability to produce food, etc. The possible outcomes of these interactions and skills are changes in self attributes or the creation of offspring (when possible) or changes in neigbor attributes.

At each iteration, print the matrix in the form of characters / numbers on the console (depending on the attributes, etc.), starting with the biblical iteration 0 (the initial conditions of your choice ... you are God here).

Now you have a real template simulator and learned something about inheritance, polymorphism, virtual functions, creating class instances, etc.

0
source share

I would suggest that a simple text editor would be a reasonable target.

This is a problem area that you understand well.

You have problems with memory management, problems with reusing library classes (stl / curses?), Problems with pointers, and lots of parameters that can use derived classes.

For polymorphism, perhaps you can read the editor from the keyboard or paste commands from a text file.

There is another good ... work with files.

You do not need to cross the platform. You do not need to open it. You do not need to show it to anyone. You don’t even have to finish. This may be an exercise just for you.

0
source share

If you are studying a book, it should have many thoughtful exercises that you can implement and learn. Also check out the university sites and their lab / C ++ assignments.

0
source share

Google chrome

-2
source share

All Articles