Press "Enter" to skip to content

The Pains Of Coding Standards

shawn@akceli.io 0

Code standars can be as nit picky as tabs vs spaces, or more archetitual designs that need to be followed.  No matter the standard, there are headeaches involved.

Archetictural Standards:

These can require a bit of time for a new team member to get the hang of.  There are often times many tiny things that need to be accounted for that can be very destracting when working on a difficult feature.  Two main things happen at this point, the developer has to stop thinking about the main feature and start working thew the checklist of items to get done before he can get to working on the real problem, or he pushes off the details and works on the difficult parts of the feature and tries to patch the small details that were skipped along the way.  Both cases have there pain points.  The first case admitidly is perfered.  

Perferd Coding Styles:

There are many ways to write a line of code, expesialy in laravel and have it do the exact same thing.  Some ways of writing code is cleaner, other make it eazier for your editor to Autocomplete, and others just are plain diffrent.  Everyone has a prefrence that makes since to them.  I perfer to have code writen in a way that allows for autocomplete, even at the expence of extra lines of code.  That is just a prefrence, which i strongly belive in, but at the end of the day, its not write or wrong.  The point of theses standards are to make code more readable, and to reduce bugs. But when writing code its often more important to focuse on the problem at hand and simple get the code right, as in it performs according to specs.

How Dose Akceli Come Into This Descussion?

When you design your standars for a paticual design pattern, for example, creating a model and exposing way to interact with the data threw a controller. So lets Say Basic Crud.  You will need to Create a Migration, Model, ModelTest, ModelFactory, ModelController, ModelControllerTest, CreateModelRequest, PatchModelRequest, ModelResource, and last but not least a ModelRepository.  Im not going to go into the paticualers for each of the files but as you can see just to do basic crud following solid design principles requires a lot of work.  This can eazily take hours to type all of this by hand and make sure all the test are pasing, not to mention all the standards for each file that need to be followed.  Akceli can build out all of these files and more if you desire, by simply creating a migration, running the migration and the scaffoling the files based of the data types for the columns. Run your tests, and just tweek as needed to till all the tests pass, Test driven development at its finest.  All of the files are Build Based of your standards that you put into the files. For example, if a model has the column user_id you may want to make sure it always gets a UserScope() added to the Boot Method on the model, or add a specific guard to the controller, or many other possiblities. Just add a if statement to the templates where you want the code to appear and it will alway be generated when the user_id is present in the database.  Your developers dont have to think about these details for every line of code they write.  They define the standard in Akceli and Akceli will aply the standars consitanly over time and even thew deveoloper turnover.

Leave a Reply

Your email address will not be published. Required fields are marked *