HNHacker News
TopNewBestAskShowJobs

brlewis

11,792 karma · joined February 20, 2007

meet.hn/city/us-Beverly

Socials: - github.com/brlewis

--- Bruce Lewis, creator of https://en.howtruthful.com/

submissionscomments
brlewis··on Emacs 27.1
Yes, jump-to-definition will work correctly in both components.

I've been calling emacs an IDE for a long time. https://news.ycombinator.com/item?id=72895

brlewis··on Emacs 27.1
>> - extract method

>I don't know what this is, sorry

In emacs, try M-x tide-refactor. It's the "extract to function in module scope" option.

brlewis··on Emacs 27.1
> So imagine you are using something like React/Angular or other templates you want your IDE to understand this templates and not highlight the syntax as errors, if you use a function/object defined in a js file in a template you want the IDE to make the connection. So when you want to see where a symbold defined in a .js file is sued you want to be found int the template file. You could have 2 different components that both have a thing called name - you want the IDE to not confuse this and consider this 2 different things as the same but be correct.

Why imagine? I have emacs open and it's doing this with React right now (tide mode).

brlewis··on Emacs 27.1
Using prettier-js-mode I don't worry about messed up indentation; any problems are fixed on save.
brlewis··on Emacs 27.1
Yeah LSP is taking over. I don't think category 1.1 is going to last.
brlewis··on Two Features of JavaScript that you might not know
Why would one check if the new syntax is available rather than just use browserslist? https://github.com/browserslist/browserslist-example#babel
brlewis··on Google discontinues the Pixel 4, nine months after release
Yeah two of my daughters are very happy with the cameras on their Pixel 3As, enough that they're willing to put up with the badly cracked screens.
brlewis··on Two Features of JavaScript that you might not know
Ideally, JS would have been based on S expressions and consistency would naturally flow from the syntax. But that ship has sailed, and occasionally it makes sense to add a new infix operator for succinctness. https://github.com/tc39/proposal-exponentiation-operator#inf...

With prettier, one can make an old style go away.

brlewis··on Two Features of JavaScript that you might not know
Yes, TypeScript adds features from the ECMAScript standard. Sometimes JS implementations add them around the same time TypeScript adds them. But sometimes TS adds them much earlier. Having been using TS, it surprised me in this article that nodejs didn't add numeric separators until recently. I had to check MDN to make sure it was right. TS, with or without Babel, keeps me from having to know what features are supported where. I used to frequently check MDN and caniuse.com out of necessity. Now I check infrequently out of curiosity.
brlewis··on Two Features of JavaScript that you might not know
> It allows people to write JavaScript following whatever approach suits them

This comment really looks like it's a reply to some article other than this one.

Realistically, do you think JS programmers are going to form two camps?

  x ** y 
  Math.pow(x, y)
I don't think so. I think people will just stop using Math.pow.

Nor do I foresee a big problem with some numeric constants being written with separators and others not.

In the unlikely event there's a problem with either addition, prettier can be enhanced to make it so developers don't need to be up to speed on them.

brlewis··on Apple does not keep the 30% commission on a refund
To even have hope of getting people to overcome confirmation bias and look at evidence, we need concise and convenient ways of presenting evidence. Fact checking is too much of a chore the way things are now.
brlewis··on How to Become Convincing
Outside of physical force, the way to make someone agree to what you have in mind is to show them how it ties into what they want.
brlewis··on Svelte and TypeScript
> Using editors like vim wouldn't work

Hi. Fellow emacs enthusiast here. We can evangelize emacs tide mode and slander vim on other TypeScript articles, but I think it's best not to do so on this article, because it specifically mentions vim in the editor support section.

https://svelte.dev/blog/svelte-and-typescript#2_Editor_Suppo...

