Follow the path of what I know, then try to implement correct coding practices, or start with good coding practices and try to fudge the way through

programming practices

First off, I want to say that I am used to doing Procedural Programming as my hobby – I'm trying to learn OOP in a couple languages, and understand the theory, just not the practice.

I have a pet-project I wanted to build, specifically in PHP with a database backend (didn't care what one). My main reason was for the app to be used on any device, so a WebApp seemed like the logical choice.

I understand that to build maintainable PHP WebApps, it should use OOP, Classes, Frameworks, Libraries, etc. This sounds logical, so I decide to try some of the popular ones. However, after an entire weekend of just trying them and trying to get through the tutorials, I'm left both confused and frustrated trying to adapt the tutorials to my small project.

I decided, mainly for a proof-of-concept, to build the app in another program (Microsoft Access), and accomplished my main goals in only a couple hours – except the Web part.

My question is, should I follow the path of what I know, then try to implement correct coding practices, or should I start with the good coding practices, and try to fudge my way through? For this project, I would like it to be Open Sourced on GitHub, so I would be open to other people using and changing my code, but I also know that if code is written poorly, it would be hard to gather coders to help.

Best Answer

Best practices are mostly suggestions and proposals gathered from experience to help make projects easier to *able.

The key aspects of this IMHO is the experience part. Though these best practices are good ways for people with more experience to share it with beginners, I think one still needs a minimum level of experience to truly understand what makes this is a best practice. Doing otherwise amounts to following them blindly as the rule of law which in the end I think will slow down your learning as you slowly let others do the thinking for you.

In any case, the absolute paramount most important thing do to in a software project to me is ... well... finish it, ship it... in short make it work !

Anything before that point is vaporware, a figment of your imagination. Only once you have something that works can you truly evaluates if it is slow, hard to maintain, hard to test etc. The process of making it work will expose things for which, perhaps, there exist a best practice that would help you rethink it in a way that makes it easier to reach that goal.

So yes, start with what you know first, take note of things you do that are hard. When you hit a wall take a step back and look at that wall, learn what it is made of. In a great many cases you will realise that YOU are the root of the problem. Your lack of understanding of some part of the issue you are trying to solve, your lack of knowledge on how you can better leverage the tools you have or your ignorance of other tools that are right under your nose the whole time but were not ready to start their mastery.

At the same time, keep reading about new ways to do things. Read these best practices and try to see if they apply to anything you are finding difficult in your project. If not, remember their existence and revisit them from time to time. Stay curious. In time you will see that the observations made above just click naturally with the knowledge you acquire here.

Lastly experiment with what you've learned and see if it does make things simpler. keep at this and eventually you will read the best practice for what they are. Just simple advice from people that have suffered and learned a way to make it easier. Heck you may even disagree with some of them and see that your way actually works better for you. But without knowledge you are just walking blind.

good luck

Related Topic