HTFITIP is a website where you can see what a function from one language is called in another (or an implementation).
The idea came to me after the eleventh time I asked myself, how the fuck is trim in Python? It’s called strip by the way.
The website is very simple. On the front page, there’s this form:
How the fuck is _____’s _____ in _____?
The first space is the “source” programming language name, the second one we’ll put the function/method name, and the third one, the “target” programming language. The source language is optional.
A good source for the… source programming language is PHP’s (massive) functions list. First of all, PHP’s seems to have a function for everything, and there’s no namespace so it’s easier for us to build an index of it. Secondly, it’s a widely known language. Thirdly, it’s the first language of a lot of people, so it’s quite possible that a lot of people will want to know what’s the equivalent for PHP’s function X in a new language they’re learning, so if we have to start somewhere might as well be this way.
When the user selects the programming language from the source dropdown, an Ajax call automatically gets all the function names so when the user types a name on the second field, it auto-completes. Then, he selects the “target” language on the third field.
How the fuck is PHP’s trim in Python? (click submit)
If the relationship has already been stablished on the database, we present the answer to the user:
PHP’s trim in Python is called strip. (a link to Python’s manual page on strip would be nice)
If not, we can let the user make this relationship. If it’s not possible, say, Python doesn’t have an array_intersect_uassoc function on any module, we let the user type an implementation, wiki-style.
Web 2.0 baby, the users provide all the content, we make all the money.
And the website backend is simple. A list of programming language and its functions, and the relationship between functions/methods, and somekind of wiki stuff to let people submit implementations.
I’ve been feeling lazy lately so go ahead and implement this if you want. Should be an useful tool.