Giter Site home page Giter Site logo

evaroets / readable-code Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 10 KB

This repo contains all the files for the readable-code challenge, part of BeCode's Full Stack Junior Web Developer training.

Home Page: https://evaroets.github.io/readable-code/

PHP 100.00%
php refact readable-code

readable-code's Introduction

Readable code ๐Ÿ”

Watch the result of this project >> here

๐ŸŽฏ Objectives

  • To be able to make decisions about when and how to refactor less readable code.
  • To be able to adhere to known PHP code standards like PSR12.
  • To be able to think critically about code principles and not follow them blindly.

โœ”๏ธ Specifications

๐ŸŒฑ Must-haves

  • Have a look at this code and try to understand what it does.
  • Read the following article Jason McCreary on writing clean code
  • Have the code follow a consistent writing standard. For now, we'll roll with the widely used PSR12.
  • Rewrite the file in a way that would improve readability for you.
  • Don't install PHP codesniffer (yet).
  • When you are done, discuss your solution in groups of two.

๐Ÿ’ก Tips

  • Don't aim for perfect all the time, aim for good enough / continuous improvement.
  • When refactoring, focus on one section (or one thing) first (e.g. a specific function or clear naming).
  • Work in small steps. Write these as separate to-do's if you like. Test after every step and use small commits when you're sure everything still works.
  • When in doubt what approach is better, think "what would help me to understand this quickly if I see it again a year from now".
  • Be critical: if you think a certain tip isn't beneficial to your code, ignore or tweak it.
  • When getting used to a standard, don't jump to auto-rewrites immediately. Get used to write code following the standard yourself first.

๐Ÿ“– Further reading

  • Base Code field guide (paid, but first chapters are free)
  • PHP code sniffer + (your IDE: PHPStorm, VScode, ...)
  • Code style guide of your company

readable-code's People

Contributors

evaroets avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.