Podcast
Questions and Answers
What is one of the hints for development mentioned in the text?
What is one of the hints for development mentioned in the text?
Why should developers write code in English according to the text?
Why should developers write code in English according to the text?
What is one of the reasons mentioned in the text for not committing debug code?
What is one of the reasons mentioned in the text for not committing debug code?
Why is committing commented out code discouraged according to the text?
Why is committing commented out code discouraged according to the text?
Signup and view all the answers
What do quality tools help with according to the text?
What do quality tools help with according to the text?
Signup and view all the answers
What practice significantly aids in producing clean code according to the text?
What practice significantly aids in producing clean code according to the text?
Signup and view all the answers
What is the main purpose of a repository in general?
What is the main purpose of a repository in general?
Signup and view all the answers
What should a method name reflect?
What should a method name reflect?
Signup and view all the answers
In the context of the InvoiceSimulationService, why is it not considered a 'Helper'?
In the context of the InvoiceSimulationService, why is it not considered a 'Helper'?
Signup and view all the answers
What does the text recommend if a method performs multiple tasks?
What does the text recommend if a method performs multiple tasks?
Signup and view all the answers
If you have a Team Model, what type of repository are you likely to create?
If you have a Team Model, what type of repository are you likely to create?
Signup and view all the answers
When should you put the SQL query in a Data Object Accessor according to the text?
When should you put the SQL query in a Data Object Accessor according to the text?
Signup and view all the answers
What is the suggested maximum number of lines for a method body according to Martin?
What is the suggested maximum number of lines for a method body according to Martin?
Signup and view all the answers
How can you reduce the length of a method that exceeds 15/20 lines?
How can you reduce the length of a method that exceeds 15/20 lines?
Signup and view all the answers
What does SRP stand for in the context of 'Clean code'?
What does SRP stand for in the context of 'Clean code'?
Signup and view all the answers
According to Martin, what is the problem with classes like 'LetterManager'?
According to Martin, what is the problem with classes like 'LetterManager'?
Signup and view all the answers
What suggestion does Martin give when naming classes for specific responsibilities?
What suggestion does Martin give when naming classes for specific responsibilities?
Signup and view all the answers
How can you improve the readability of your code according to Martin?
How can you improve the readability of your code according to Martin?
Signup and view all the answers
What is the exception for rearranging code in PHP for Models files?
What is the exception for rearranging code in PHP for Models files?
Signup and view all the answers
Why has the scalingo build image limit been increased from 1GB to 3GB?
Why has the scalingo build image limit been increased from 1GB to 3GB?
Signup and view all the answers
Where should Browsershot be run according to the provided information?
Where should Browsershot be run according to the provided information?
Signup and view all the answers
When should you rearrange your code in PHP according to the provided settings?
When should you rearrange your code in PHP according to the provided settings?
Signup and view all the answers
Why should you add a backslash to PHP native functions?
Why should you add a backslash to PHP native functions?
Signup and view all the answers
What is the minimum memory requirement to run a worker based on the text?
What is the minimum memory requirement to run a worker based on the text?
Signup and view all the answers
In what PHPStorm settings section should you go to auto-format your code?
In what PHPStorm settings section should you go to auto-format your code?
Signup and view all the answers
Why is running Telescope on staging or production discouraged?
Why is running Telescope on staging or production discouraged?
Signup and view all the answers
Why can integrating the php-cs-fixer rule permanently be a challenge?
Why can integrating the php-cs-fixer rule permanently be a challenge?
Signup and view all the answers
What action should you take in PHPStorm to reformat your code after importing a file?
What action should you take in PHPStorm to reformat your code after importing a file?
Signup and view all the answers
What is the main reason behind adding a backslash to PHP native functions according to the provided text?
What is the main reason behind adding a backslash to PHP native functions according to the provided text?
Signup and view all the answers
Why does the author recommend using infinitive verbs on buttons on the interface?
Why does the author recommend using infinitive verbs on buttons on the interface?
Signup and view all the answers
Why does the author mention that 'vous' is used minimally in the interface?
Why does the author mention that 'vous' is used minimally in the interface?
Signup and view all the answers
What is the main reason behind using 'vous' sparingly in the interface according to the text?
What is the main reason behind using 'vous' sparingly in the interface according to the text?
Signup and view all the answers
How does using infinitive verbs on buttons contribute to achieving the depersonalization goal in the interface?
How does using infinitive verbs on buttons contribute to achieving the depersonalization goal in the interface?
Signup and view all the answers
Why does the author emphasize avoiding personal commitment from users on the platform?
Why does the author emphasize avoiding personal commitment from users on the platform?
Signup and view all the answers
Why does the text recommend using infinitive verbs on buttons or call to action links?
Why does the text recommend using infinitive verbs on buttons or call to action links?
Signup and view all the answers
Why is 'vous' used sparingly in the interface according to the text?
Why is 'vous' used sparingly in the interface according to the text?
Signup and view all the answers
What is the primary reason for depersonalizing the interface and minimizing personal commitment from users?
What is the primary reason for depersonalizing the interface and minimizing personal commitment from users?
Signup and view all the answers
How does using depersonalized verbs in the infinitive form affect user interaction?
How does using depersonalized verbs in the infinitive form affect user interaction?
Signup and view all the answers
What is the rationale behind avoiding personal commitment from users while interacting with the SirEnergies account?
What is the rationale behind avoiding personal commitment from users while interacting with the SirEnergies account?
Signup and view all the answers
Study Notes
Browsershot
- Browsershot is used as a wrapper for Chromium.
- The Scalingo build image limit has been increased from 1GB to 3GB due to the installation of Chromium.
- Browsershot should not be run on web dynos, but instead on async workers, which have 192MB of RAM.
- To run Browsershot, a job must specify the queue 'browser' and workers must have a minimum of 512MB of RAM.
PHPStorm Settings
- Use the settings file 'PHPStorm - SirEnergies - 20230209.xml' to auto-format code in PHPStorm.
- Steps to import settings: go to Settings, then Editor > Code Style > PHP, click on the wheel, then Import, and select the file.
Archives
- Use the settings file 'PHPStorm - Project - 20220926.xml' to auto-format code in PHPStorm.
Clean Code
- Method bodies should be no more than 4 lines long, but 15 to 20 lines is a more reachable goal.
- Reduce long methods by grouping lines into private methods with understandable names.
- A method or class should have only one responsibility (SRP - Single Responsibility Principle).
- Classes should be named according to their responsibility, such as 'LetterSender' or 'LetterDownloader'.
Development
- Write code in English.
- Do not commit commented out code or debug code.
- Write short methods.
- A method or class should do one thing (SRP).
- Rearrange code according to the given settings.
- Add backslashes to PHP native functions.
Telescope
- Do not run Telescope on staging or production, as it has memory leaks and can cause dynos to crash.
- Enable Telescope only for debugging, and disable it immediately after.
Development Owner
- Owner: Chloé Briquet
- Tags: Clean code, Write your code in English, Do not commit commented out code, Do not commit debug code, Write short methods, Your method/class should do one thing (SRP)
Repositories
- A repository is responsible for handling data source operations.
- A repository provides a centralized way of managing database-related operations and increases code readability.
- If you have a 'Team' model, you'll likely have a 'TeamRepository'.
- All public methods of a repository should only use Eloquent methods to access data.
Action or Service?
- The repository provides a centralized way of managing database-related operations.
- If you need to write SQL, put the query in a Data Object Accessor.
Wording
- Use 'vous' with users but as little as possible.
- Use the infinitive on buttons or call to action links with only a word or noun group.
- This tone is used to depersonalize the interface and not engage users in actions.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge on clean code development practices and best practices for writing maintainable code. Topics include writing short methods, single responsibility principle (SRP), avoiding commented out or debug code, and choosing between repositories, actions, or services.