Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bern4444
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
48 ms
·
481.
▲
by
bern4444
6y ago
I kind of agree with your comment here and with what mlinhares responded with. There are a few engineers I enjoy following who give good, and actionable advice. One is Scott Wvlaschin especially if you're interested in Functional Progr
482.
▲
by
bern4444
6y ago
I personally prefer int x = (cond) ? 5 : 1; Since the question mark applies to the condition and not the 5. This also highlights the 2 possiblities of the value in a more clear way. The two possible values are direc
483.
▲
by
bern4444
6y ago
It has built in LSP, but I still need a few plugins to get additional functionality like auto complete, auto import (thanks nvim-compe!), definition preview (lsp-saga) etc. I love nvim too and the direction its going, but the parent comment
484.
▲
by
bern4444
6y ago
I totally agree. Using react is a breadth of fresh air for building web applications . If all you need is a static site landing page that changes once a year, sure use something else, plain ol html, css, and JS will do wonders. But when yo
485.
▲
by
bern4444
6y ago
It absolutely is. This is competition forcing entrenched companies to adapt and compete. Funds will have to compete by offering new financial products/models/offerings/services etc. The public now has access to information an
486.
▲
by
bern4444
6y ago
money printer goes brrr, stonks go up Obviously there's a lot more to WSB, but the memes and videos they produce (on the above statemenet for example) are fun and descently accurate given the community
487.
▲
by
bern4444
6y ago
> Let's say your UI changes, like a redesign... you can rewrite your component and probably need to change most of them. This is exactly what React does especially for stateless components that purely consume data. The component dec
488.
▲
by
bern4444
6y ago
I thought when such large quantities of shares were being traded, its typically done in a dark pool so as to purposefully not impact the stock price. Dark pools are a means for individuals or organizations who want to trade massive amounts
489.
▲
by
bern4444
6y ago
Scott is able to convey ideas and subject matter so well, his site and his videos are incredibly insightful even if you never write a line of F#. As a separate note, I find F# to be a breath of fresh air as a language, I only wish it was mo
490.
▲
by
bern4444
6y ago
> You'd also be relying on the library developer to fix any issues you have, be it with the library or your own implementation. Isn't this the entire premise behind open source software? You're always relying on the mainta
491.
▲
by
bern4444
6y ago
Totally agree, I think most of the people hating on hooks haven't actually use them to write their own custom hooks or leverage their composable and reusable nature
492.
▲
by
bern4444
6y ago
> The effectful code shouldn't even be there. It should live separately from the render / view code If that's your preference React is probably the wrong tool to begin with. React is just the view in MVC. Plenty of framewo
493.
▲
by
bern4444
6y ago
fair point haha and that's certainly where my personal bias plays a role. When I see something I don't understand I like to look for the reasoning behind it. Some google searching, talking to coworkers, and a bit more googling usu
494.
▲
by
bern4444
6y ago
I disagree that hooks increase the API surface. They decrease the React API. Before hooks, if you wanted a stateful component you had to use class components with all of their specific methods (didMount, didUpdate, shouldUpdate, render etc)
495.
▲
by
bern4444
6y ago
Hooks are the place to segment out effectful code from otherwise pure code useRef is a hook to serve just that purpose as is useState and useEffect. Building new hooks off of these base hooks lets you write your own custom hooks to handle w
496.
▲
by
bern4444
6y ago
I do on a regular basis (front end dev). For an example of how, I found this article[1] to be a nice demonstration of how it can be useful at a basic level for ReactJS. Than you just begin applying the same concepts one level higher for yo
497.
▲
by
bern4444
6y ago
DSS?
498.
▲
by
bern4444
6y ago
By compose I quite literally mean the compose function. const add3 = val => val + 3; const multiplyBy10 = val => val * 10; const subtract5 = val => val - 5; const doABunchOfMath = compose(add3, subtract5, multipl
499.
▲
by
bern4444
6y ago
It was the first bullet point in one of the bullet point sections. The text from the article was A Some(Some(string)) means the resource did exist on the server, and we have it in the cache now. Sorry about that, mixed up the types
500.
▲
by
bern4444
6y ago
The difference I see is, when you work with a nullable type, each function has to do the check so const add3 = (val) => val ? val + 3 : null; const multiplyBy10 = (val) => val ? val * 10 : null So the argument type goes
501.
▲
by
bern4444
6y ago
That's an interesting counter point, though another comment in a different post for this same article[1] pointed out that Dart is considering adding pattern matching too. Though I have trouble understanding how a nominal type system af
502.
▲
by
bern4444
6y ago
If you have a function that works on numbers: const add3 = val => val + 3; and need to make it work on optional<number>, all you need is map const optionally6 = Some(3).map(add3); where Optional.map works just lik
503.
▲
by
bern4444
6y ago
I think dart made the wrong choice here, but I've never used the language personally or professionally. I give the author the benefit of the doubt but Optionals are so much more powerful than what this article covers. You can map, filt
504.
▲
by
bern4444
6y ago
More of a comment on the author, I've found his other articles enlightening, useful as both introductions to functional programming ideas and as comprehensive deep dives demonstrating their intuitive nature both in code and contextual
505.
▲
by
bern4444
6y ago
I don’t understand the idea here. Isn’t typechecking a means of making impossible states impossible? The article references ideas like non empty arrays or limiting the input from all numbers to just integers between 1 and 5 inclusive. These
506.
▲
by
bern4444
6y ago
Right, thank you. There seem to be a few instances in the article where there's either more complexity than needed or missing/incomplete information
507.
▲
by
bern4444
6y ago
When the Hourly Fare rate is noted as 30 + max(0, Speed - 12) that's missing the 2.50 multipler right? Really it should be Hourly Rate = 30 + (2.50 * max(0, Speed - 12)). Or if you prefer Lispy stuff :) (+ 30 (* 2.5 (max (0 (- speed 12
508.
▲
by
bern4444
6y ago
I love this idea too. Is it possible to create a type (in F# or Typescript) to represent an idea like greaterThan2? A value whose type is greaterThan2 would have the obvious constraint the value is always bigger than 2. Having the compiler
509.
▲
by
bern4444
6y ago
Whoops, yes that is indeed a union not an intersection. Thanks for the correction. I'm still getting used to the terminology. The explicitness I was referencing is around the declaration merging. Its automatic so unless there's a
510.
▲
by
bern4444
6y ago
I don't see that recommendation on the page... The fact that interfaces are limited to typing objects but type aliases can also be used for functions is an easy +1 to type aliases. My view is that declaration merging is a bit of an ant
More ›