Welcome Guest.
Not a member yet? Why not sign up today and start posting on our forums.
How would you approach this code in an OOP way?
#1

How would you approach this code in an OOP way?

Hi friends! I posted my code here for review yesterday and was ROASTED! Not wanting to waste anyone elses time I removed it and went away and did some learning on OOP design patterns. I am just having some trouble applying this conceptually to my code. I'd really appreciate if someone could share some thoughts on how you would structure your classes & methods in my fairly simple example? Not looking for anyone to write code for me just some abstract thoughts that might nudge me in the right direction.

My current code is here: https://github.com/adamgreenough/nicholas

Simply, it gets files from a /posts/ directory, parses front matter & markdown from them and then loads them in to an array for generating JSON & outputting on front-end.

I'm sure it not being OOP style is far from the only problems with this but I figured it might get me on my way to being better structured. If you notice any other improvements that would be helpful also!

Thank you very much in advance! I really appreciate anyone taking their time to help a semi-newbie. :-)

submitted by /u/xadz
[link] [comments]
Reply