Friday, December 4, 2015
I originally wrote this post for Cloud Construct (Click here to go to the original article). Hopefully you will learn a thing or two that you didn't already know. If not, feel free to browse the rest of my site! Enjoy!
Whether you’re coding for your own personal website or one at work, chances are you’ve searched the web and come across a code that you’ve wanted to utilize in your own site. When this occurs, temptations to simply copy paste may be strong. Resist the temptation! I cannot stress enough how important it is to really get to know the ins and outs of the code. I hope you’ll find the following 3 steps of “code-spiration” helpful, and ultimately become better equipped to handle more complex codes in the future.
It is important first to get to know how the code works and the specific reasons behind its different aspects. Understanding the code will allow you to easily alter and manipulate the way it works and how it looks. A good method for understanding the code is to replicate or download the source code and use it in your own fun and made-up project. While you are working on this project and code, you can start to make adjustments and discover what it is that “breaks” the code.
One of the best ways to get to know the code you are working with is to “break it.” In fact, at the end of the day, “breaking” the code is truly the only way to discover what it is that makes it tick. Why did this developer write what he did? What purpose does a particular sequence serve in this code? It is not until you start “breaking” the code that you will be able to build it back up again.
Once you’ve broken and understood the code, you can begin to make it unique. Understanding the code will then allow you to make changes to the functionality and to add in your own animations, transitions, or timings. An alternative to changing the code’s functionality might be to add your own structure and style to the piece. Work around the necessary, “baseline” code and remove the additional parts. The more you change, the more unique and personal the code will become. Soon enough, the code will start to take a shape more in line with your own personal coding style.
When you take the time to familiarize yourself with the code, you will not only better understand what it is you are actually looking at, but you will also gain the tools and knowledge necessary to create your own code from scratch. Don’t simply grab the code and use it without understanding it. Though it may seem like a good idea at the time to just copy and paste the code, chances are this will leave you unable to fix or change it down the line when you receive client feedback. If you take the time to understand, ‘break’ and experiment with the coding, though, the benefits will be invaluable. So take a little time to play around with the code— I promise you’ll be glad you did.