Project ideas to become good at C++

前端 未结 5 1578
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 22:01

I want to get into C++ team at work. Their job is to write CGIs in C++ (mainly but not limited to). I know basic C++. Reading the list at C++ book guide question on SO, I\'ve go

相关标签:
5条回答
  • 2021-02-01 22:18

    Let me add to your list of reading material; the C++ FAQ Lite is absolutely the best resource for learning the ins and outs of C++. It is useful both as a reference for old timers and as an introduction to beginners. I would strongly recommend reading as much of it as you possibly can, and try small examples that demonstrate each feature mentioned before joining an actual project.

    Once you feel somewhat comfortable in the language, then I would recommend taking a look at Github and seeing if there are any C++ projects that are in need of some help. As for the computer generated imagery or the common gateway interface, both of these are language agnostic. These can be written in any programming language, though different programming languages will have different existing libraries for handling them. I suggest you read up on the subject to better understand the standard/algorithms (depending on which of the two you had meant). Once you are more familiar with the subject, you should be in a better position to understand the documentation of relevant libraries.

    As for the development environment, I find that Ubuntu is the easiest one to configure, because almost all setup can be reduced to a series of apt-get install commands. For example:

    sudo apt-get install build-essential
    

    Regardless of which OS you use, you will probably want to build and run your code in a predictable, reproduceable environment. I should also point out that the environment that you develop on does not need to be the same as the one on which you actually build and run your code. For example, you could write all your code on Mac OS X, but build and execute your code in a Docker container that is running an Ubuntu instance with your preset, reproduceable build/run configuration.

    In terms of resources to implement CGI in C++ (and for other code), please check out the C++ resources page on my website. It lists several tools for networking, computer graphics, and other C++ tasks, as well as general purpose libraries such as Boost and Qt.

    0 讨论(0)
  • 2021-02-01 22:22

    in my opinion if you make some small project using

    • http://www.boost.org/doc/libs/1_41_0/doc/html/thread.html
    • http://www.boost.org/doc/libs/1_43_0/libs/spirit/phoenix/doc/html/index.html
    • http://www.boost.org/doc/libs/1_43_0/libs/numeric/ublas/doc/index.htm
    • http://www.boost.org/doc/libs/1_42_0/doc/html/proto.html

    you can get into the advanced C++ topics like expression templates. the project even does not have to do anything useful, as long as you are able to put pieces together to produce some output.

    if you know some C++, you can have a lot of fun pushing language to limits with phoenix alone.

    as far as ideas, CGI is likely to be heavy in mathematics, try for example writing parallel integration algorithm using expression templates.

    for example, you can create syntax like this:

    integrate(x*x + sin(x), 0, 100, threads(4));
    
    0 讨论(0)
  • 2021-02-01 22:24

    Read the book 'Effective C++' by Scott Meyers. It's excellent, and will give you good advice on best practices and stuff to avoid.

    0 讨论(0)
  • 2021-02-01 22:28

    answer to the title of the question :) assuming C++03

    From Bjarnes website:

    1. New learning

    2. Principles and Practice Using C++ (Should give ideas about short programs/projects)

    3. Learning and teaching C++

    And yes, have a good reviewer by your side if you have to learn good C++. Keep a copy of the relevant standard handy (open-std.org)

    0 讨论(0)
  • 2021-02-01 22:34

    The best way to become better at C++ is... writing C++ code. Start with a simple raytracer without any external dependencies (just write output to a PPM file).

    1. I think this is an interesting enough problem and will let you get started with the language core,
    2. The lack of dependencies will reduce distractions with potentially complex third-party library idioms which you can't appreciate yet and annoying things like libraries and linking. Plus, you will have less C++ quirks blow up in your face.

    Build on that after you have more experience. Go back, refactor your code, add more complex features, third-party libraries (e.g. write a JPEG output, start using bits of boost, like smart pointers).

    Rinse, repeat.

    0 讨论(0)
提交回复
热议问题