x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

Code quality guide: Difference between revisions

From LimeSurvey Manual

Created page with "DRAFT == Prologue == # Be risk aware. # Be humble. LimeSurvey was made by developers from all over the world, with different age, education and experience. # Performance mat..."
 
Line 3: Line 3:
== Prologue ==
== Prologue ==


# Be risk aware.
# Be risk aware. Too perfect code can be a business risk (slow to write, maybe over-designed). Too sloppy code can also be a business risk (hard to maintain). You have to find a balance that is adapted to the current situation and risk analysis.
# Be humble. LimeSurvey was made by developers from all over the world, with different age, education and experience.
# Be humble. LimeSurvey was made by developers from all over the world, with different age, education and experience. Your code might be read by a completely different team ten years from now.
# Performance matters sometimes
# Performance matters sometimes, and shouldn't be disregarded completely. In particular, database queries using the ORM and ActiveRecord can be problematic. Some surveys have thousands of questions and hundreds of thousands of responses. Fast response time is also important for a fluid user experience.
# It's harder to read code than to write code
# It's harder to read code than to write code. Don't choose patterns that are easy or fast to write, but that are easy to read.
# Stress affects quality
# It's easy to forget cross-cutting concerns like translation and security. Keep a mental note.
# Stress affects code quality greatly. If your stress level is too high to write code with proper quality, take a step back and discuss it with your boss.


== Quality ==
== Quality ==

Revision as of 20:55, 2 April 2021

DRAFT

Prologue

  1. Be risk aware. Too perfect code can be a business risk (slow to write, maybe over-designed). Too sloppy code can also be a business risk (hard to maintain). You have to find a balance that is adapted to the current situation and risk analysis.
  2. Be humble. LimeSurvey was made by developers from all over the world, with different age, education and experience. Your code might be read by a completely different team ten years from now.
  3. Performance matters sometimes, and shouldn't be disregarded completely. In particular, database queries using the ORM and ActiveRecord can be problematic. Some surveys have thousands of questions and hundreds of thousands of responses. Fast response time is also important for a fluid user experience.
  4. It's harder to read code than to write code. Don't choose patterns that are easy or fast to write, but that are easy to read.
  5. It's easy to forget cross-cutting concerns like translation and security. Keep a mental note.
  6. Stress affects code quality greatly. If your stress level is too high to write code with proper quality, take a step back and discuss it with your boss.

Quality

What is quality? Which aspects of quality can we measured?

Idiomatic code is more readable than non-idiomatic code. What's idiomatic depends on which context or domain you work in. We work in PHP and web application development, and have other idioms than in functional programming.