Skip to content

Get familiar with C++ #2

Open
Open

Activity

  1. self-assigned this
    on Mar 29, 2018
  2. codeSG commented on Mar 29, 2018

    @codeSG
    OwnerAuthor

    Please find the link to the detailed video reports.

  3. codeSG commented on Mar 30, 2018

    @codeSG
    OwnerAuthor

    Video: “All Your tests are Terrible” (-T. Winters & H. Wright)

    Everyone must WRITE TESTS and they must follow 5 properties: Correctness, Readability, Completeness, Demonstrability, and Resilience." There are some Do's and Don'ts to be followed to write better tests.
    A test should be like a novel: introduce the setup, what is your initialization, your test should progress through actions, concludes with a clear result, and in all, it should make sense."

  4. codeSG commented on Mar 30, 2018

    @codeSG
    OwnerAuthor

    Video: “STOP TEACHING C” ( -- Kate Gregory)

    It is very common that people take C++ as an add-on to the old-C, which is logically true also. But this doesn’t mean that to learn C++; one must know C in advance.
    In my opinion, also I refer to study C++ first, as C comes with some complex syntax, format specifiers, pointers, etc., which might be hard to understand as a beginner, and it lowers down the interest of the learner and set C++ image as more harder to learn. This way of learning lays the foundation to make harder things stay simple. It makes better C++ programmers, and they will enjoy the learning more.

  5. codeSG commented on Mar 30, 2018

    @codeSG
    OwnerAuthor

    Video: “The Essence of C++” (-Bjarne Stroustrup)

    What is C++?
    A light-weight abstraction programming language. It takes 'direct mapping to hardware' from "C" and 'Zero-overhead abstraction' from Simula. It comes with better resource management, error handling, smart pointers, garbage collector, class hierarchies, generic programming(templates), built-in algorithms and lambdas functionality.
    I would also recommend "A Tour to C++" to everyone who wants to know modern C++ (in brief).

  6. codeSG commented on Mar 31, 2018

    @codeSG
    OwnerAuthor

    Video: "Back to Basics: Modern C++ Style" (-Herb Sutter)

    Some pro tips to use modern C++ features over C++98:

    • "Defaults" means Don't overthink and Don't optimize prematurely.
    • Prefer range-for --> for(auto &e : c)
    • Use _Smart Pointer_s effectively but still use raw Non-owing */& also.
    • Write make_unique and make_shared instead of new or delete.
    • Prefer auto var = {init}; by default on variable declarations.
    • Use forwarding reference(&& only for parameter/ return types. (new stuff)
  7. codeSG commented on Mar 31, 2018

    @codeSG
    OwnerAuthor

    Video: "STL Algorithm in action" ( -Michael VanLoon)

    • Use STL algorithms as they are more efficient & cleaner than a handwritten loop, its side-effects are contained in a clear interface and are less likely to fail under non-obvious conditions.
    • for_each and Transform applies an operation on each element of the sequence where for_each is non-modifying while Transform is mutating.
    • Accumulate is a non-modifying numeric operation, which carries a value rather than a func. object.
    • all_of and any_of are like AND (True if all elements follow certain criteria) & OR search operation.
    • remove_if is like a lambas func. which erase certain elements from a container, following a condition.
    • Parallel algorithms are soon to come, will be more efficient than sequential one.
  8. codeSG commented on Mar 31, 2018

    @codeSG
    OwnerAuthor

    Video: "Writing good C++14" (- B. Stroustrup)

    C++ is advancing day by day, Presently it has become easier to write and maintain with less amount of code and even it runs faster as compared to C++ at early stages.
    As we all hate coding rules, C++ offers coding guidelines which are prescriptive, flexible and rationale.
    Some core rules are mandatory like to avoid resource leaks, dangling pointers, misusing pointers for range errors and nullptr dereferencing. Avoid overusing "Smart pointers" unless there is ownership transfer or sharing(quite new stuff). There are too many rules, to remember, so there are tools who knows the rules and will point you to the relevant one when needed.

  9. cvvergara commented on Apr 23, 2018

    @cvvergara

    @codeSG
    Task completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions