C++ Aha! Moments



  • Here's what I can think of, hopefully without duplicating ideas. Some are "Aha!", others "Oh, of course!", and there will be the "Duh!" items. Each one is responsible for taking my knowledge and experience to the next level.

    On C++, understanding the simple stuff:

    * templates... which then lead to STL, boost, and others
    * const variable vs. const function, and why we use mutable
    * using anonymous code blocks { } to localize variables
    * why references are better than pointers in many cases

    On Algorithms:

    * Creating a ring buffer in video memory to simulate unlimited 1 dimensional scrolling, my first real video effect
    * Using recursion instead of iteration to vastly simplify problems
    * Using design patterns, which I've always used without even knowing, starting with MVC
    * Lazy lists, as explained in Perl

    On platforms:

    * Finally understanding Win32 and all its crazy disorganized array of functions, #defines, and special types.
    * Finally understanding how a native DLL works
    * Finally understanding COM (some of it anyway)
    * Finally giving in to adopting .NET and C# as a usable platform that doesn't suck

    On attitudes:

    * You don't know everything. Someone always knows more. Your ignorance to this fact will bite you later in life.
    * However, you probably know more than most others and don't realize it yet. There are tons of unqualified people out there competing for your job.
    * Be creative, inventive, and don't stop learning something new. Don't let your workplace pigeon-hole you into thinking you can only succeed by going into management, or that you're not smart enough for the job. If you give in, you find yourself 5 years later thinking "I could've done X, Y, or Z but I didn't, and now it's too late".
    * Keep your work/life balance in check at all times. Don't work crazy hours just for the money. If even on the weekend, you don't have the drive to work on your code, web site, or some other project, you're probably working too hard.



  • I might add one (a big one) on algorithms:

    The first time I came across a struct declaration of a linked list item (at the time, I neither knew C++ nor did I understand the concept of pointers). Went something like this:

    struct Item {
        int data;
        Item* next;
    };
    

    Although I didn't know C++ or pointers I immediately understood what the code was good for and what the deeper meaning of it was.

    That was quite some epiphany.



  • - Objektorientierung im allgemeinen und im besonderen
    - Die Erkenntnis, dass gute Schnittstellen immer minimale Schnittstellen sind
    - Das Verständnis, dass Templates Abhängigkeiten reduzieren (obwohl alles im H-File steht!)
    - Die Trennung von Stream und Device in der iostream-Library
    - boost.spirit
    - Wer ist Oha! ?

    Gruß
    Werner



  • When I understood that C++ ist only a PDF document and not a compiler or IDE.



  • Typlisten *träum*



  • krif schrieb:

    When I understood that C++ ist only a PDF document and not a compiler or IDE.

    😃 👍



  • Hi,

    also sich selbst auf den 2. (“The Most Important C++ Books...Ever”) und 3. (“The Most Important C++ People...Ever”) Platz zu setzen, zeugt schon von gesundem Selbstbewusstsein. 😉
    (nicht, dass ich ihm damit inhaltlich widersprechen wollte)

    Gruß,

    Simon2.



  • Simon2 schrieb:

    Hi,

    also sich selbst auf den 2. (“The Most Important C++ Books...Ever”) und 3. (“The Most Important C++ People...Ever”) Platz zu setzen, zeugt schon von gesundem Selbstbewusstsein.

    Und wenn dus genau nachgelesen hast dann weisst du auch dass er dort keine Platz 1-5 Unterscheidung macht sondern einfach nur die Top5 in chronologischer Reihenfolge auflistet 🙂

    Was mich fasziniert ist, dass der Mann nie in der Produktion gewesen ist sondern sich als aussenstehenden Beobachter sieht.

    __________________________

    My Aha! Monments:
    - The use of policy classes
    - The virtuosity in application of templates and operator overloading with boost::spirit parsers
    - The curiously recurring template pattern (CRTP)



  • pumuckl schrieb:

    ...
    Und wenn dus genau nachgelesen hast dann weisst du auch dass er dort keine Platz 1-5 Unterscheidung macht sondern einfach nur die Top5 in chronologischer Reihenfolge auflistet 🙂

    Habe ich gelesen ... und war deswegen umso erstaunter !

    Gruß,

    Simon2.



  • Leute, der Thread darf bald sein einjähriges Jubiläum feiern. Guckt mal aufs Datum 😃


Anmelden zum Antworten