Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gary_bernhardt
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
31.
▲
Gary Bernhardt – TypeScript and Testing – Full Stack Radio
(fullstackradio.com)
2 points
by
gary_bernhardt
6y ago
|
0 comments
32.
▲
TypeScript's excess properties can bite you
(executeprogram.com)
2 points
by
gary_bernhardt
6y ago
|
0 comments
33.
▲
by
gary_bernhardt
6y ago
Ahh, if you're taking the microservice path then you're going to have to fight all of that complexity. So far we've stuck to the constraints that I set at the beginning of the project: vanilla Heroku web dynos; exactly one He
34.
▲
by
gary_bernhardt
6y ago
(I wrote the article.) We use a single git repo with no npm packages defined, other than the package.json in the root because we have to put dependencies etc. in there. The directory structure for our source code is dead simple: src
35.
▲
by
gary_bernhardt
6y ago
(I wrote the article.) We don't use ts-node for our dev processes because it adds some annoying startup delay. We keep the TS compiler running at all times on our dev machines, and we run our server/tests/etc. from the TS com
36.
▲
Porting a React Front End to TypeScript
(executeprogram.com)
72 points
by
gary_bernhardt
6y ago
|
103 comments
37.
▲
by
gary_bernhardt
6y ago
We only use it for resuming partially-finished lessons, so we're using it in basically the way that you describe. Overall course progress is tracked in a totally different way.
38.
▲
by
gary_bernhardt
6y ago
This is right. You'd have to read a ton of our source code to see this first hand, but the reducer state has nothing about React in it. It's a lot of stuff like "what answers did the user give?"; "was the answer cor
39.
▲
by
gary_bernhardt
6y ago
I wrote the post. Every step has had a unique ID since day one. Database migrations would be wildly more complex than our actual solution and involve a huge increase in maintenance and (depending on what you're imagining) increase data
40.
▲
by
gary_bernhardt
7y ago
You may enjoy this talk: https://www.destroyallsoftware.com/talks/ideology
41.
▲
by
gary_bernhardt
7y ago
I rename the "email" key in our register endpoint to "emailAddress" and all code that touches that key turns red less than 1s later, whether it's in the client or server. Edit: All of these edits to your posts after
42.
▲
by
gary_bernhardt
7y ago
The post isn't about dynamic validation; it's about static type checking of APIs, which is impossible in JavaScript.
43.
▲
by
gary_bernhardt
7y ago
(I wrote the article.) Our system uses io-ts to dynamically validate all incoming and outgoing API data. The static API types are guaranteed to match the io-ts codecs, so the runtime validation will match the static types. Re: "it'
44.
▲
Porting a React Front End to TypeScript
(executeprogram.com)
9 points
by
gary_bernhardt
7y ago
|
0 comments
45.
▲
by
gary_bernhardt
8y ago
That's a different issue. I was replying to the claim that Visual Studio itself vs. create-react-app itself is an "apples to apples comparison" (their words).
46.
▲
by
gary_bernhardt
8y ago
Dev dependencies are as dangerous as production dependencies and always have been. Read this from 1984: https://www.archive.ece.cmu.edu/~ganger/712.fall02/papers/p7... Those 1,568 create-react-app dependencie
47.
▲
by
gary_bernhardt
8y ago
There's nothing special about "backend". It's normal for the client side bundle to contain many dependencies that came from NPM.
48.
▲
by
gary_bernhardt
8y ago
That's not the kind of security problem we're talking about here. https://blog.npmjs.org/post/180565383195/details-about-the-e...
49.
▲
by
gary_bernhardt
8y ago
You acknowledge security as "the real issue" in your comment. I don't know how to square that with the first sentence in your comment, "I just don't see how this matters." It matters because of security, like y
50.
▲
by
gary_bernhardt
8y ago
"Why" is hard, but Python's packaging system was created when global installation was just how packaging worked. There may have been exceptions, but the first local package installation tool I knew of was workingenv (2006). I
51.
▲
by
gary_bernhardt
8y ago
What is a function?
52.
▲
by
gary_bernhardt
8y ago
The classes serve to close some functions over variables for convenience; the attr_readers serve as destructuring functions for convenience; the += replaces a recursive function for convenience and familiarity. The function with the += does
53.
▲
by
gary_bernhardt
8y ago
You only have to copy if your array is implemented as a simple linear sequence of memory addresses. More advanced implementations don't have to copy everything. E.g., Clojure's vectors (its array equivalent) are effectively O(1) f
54.
▲
by
gary_bernhardt
8y ago
Tweets aren't editable so no need to handle that. Deleted tweets can be honored by updating the timeline to be `old_timeline - deleted_tweets + new_tweets`.
55.
▲
by
gary_bernhardt
8y ago
He wasn't rebutting the code; he was rebutting the claims about following the C standard, which were made separate from the code. You missed this because its' buried in all of Linus' ranting. Linus merged these changes a few
56.
▲
by
gary_bernhardt
8y ago
You're right; I should've written the second thing. Too late to change it now, but I would if I could do it without causing confusion.
57.
▲
by
gary_bernhardt
9y ago
One year of others' time saved over five years would make him a 1.2x programmer.
58.
▲
by
gary_bernhardt
9y ago
Top of the file: """ Game of Set (Peter Norvig 2010-2015) """ It's the name of the problem being solved.
59.
▲
by
gary_bernhardt
9y ago
`set` is a built-in. He probably didn't want to smash it. Defining a function and immediately calling it prevents pollution of module scope. Without it, `photo` would be exported. The tests are in the same file because it makes the exa
60.
▲
by
gary_bernhardt
9y ago
That typing is in realtime! I rehearse screencasts until they flow naturally like you see here; there's no content editing and no script. I basically record the whole thing from beginning to end, over and over, until it doesn't ch
More ›