3 ms·
That's a fantastic idea. What about a babel plugin to transform all code into fetches to a proprietary REST API? By doing all of the work for them, we'd ensure
by scottmf 8y ago
That's a fantastic idea.
What about a babel plugin to transform all code into fetches to a proprietary REST API? By doing all of the work for them, we'd ensure reliability with common operations like + and /, which obviously means we eliminate the need for tests! This would allow devs to move and break things even faster, while we/I collect $10–$20 per 10,000 API calls.
E.g.,
// Regular code
console.log(3 + 2);
// Transpiled code
console.log(await fetch('http://fetchify.io/add/3/2'));
// Regular code
const isFive = (x === 5);
// Transpiled code
const isFive = await fetch(`http://fetchify.io/equality/strict/${x}/5`)
.then(body => body.text());
Some of this is almost too easy to understand though, therefore it's pretty amateurish and we're not doing proper programming. What about something like:
// Regular code
const thirty = 5 * 6;
// Transpiled code
let $$_tmp1;
const thirty = (
$$_tmp1 = await fetch(`http://fetchify.io/multiply/5/6`),
$$_tmp1 = await $$_tmp1.text(),
$$_tmp1 = parseInt($$_tmp1, 10), $$_tmp1
);
Even some seasoned developers aren't aware of this syntax, so it's perfect.