Introducing Coding-Standards Compliant SDKs

Maham Shahid
APIMATIC
Published in
2 min readSep 28, 2017

Standards compliant code and code linting are among the concepts widely recognized in the software industry as markers of better code quality. At APIMatic, we’re obsessed with the quality of the code we generate, and as another step towards better code we’re introducing SDKs that are compliant with industry accepted coding standards.

Community Loved Coding Style

For each language, we have employed a widely accepted style for writing code. Therefore, the generated code is shipped just the way most developers like it and expect it to be written. We’ve chosen the coding standard for each language depending on its popularity with the developer community.

Improved Readability

Standards compliance also improves the readability of the generated code. Since the personal preferences of the developers are eliminated, the shipped SDK will be the same in code quality no matter who is working on the code generation engine.

Consistent Projects

For the users who have already implemented coding standards in their development workflow, the generated SDKs fit in seamlessly with their existing codebase. This brings more consistency into their projects.

No Syntax Errors — Guaranteed!

Standards compliance gives our users a guarantee from our end that the shipped code will be free from syntax errors and inconsistencies so that they can focus solely on their applications without having to worry about anything else.

Sample Node.js code before compliance
Sample Node.js code after compliance

Improved Code Generation Process

Apart from helping the consumers, coding-standards compliance and linting improves the code generation process at our end as well. It saves time since linting identifies and points out the errors or inconsistencies before the generated code is shipped.

Compliance is particularly useful in case of weakly typed languages. Since weakly typed languages are not compiled, errors can only be detected at runtime. So linting acts as an extra layer of protection in this case, checking the code for inconsistencies to ensure that all bugs are caught out and fixed before release. This way, the generated code is tested rigorously with linting checks and unit tests at our end and quality SDKs are shipped out.

Currently, we have standards compliance done for C#, PHP, Node.js, AngularJS and Python, while compliance for Ruby and other languages are coming up pretty soon. For details about the coding standards being used and the changes made to SDKs, have a look here.

If you have suggestions to help us improve our code quality further, please don’t hesitate to contact us.

--

--