Skip to content

Restructure of software development as a process section #227

@thomaskileyukaea

Description

@thomaskileyukaea

Restructure the software development process to instead demonstrate refactoring existing, poorly architect-ed code into better code.

Instead of directly teaching functional, OOP etc it would show example code that could be improved (made more readable, testable, extendable) by applying these techniques. It would then name them, so that people can read more.

By focusing on examples where each helps it grounds why you would apply them, rather than potentially just encouraging people to think they need to use classes to being doing "good coding".

Another motivation for this change is we got some feedback when running the course is mostly what people are doing is refactoring legacy projects rather than writing new code and this would develop the skills for doing that.

Goals of this rework:

  • Practical experience of refactoring code rather than writing fresh code, mirroring what most people will experience
  • Understand the value of OOP and functional techniques and when they are appropriate to apply
  • Easier/faster to teach as less theoretical information, more examples to work through
  • Encourage a YAGNI approach to good code structure

Proposed Structure

  1. <Potentially keep / drop the requirements section>
  2. Clean code
    2.1. Introduce what an abstraction is
    2.2. Introduce what refactoring is
  3. Refactoring functions to just do one thing
    3.1. Trying to test a messy function that both reads from a path and does some calculation
    3.2. Refactor into a pure function that does the calculation using the output of another function that reads the file
    3.3. Writing tests for the new pure function
  4. Refactoring how we display the results from computing the result
    4.1 Refactor out logic for computing something from displaying it in a graph
    4.2 Add a new view
    4.3 Introduce MVC and patterns as a source for inspiration
  5. Adding persistence
    5.1. Ideas of an interface in programming concept
    5.2. Write an interface for writing outputs
    5.3. Writing an implementation of the interface
    5.4. Using the interface
    5.4. Writing an alternative implementation.
    5.5. Explain the concept of de-coupling

Depending on how much quicker this section is to teach I think the following exercises would complement it well:

  • Architecting a large project using boxes and lines (probably between 4 and 5, or even make it for 5)
  • Refactoring something into layers (probably after or worked into 4)
  • Using encapsulation to keep data in a consistent state (after 5)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions