346 karma · joined December 7, 2019
Then there is also the fact that JS is actually a pretty great language if you know how to avoid the footguns. Granted that's not always easy, but it's a language with lexical closures and easy and familiar syntax, it's also very expressive and has a vast ecosystem supporting it. And you can even add the typescript compiler on top if you want compile-time type-checking.
It's also async out of the box, and while that doesn't solve all problems, it scales surprisingly well with no performance tuning whatsoever, it even has decent asynchronous primitives that make it easier to write correct code.
You seem to be contrasting this with the implication that it doesn't take adults years of near consta
const map = (arr, mapper) => arr.map(mapper); // Non "traditional" order for arguments
const curry = f => (...first) => (...second) => f(...first, ...second); // Classic currying: partially apply arguments to the start
const reverseCurry = f => (...second) => (...first) => f(...first, ...second); // You might want to reverse() first and second depending on the desired syntax
const arrayMapper = curry(map)(array); // Usually not that useful, more common to map over many arrays with the same function than to map over the same array with many functions
const funcMapper = reverseCurry(map)(func); // Same benefits as having the classic argument order in the first place
If you're working in a code base that doesn't already implement "most specific argument last", or does so inconsistently, it's very easy to write partial application functions for both cases. If your functions aren't variadic you can even get over the clunky double call syntax by checking the total number of arguments passed thus far, and if it's greater than or equal to the function's "length" (the number of named arguments that it takes) call it, otherwise return the partially applied function, something that is sometimes known as "autocurry".The scientific consensus on weight loss is pretty clear: all forms of diets are similarly effective when you control for calorie intake. Low carb diets work, low fat diet work, intermittent fasting works, plain old fasting works, McDonald's diet and Twinkie diets work. This is nothing new and calorie deficit is always the best predictor regardless of the diet type.
He seems to make the argument that high insulin causes fat to accumulate and as such reducing carbohydrate lowers insulin and increases weight loss, but I have yet to see any evidence that a high-calorie keto diet will result in weight loss.
The general consensus as to why keto works for some people is that it makes hunger management easier, although AFAIK there is no mechanism that has been clearly identified as being the main responsible, people who succeed on keto report higher levels of satiety after meals, but the same can be said of many other diets for people on which they work.
There's a paragraph in there about keto being restrictive and he's basically dismissing the claim with "it feels less restrictive for people who feel less hungry on keto", which, fair enough but I don't think that enough evidence to say "promoting the keto diet will address the obesity problem". There may well be tons of people for whom keto is too restrictive, because they won't feel less hungry after meals.
In the end, the best diet is the one you can stick to. For some people that's keto, for most people it's portion control, for others it may be intermittent fasting, for others it may be offsetting their food intake with exercise. In the end, I think it's harmful to promote any specific diet as "the cure to obesity", and it's far better to encourage people to try out different diets rather than giving them the idea that "if this diet won't work, nothing will". Try different things out and see what works for you.
This is basically what a good debugging environment is. Some of the best tooling out there is the dev-tools of modern browsers: you get a regular debugger where you can step through code and see the state, you also get some performance and memory visualization tools, you get an interactive html editor in which changes are reflected in real time, you get color pickers when modifying css colors, you can visualize the timing of requests, and you get autocomplete propositions all over the place.
This is not an article about how to teach or learn programming, this is about creating an environment inside of which learning is made easier.
Try giving a freshman a binary search program with an interactive visualization like the ones shown in this article that they can play with, and see if they still struggle with it. Same goes for the permutations. You don't have to teach anything when you can let someone experiment and teach themselves how something works. At the end of the day, true learning always hinges on personal insight, and the best teaching methods are those that make it easiest for a person to extract insight.
Why would you expect that? What concrete advantage does a mouse have over a trackpad for gaming that doesn't translate to regular use?
Ten years ago. The second best time is right now. You do not have to take abuse from them because they are family. "the past is the past, people have flaws" is only valid for things that are actually in the past. Sounds like your parents' abuse would be much easier to deal with if it was a part of the past.
This has still been happening where I work, instead of walking over they hop on the voice channel, same old.
Considering this is also a "news" site, I would guess a lot of people (I know I do) simply browse it quickly to keep an eye on the technical landscape as well as for ideas for future technical exploration.
I think if you want engagement on "non-scannable" pieces like this one, you would be better served by a sort of "book club" system, where people can submit long-form content and vote on it to pick one for discussion a week later. This seems like a cool idea actually. Might have to play with it.
95% of the code you write day to day should be clear enough that someone who didn't write it can understand it on first read (the reviewer). If they can't, you probably need to rewrite the code so that it is clearer, not comment it. That's what self-documenting code is.
Instances where the code needs comments to be understandable are rare.
I see this argument all the time but I just don't get it. Python and Javascript are remarkably similar, they have different syntax and the metaprogramming side of things is quite different but aside from that, it's really not a big jump.