Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Meaningful Code (WomenWhoCode - September 2018)

Yannick Lemin
September 26, 2018

Meaningful Code (WomenWhoCode - September 2018)

In today's crazy world of software development, we sometime tend to forget that coding is a craft and the code must stay meaningful in order for it to be good.

Here is my view on how we can try to make meaningful code, and hopefully that will help some people along the way.

Yannick Lemin

September 26, 2018
Tweet

More Decks by Yannick Lemin

Other Decks in Technology

Transcript

  1. What makes code Meaningful? • Understandable (even after 6 month)

    • Shareable • Robust • Clean • Reusable • …
  2. 2. Naming • Spend enough time • In doubt: ask

    the team • You can always refactor later
  3. 4. Write readable code • Write concise, short and clear

    functions • Name them right (remember … Naming is?) • Will serve as documentation
  4. 5. Careful with comments in code • Avoid comments as

    much as possible • UNLESS YOU ARE WRITING A PUBLIC API
  5. 6. Pay attention to Warnings • They are there for

    a REASON • Get rid of them as much as possible • If you keep some, make sure you understand the potential consequences • Use Lint tools
  6. 7 . Testing :( • Testing takes time • Tests

    must be maintained • Tests can be complicated
  7. 7 . Testing :) • Tests are a very useful

    documentation • Tests are a safety net during refactoring • They help with the development of unit features (regex, string formatting, calculations, etc) • When the tests are launched, nothing will be forgotten
  8. 8. Refactoring • Refactoring is part of the development process

    • You won’t write the perfect code the first time • Only write the code that is needed
  9. – Uncle Bob Martin “Refactoring should never be a task

    on the board, it is never something that is added to an agenda. It is always part of the development process”
  10. 10. Code Review • Share the knowledge • Learn things

    • Give your opinion • Question the decisions • Share the love
  11. Summary • Work in a team (THE TEAM IS ALWAYS

    RIGHT!) • Naming is Hard! • Write code for others • Make that code readable • Avoid comments • Pay attention to warnings • Automated testing is AWESOME • Refactoring is part of the process • Use one language • Code Review is cool • Go to events