brlewis··on Eric Schmidt is working to launch a university
People derive value from a higher education beyond just prestige. A 100% prestige item like a medal is different.
brlewis··on Eric Schmidt is working to launch a university
When a school rejects qualified applicants because there are too many, doesn't that indicate a shortage of that kind of school?
brlewis··on Common mistakes writing React components with hooks
Is the well-documented feature the dependency array or the ability to suppress linter rules? The note at the bottom of the documentation section for the dependency array recommends using the linter rule: https://reactjs.org/docs/hooks-effect.html#tip-optimizing-pe...
brlewis··on Common mistakes writing React components with hooks
Are you saying that writing code in a way that defends against future mistakes is a waste of time? It's hard to see the content of your comment through the sarcasm.
brlewis··on Common mistakes writing React components with hooks
There is no harm in adding something to the dependency array that you don't expect to ever change. The linter is your friend; make its job easier.
brlewis··on Common mistakes writing React components with hooks
That runs the risk of someone less experienced introducing a bug later when a new dependency is introduced. I think it's better to simply do whatever the linter says.
brlewis··on Common mistakes writing React components with hooks
Yes. The author should replace "This is dangerous" with "This is a tiny bit sub-optimal" in the first example.

EDIT: "This is dangerous" is also the wrong label for the 2nd example. Should be "This is not the cleanest way"

EDIT2: "This is dangerous" is also the wrong label for the 3rd example. Should be "This is not the most readable". I'd also note that I'm surprised the author has seen this mistake a lot; the "solution" looks like the happy path most people would follow in the first place.

EDIT3: "This is dangerous" in the 4th example should be replaced with "This could be simplified"

EDIT4: "This is dangerous" in the 5th example should be "This makes redundant API calls". I'd also note that I'm surprised this example is even included. How could anyone miss that fetchData() is being called every time updateBreadcrumbs() is called?

brlewis··on Any claim without a URI should be treated as suspicious
A full rationale is a nice ideal, but if you don't have time to research and compose a full rationale, silence is not always the best alternative.
brlewis··on Any claim without a URI should be treated as suspicious
If nobody's going to answer you, your position wins regardless.
brlewis··on Any claim without a URI should be treated as suspicious
The extension needs to be installed by both the creator and the receiver of the URL with the original intended text encoded into it?
brlewis··on Any claim without a URI should be treated as suspicious
Why is expressing disbelief less furthering of discussion than citation-free expression of belief?
brlewis··on Any claim without a URI should be treated as suspicious
> There is a huge asymmetry between the effort to make an outrageous claim and that to refute one.

Asking "Got evidence for that?" is sufficient refutation for baseless claims.

brlewis··on Any claim without a URI should be treated as suspicious
How is it different from this bookmarklet?

https://twitter.com/austegard/status/1228150401427529728

brlewis··on It pays to be grumpy and bad-tempered (2016)
This article is a load of malarkey.

Being grumpy and bad-tempered are predispositions toward having negative emotions in more situations than most people would.

There are two classes of evidence in the article.

The first is evidence that negative emotions are useful in certain situations. One does not need to be grumpy and bad-tempered to recognize such situations and act appropriately.

The second is anecdotes where successful people had emotional outbursts. I assert that the outbursts did not cause the success. Passion caused both the outbursts and the success, separately. Thus there's correlation between outbursts and success but not causation.

brlewis··on It pays to be grumpy and bad-tempered (2016)
> If someone invites you over for dinner in the US you’ll often hear “that meal was amazing!” even if it wasn’t. That’s just polite behavior

You aren't saying it's impolite so say anything less, right? I've lived in the US all my life and that's not my expectation...it could be that cultural expectations are not uniform.

brlewis··on Etcd, or, why modern software makes me sad
Did the dynamic typing evangelist eventually agree to noImplicitAny?
brlewis··on Orthodox Privilege
"As a rule, any mention of religion on an online forum degenerates into a religious argument. Why? Why does this happen with religion and not with Javascript or baking or other topics people talk about on forums?"

I want to be on the JavaScript and baking forums that he's on.

← PreviousPage 9 of 34Next →