Why Coding Crossroads?
Back in 2012 I had grandiose ideas of creating an epic blog. I was doing full stack development using a smorgasbord of technologies and languages.
HTML, CSS, Javascript, jQuery, node, PHP, mySQL, Wordpress, mootools, backbone.js, actionscript and probably a slew of other techs.
Back then I didn't know the difference between frontend development and backend development. There was just development.
If I needed a frontend feature I wrote the frontend. If I needed a backend feature I wrote the backend. If I needed a feature for the server I installed the feature.
A crossroad is the intersection of multiple roads. So, I figured my skill and talent was a crossroad of different languages and skillsets. And, from there Coding Crossroads was born.
Since I didn't start my career as a frontend developer or backend developer, I've never had any preconceived notions of what a particular developer should or shouldn't do. The divide and interplay between the client and the server is not a hard, black and white division for me. For any particular problem, once I know the solution, how I create that solution is a balance act.
A trivial example is attaching a timestamp to a user submission.
await axios.post( url, {
...payload,
timestamp: new Date().toISOString()
} );
await insertIntoDatabase({
...item,
timestamp: new Date().toISOString()
});
Which is right? Is there a right answer? If you're creating both sides of the coin then I would argue that there is no correct answer. There is a pro/con for each method.
If you create the timestamp in the frontend then you'll need to validate and sanitize the data in the backend (you should be validating and sanitizing your data either way).
If you create the timestamp in the backend then you're committing backend resources to support and maintain that functionality. That might seem like a silly con, but if your backend resources are only working on the project for a finite period of time then giving more flexibility to the frontend might be more beneficial.
That's enough soapbox for one day.
Happy coding.