I used the vector space model about a decade ago when I worked on the simple search engine for the company documents. Today the subject came up in the conversation and I was surprised as to how quickly I remembered this. I still think that this is rather elegant.
Category: Programming
A big part of my work has to do with code. I’ve worked as system administrator – installing, patching, and configuring someone else’s code. I’ve worked as independent programmer, writing code on my own. I also programmed as part of the team. And on top of that, I worked as Team Leader and Project Manager, where I had to interact a lot with programmers. Programming world on its own is as huge as the universe. There is always something to learn. When I find something worthy or something that I understand enough to write about, I share it in this category.
quiglegant – a quick and elegant solution to the p…
quiglegant – a quick and elegant solution to the problem.
Metasyntactic variable
A “standard list of metasyntactic variables used in syntax examples” often used in the United States is: foo, bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud. The word foo occurs in over 330 RFCs and bar occurs in over 290. […]
Due to English being the foundation-language, or lingua franca, of most computer programming languages these variables are also commonly seen even in programs and examples of programs written for other spoken-language audiences.
On using third-party APIs
In the few jobs I had, I was responsible for creating a new system and integrating it with some other systems. The variety of the systems is pretty much irrelevant – anything from back office systems and CRMs to trading platforms and CMSs. The common factor between them is the integration is often done through some form of the API.
The most important lesson I’ve learned while working with third-party APIs is this:
Never ever use a third-party API directly from your application. Instead, create an abstraction layer between your application and third-party API.
This might seem like a bit of extra work, but, trust me, it’s not. It will save you plenty of time and frustration. Here are my reasons:
- Your own abstraction layer will help smooth out API’s edges. If you are using third-party API, chances are, it feels weird at times. It doesn’t matter what sets you off – function names, or required obvious parameters, or maybe the logic or order of calls that you have to make. Instead of getting annoyed every time, you can abstract all that weirdness into a separate layer, which will probably not change all too often. And your application coding will be more fun.
- Easier maintenance. Even the best APIs change. And when it happens, you don’t really want to go through all of your application and change all calls to the old version of the API. Especially, if the updated version is not fully backward compatible. Instead, you’d just rather update your API abstraction layer and be done with it. And if you do, like you should, have unit tests covering your API abstraction layer, it will be trivial for you to see if you broke anything or not.
- Easier reuse and more control. One of the biggest problems with third-party APIs is that you don’t control them. Third-party introduces features, bugfixes, upgrades, and maintenance down-times whenever THEY want. You rarely have much say in it. When you have a layer in between the third-party API and your application, you have more control as to how all those things affect your application.
- Easier migration to another third-party API. And you know that these things do happen. You’ve been using one provider of the service, and now there is a better one. If you were using first provider’s API directly from your application, you are pretty much in trouble now. Going through the whole application replacing calls to the new API, with different set of parameters, data types, and return values, is a huge undertaking. If only you had an abstraction layer, all you’d have to do now would be to change that instead. Sure, you might need to extend it a bit, or introduce changes to the currently used functionality. But, from my experience, such changes would be much smaller and simpler (since you are working with your code on both ends).
A phrase of the day from yesterday: (while explain…
A phrase of the day from yesterday: (while explaining unit testing to a colleague) If it fails, it is obviously broken and doesn’t work.