News for hackers. Stuff that matters.
Re:Developer Tropes: “Google Does It” by Moru on Monday July 15, 2019 @02:54PM (#20443925)
The problem arises when you as developer rely on this thing that Google invented but suddenly got bored of and shut down or changed a lot so your implementation has to be rewritten. Many have been hit by this over the years so are reluctant to try again.
Re:Developer Tropes: “Google Does It” by jkoudys on Tuesday July 16, 2019 @09:26AM (#20449786)
I've been hit by this at least a half dozen times over my career. Apps scripts are probably the latest one causing me pain. I love being able to integrate with docs & sheets, but man if that ecma version isn't ancient af.
Re:Developer Tropes: “Google Does It” by deathanatos on Tuesday July 16, 2019 @09:46PM (#20455694)
> man if that ecma version isn't ancient af.

It is incredibly ancient. It's possible to use Babel w/ it though, and write reasonably modern JS. There's a CLI tool out there to upload something into an Apps Script … app? too; at one point, I had a project w/ a Makefile that would run the project through Babel and then upload it to Google.

I didn't try all the features (and I didn't have any npm/package management), but things like format strings, for(… of …) loops, let/const, new Map() all worked. Babel is a wonderful, wonderful thing.

Re:Developer Tropes: “Google Does It” by jkoudys on Wednesday July 17, 2019 @10:47AM (#20460033)
If it were simply ancient, that'd be one thing, but it's a weird hybrid of es3 with _some_ es5 features, and some es6 ones that often don't work the same. e.g. it has `const`, but no `let`, and it's not even block scoped so it's not that useful. Destructuring is there, but for arrays only and not object properties.

I built my babel config to balance clean, new syntax with the least intrusive transforms possible. e.g. I have loose template literals on, since `\`hello ${world}!\`` is an easy transform (and still readable in the final source) as `'hello ' + world + '!'`. Generators, for .. of, and object rest/spread, are okay, but babel puts a ridiculous amount of helper functions at the top to support this. I suppose I could always configure each project with a shim file, but that's extra overhead I really could do without.

block-scoping, arrow-functions, function-name, shorthand-properties, spread (for arrays and arguments), template-literals (loose, so `+` not `String#concat`), and exponentiation-operator I found give the most bang for your buck. `for .. of` is nice but if I can pass arrow functions into my `forEach` callbacks that's pretty clean too. Pretty great being able to say

``` rows.forEach(row => { const payload = row.map(([name, rank, serialNo]) => ({ name, rank, serialNo })); SomeApi.doThing({ onComplete() { foo(); }, payload, }); }); ```

in gapps. That said, it took a while to even figure out how much was possible, but yeah it's a big step up.

Re:Developer Tropes: “Google Does It” by WanderPanda on Monday July 15, 2019 @05:29PM (#20445469)
There are counterexamples, though: https://news.ycombinator.com/item?id=16347083
Re:Developer Tropes: “Google Does It” by scarface74 on Tuesday July 16, 2019 @08:57AM (#20449560)
As of last year, the last time I tried, the Google backed maps app still works on my first gen iPod Touch - last updated in 2009 and the first gen iPad.