generated from hpi-swa-teaching/SWT-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Standards
Antonia edited this page Jul 8, 2024
·
2 revisions
Code Standard:
- after return value a dot
- no dots before ending of block closure
- space after method header
- space after return tick (^ ...)
- no space after variable definement
-
ifTrue:
andifFalse:
in the next row and indent than directly behind the block closure, same forcollect:
,do:
, etc. - when return contains something with
collect:
orifNil:
orifTrue:
etc. than write everything in one row (except when the line get's too long) - write specific object while looping through a Collection, do not use
:each
- methods that do nothing, for example in dummy classes like
SPBNullCard
should contain the comment"do nothing"
Some code examples:
^ self columns
collect: [:column | self buildColumnSpecWith: aBuilder and: column].
buildSidebarDescriptionSpecWith: aBuilder
^ aBuilder pluggableTextSpec new
model: self;
name: #sidebarDescription;
setText: #updateActiveCardDescription:;
getText: #activeCardDescription;
frame: (0@0.4 corner: 1@1);
yourself.
parseChange: aJsonObject (abstract)
| action change type |
action := aJsonObject at: 'action'.
(aJsonObject includesKey: 'project_card')
ifTrue: [type := #card.
action = 'moved'
ifTrue: [change := self cardMoved: aJsonObject].
action = 'created'
ifTrue: [type := #lane. change := self cardCreated: aJsonObject].
action = 'deleted'
ifTrue: [change := self cardDeleted: aJsonObject]].
self columns
do: [:column | column changeProvider: self changeProvider].