Frameworks, programming languages: Coding from scratch vs. using a framework
© Shutterstock / Peter Wooton
In the world of the coder, you can never expect things to remains static for too long. Technology already dictates so much of how we interact, create, learn, live, etc, and it’s constantly evolving. For programmers, that relationship is only magnified by their close proximity and dependency on the latest tech in order to accomplish their tasks. And one of the most profound shake-ups in their world has to do with frameworks, programming languages and the paradigm shift taking place between the two.
As a quick refresher on the differences between these two terms – a programming language is essentially how we communicate with computers and tell them what to do through the use of syntax and semantics.
A framework, on the other hand, is a collection of programs brought together to accomplish a task, make coding more efficient and generally make the lives of coders easier.
Now the two are not exactly opposed to each other, but there is an ongoing debate in the programming community as to what is more important for coders to be more familiar with: Programming languages (the nuts and bolts) or frameworks (faster and, at times, more functional).
Some of the more popular frameworks you may have heard of include Ruby on Rails and Angular.JS, among others. But both programming languages and their accompanying frameworks are continuing to rise and fall every day.
So what does this mean for you?
Frameworks vs. custom solutions
In a perfect world, you’d know everything there is to know about both frameworks and languages. But we don’t live in a perfect world and your time is precious.
Let’s take a look at the differences between the two options and why you’re more likely to benefit from a vast knowledge of frameworks versus being acutely aware of all the programming language ins and outs.
Building from the ground up
Development isn’t easy, so why make things harder on yourself?
It’s a fairly simple equation, at its most fundamental level: Why start from scratch when you can take advantage of tools already designed to help you in your programming endeavors?
The point is that a lot of frameworks have done much of the legwork for you and can create a more efficient experience on your end.
Sure, you may not be totally on board with every decision that the framework creator made. You might even be able to do it better yourself were you to transfer the language over to your preferred coding syntax. But this all comes at the cost of time.
Transferring everything to your language of choice could take days and possibly even years depending on how vast the framework is or what it is exactly you’re looking to copy.
You might not get everything you’re looking for out of the framework, or at least, not exactly the way you would prefer it, but the alternative is starting from scratch, and that’s not really viable considering the time constraints that is placed on us purely by virtue of being mortal and not having an indefinite amount of time to tinker with everything so it is exactly how we want it.
Frameworks make things simpler
Here’s a pretty handy look at all the ways that Ruby on Rails helps users reduce some of the minutiae of endless hours of coding.
Little things like removing semicolons and other nifty little tricks allow programmers to cut a few corners here and there and not be penalized.
Of course, you still need a pretty comprehensive knowledge of Ruby in order to work on Rails, but at the end of the day, you don’t need to be an expert programmer in Ruby to move on to Rails.
You’re still coding, but a lot of little details and more frustrating aspects of coding will get cleaned up by good frameworks, and that is a bonus you don’t want to miss out on.
You already have to worry about so many other aspects of your code, from general design to security concerns, so why not let the framework do some of the heavy lifting for you?
Automation is taking over
There used to be a time when every single keyboard stroke had to be exact for your program to work the way you wanted it to. But with technological progress comes the smoothing of edges.
No longer do you have to go through thousands of lines of code with a fine-toothed comb. Instead, a lot of those pointless add-ons or missteps are stripped out by compilers and automated protocols designed to find these unnecessary bits of code.
This evolution has deemphasized just how precise and familiar you have to be with any one particular code because the consequences of making a mistake or not getting things exactly right were far greater.
Learn the right tools for the job
As I mentioned at the outset of this piece, coding evolves. It changes. It grows.
And one of the ways it’s grown is the reliance on application program interface (API) and algorithms to help you accomplish the task you set out to complete.
Frameworks, for example, usually define and implement algorithms, and getting the algorithms correct can at times be more crucial to your programming success than the syntax specifics.
Again, you can reconfigure these algorithms, but you risk making a mistake that could derail your project. Similarly, it’s another question of time. Why add hours of work and up the risk of upsetting your code when you can instead find ways to make due with an already functioning and perfectly viable algorithm implemented by the framework?
Again, it may not give you everything you want. But like the Rolling Stones song says, it’ll give you what you need.
What frameworks add that programming languages don’t
Frameworks and programming languages are intertwined. It’s not a binary. It’s not either/or. They work in concert and programmers must know both fairly well to be truly effective. Of course, sometimes you’ll be faced with situations that require complex solutions that a framework will not be able to solve. For instance, sometimes a unique problem will require a specific set of solutions that a framework cannot provide, and therefore you must revert to programming.
But here’s the thing – you can only focus on so much with your time to learning both frameworks and the languages they enhance. Time is a resource and you have to spend it wisely. And once you have a comprehensive enough understanding of both frameworks and programming languages, which one should you invest more time in learning about? Which one will ultimately make you the better coder?
The answer is frameworks. They’ll make you fast, more efficient, and less prone to making a silly human error. They’re the equivalent of a highway versus city driving. Highways are streamlined and have removed lots of obstacles like buildings and lights. Sure, you may not always like the direction of a highway, or think a pothole should be fixed, or feel that it would be more efficient to reroute certain sections, but you’re not going to get out of your car and start rebuilding it by hand, right?
Because if the goal is faster and more efficient travel, then rebuilding the highway would take far too long compared to just using it as is.
That’s basically the deal you’re getting with frameworks. Faster, efficient, safer. Maybe not always to your exact specifications but, given the alternative, frameworks are here to make your life easier and they simply offer more than programming languages alone can.