3 ms·
Homework: readable URLs. (concatenate 'string url-prefix (substitute #\- #\Space (or subject-line (first-ten-words body)))) Also, wrap up all those CRU
by mahmud 17y ago
Homework: readable URLs.
(concatenate 'string url-prefix
(substitute #\- #\Space (or subject-line (first-ten-words body))))
Also, wrap up all those CRUD operations into methods that dispatch on the content type; once you have comments, comment creation, update, reading and deletion will be mostly identical to the posting. A lot of code duplication. Instead, abstract out the common code (and save yourself from database backend dependency by writing CREATE, VIEW, UPDATE and DELETE methods.
- unignorant 17y agoThanks for the suggestions -- I agree with you completely. Much of the code can be refactored in some way, and parts of it can be significantly abstracted. I wanted to get something up quickly, so the end result is certainly flawed. But the nice thing about Clojure is that these kinds of changes can be made rather painlessly -- at least, in comparison to other languages.