Code reusability: don’t reinvent the wheel

As the title says, it is completely unnecessary to rewrite code that it has already been written, it is, most of the time, a waste of your time and effort. With all the open source code available nowadays, it is really probable that you find whatever you are looking for on sites like github, gitlab, bitbucket or any other site, and if you don’t find it, well, then now you know what’s going to be your next open source contribution. You should really focus on writing building on top of what others have already done, also, it is worth to notice that you should be writing reusable code as well.

Some tips on writing reusable code:

  1. Don’t repeat yourself: if you find yourself writing the same code several times, probably you should move that piece of god to a module or something alike.
  2. Make a class/method do just one thing: remember the Unix philosophy? write programs that do one thing and do it well, also, write these programs to work together, the secret is in writing generic code to accomplish one simple thing, then use the output of that as input of another program to accomplish a more complex task, don’t make code too generic tough, or it will be difficult to find a purpose to it.
  3. Write unit tests for your classes and make it easy to test classes.
  4. Remove the business logic or main code away from any framework code.
  5. Try yo think more abstractly and use Interfaces and Abstract classes.
  6. Write code that can be easily extended in the future, for code leverage of course.
  7. Don’t write code that isn’t needed, if you doubt if the code is needed, then it is not, just leave it out.
  8. Try to reduce coupling, avoid modules/classes depending on each other.
  9. Be more modular, again, the Unix philosophy.
  10. Write code like your code is an External API, write everything modular and do one thing, then make these components work together to accomplish one common objective, by the end of the day you will have nice, modular and reusable code.

code-reuse.jpg

Sources:

http://hoskinator.blogspot.mx/2006/06/10-tips-on-writing-reusable-code.html

What’s the use of code reuse?

 

Software Maintenance

Software maintenance stands for all the modifications done after the delivery of a software product. A software maintenance is needed in order to mantain our software up to date.

Modifications in the software may be required because of changes in the market conditions, changes in the client requirements or even host modifications.

There are some types of maintenances based on their characteristics:

16382202136_375d300dbd_z

flickr photo by Pia https://www.flickr.com/photos/omgdolls/16382202136 shared under a Creative Commons (BY-SA) license

Corrective Maintenance:

This includes modifications and updates done in order to correct or fix problems, which are either discovered by user or concluded by user error reports.

Adaptative Maintenance:

This includes modifications applied to keep the software product up-to date and tuned to the ever changing world of technology and business environment.

Perfective Maintenance:

This includes updates done in order to keep the software usable over long period of time. It includes new features, new user requirements for refining the software and improve its reliability and performance.

Preventive Maintenance:

It aims to attend problems, which are not significant at this moment but may cause serious issues in future.

Sources:

http://swebokwiki.org/Chapter_5:_Software_Maintenance

https://www.tutorialspoint.com/software_engineering/software_maintenance_overview.htm

Application Programming Interfaces

Application Programming Interfaces (APIs) allow applications to talk to other applications, but that is just one small aspect of their true power. Websites, Mobile Apps, Buttons, Badges, Widgets, Spreadsheets and Devices are all benefiting from the power of APIs. API driven interactions allow you as an user to generate your own content, acquire API access to valuable data and pull content from API resources and  various databases.

Every time we visit a website or application we leave a digital footprint on them that helps them evolve based on our experience. With the innovation of all digital things, websites and applications have evolved to being generated through development software and software as a service platforms.

Machines just need a shorthand way to do things like checking the current weather or adding an event to your calendar.  That’s what an API provides.

 

APIs can be web-based, or specific to a platform.  Google has APIs for search, calendars, translations, etc.  Facebook and Twitter have APIs that allow software to automatically post status updates.  Apple provides many APIs for building iPhone apps.pexels-photo.jpg

You might think that APIs are very recent, but they’re not. The function of an API, at first, was to connect one program to another. Then in 2007 the iPhone was released and there the power or APIs got 10000 times bigger and more important, because thanks to the iPhone, mobile apps became part of our lives.

This video might help you understand APIs.

Sources:

API Evangelist

https://sanjaysaha.wordpress.com/2012/08/10/api/

What APIs Are And Why They’re Important