2025-11-05
Derived from T. Latoza, SWE 621, GMU
A set of constraints on how code is written which help achieve specific requirements or quality attributes.
A style is creation under constraints.
Programming modalities:
In this sense modality 2 is like the HCI of software: how humans interact with the computer.
Describe alternative ways in which code might be written
All three embody best/good practices to solving common problems and constraints.
| Approach | Breadth | Abstraction | Sources | |
|---|---|---|---|---|
| Arch Tactic | System/sub-system | Expressed in natural language/models | Textbook; | |
| Design Pat. | Module | Diagram | GoF book; OO | |
| Progr Style | File | Code | Languages |
Presentation is centred around an example problem.
Each program offers the same baseline behavior (sometimes adding an additional feature)
Can directly compare and contrast how the same problem is solved each style
Directly illustrates the diversity of ways of programming
Some are related to programming language features (e.g., OO, functional, reflection)
But many modern languages support a range of language features that support a diversity of styles
E.g. all examples written in Python
Input
Tigers live mostly in India
Wild lions live mostly in Africa
Output
live - 2
mostly - 2
africa - 1
india - 1
lions - 1
tigers - 1
wild - 1
No class or labs next week
No CI requirement
10 LET N=10
20 FOR I=1 TO N
30 PRINT "Hello, World!"
40 NEXT I
Compare with Monolithic architecture
rectangle.getArea())With your group, pick one of the example styles (ch 7 or later).
Post your choice on Teams so others don’t also do it.
You will learn the style, adapt it for Typescript, and present it to class.
Do not use AI to understand the style - spend the next 10 minutes doing that with your own human brain.
You may use AI to help with the translation into Typescript.
This is part of the Refactoring exercise coming up next week.
Your presentation should include
I<Name> syntax defines a Thingexecdecorator but without attaching directly to the function (which may be far away from the aspect code)yield to return to where the fn left off_
Neil Ernst ©️ 2024-5