Clean up code
Two things to look for in cleaning the code up:
-
Look for places code can be generalised by looking for duplicates. The
make dupl
command can spot duplicate code blocks. -
Review the
this
,folder
andstorage
modules. The bits of the session that are stored inthis
should become aSession
struct instorage
. Then copy most of thefolder
storage routines to thestorage
module. Just keep data verification and manipulation routines infolders
.On
this.Start
(lose theThis
) assign thestorage.Session
object and then the higher levelfolders
routines can use that (there was a cycle in the current layout whenstorage
tried to usethis
.
The end result of these changes would yield easier to read/understand code. And it makes the folders
module much clearer. Though moving the verification stuff from folders
and users
to verify
? But then a routine for creating a quoted message might not fit there... Hm.