Yik Yak icon
Join communities on Yik Yak Download
I'm really proud of how organized my code is getting. I've been reading a lot about software architecture and trying to implement it to make really neat and maintainable code
19 upvotes, 3 comments. Yik Yak image post by Anonymous in Computer Science. "I'm really proud of how organized my code is getting. I've been reading a lot about software architecture and trying to implement it to make really neat and maintainable code"
upvote 19 downvote

default user profile icon
Anonymous 16w

You can't tell me it isn't beautiful 🤩 For very process oriented tasks i build MVC format, but with a twist. It's NESTED MVC. Controllers call nested sub controllers Those controllers can eventually call a model or view function, but the rule is those functions need to be terminal (they don't call other functions) a sub controller might coordinate many model tasks or many view tasks, but if you need both, you need two sub controllers

post
upvote 6 downvote
default user profile icon
Anonymous replying to -> OP 16w

Now, if you're going to reuse model and view functions, those need to go at the base level, in a "shared utilities" section. That gets around the scope limitations of nesting. So you're getting the MOST neat code posible, very human readable, but you don't need to rewrite logic

upvote 2 downvote
default user profile icon
Anonymous replying to -> OP 16w

Also, the concept of DRY is important too. Building abstract functions applicable to many tasks. For example, the handleFilterOperation function is called by 8 different user interface interactions, just using different input parameters. No code duplication

upvote 3 downvote