Better HN
topnewbestaskshowjobs
Log inSign up

LocalPCGuy

1,031 karma · joined Jul 24, 2011 (15y ago) · 619 submissions

Submissions

comment 3y ago · link · parent

Missed the underlying point but I'll make it explicit - if a plugin is "needed" that is also a red flag for me.

comment 3y ago · link · parent

And for those that prefer a different editor? Just saying, if a tool then pushes you into another specific tool for maximum efficiency using it, that alone gives me pause.

comment 3y ago · link · parent

This has been my general opinion on Tailwinds all along. When it first came out I thought it was kinda harmless, it's basically like some of the utility classes that always inevitably get made/used and that's great.

But this idea that all styling should be done in HTML is antithetical to the whole reason CSS came to be in the first place, IMO. I can see why people like it to an extent, but I just don't really get the arguments that switching files to write CSS is "context switching" that makes things harder. If you need to see both your HTML and CSS at the same time then get a bigger monitor (mostly kidding).

I just still see that well crafted HTML and CSS work together, make sense, and especially with all the new tools available in CSS, just isn't that hard to get right. Well structured HTML is the biggest pain point I see for those that struggle against CSS. Learn that, the cascade, learn how to encapsulate styles (there are plenty of good patterns) and it will flow just fine.

comment 3y ago · link · parent

We have UI client tests that cover everything from API, the business logic layer, as well as testing any local logic in higher order and UI components.

Some examples:

- At the API layer, it mocks the network layer and tests that, when triggered, it sends the correct request and given a response, handles it correctly (both for success and fail responses, as well as different expected data).

- business logic layer is some of the most important tests, this layer will test things like how data flows through the app and how it might be transformed along the way for use in the UI. This layer generally sits between the API and UI, so it mocks functions in the API stack and tests various responses, tests streams of data. This layer often is your "traditional unit tests" - testing individual functions to ensure they are idempotent, no (unintended) side effects creep into the code, putting in X gets back Y, etc.

- Higher order UI components - these are components that, while they may have some UI (yah, I know, not purely higher order), they are generally the component that acts as an intermediary between the business logic and more pure UI (display) components. The tests here would mock any calls into the business logic, make sure it properly requests the needed data and then check to see that any local logic is correct. This layer may be handling route params or query params, and adjusting the data request based on that or other data stored in memory or in the app. It may be handling collection of form data and giving it to a business logic function, and handling any errors that may send back, and the tests will check that. It often has functions that are triggered by actions in display components, and rather than try to wire components together in tests (we do have some e2e tests that check at that level), it's better to test those functions in isolation at this layer.

- Display UI components - I don't want to assume, but based on the comments, this is likely what you have thought of when you think of UI testing. At this layer, there should be much less logic in each component. It usually has data inputs, and then renders that into a template. We don't "test the framework" - there's no sense testing that an input prop is "set" correctly. But if the UI component does anything with that prop to prepare it for display, we'll test that. Or if it has UI actions - this is one place we will sometimes tie to the DOM and test things like click events, but most of the time that isn't really necessary (again, we make as assumption that if we properly wire up a click handler, it will fire on click). So many times we will just test the handler themselves, if they do any logic prior to emitting that value back out to a higher order component or to the business logic layer. We try to keep these simple, but there are sometimes tests here that are testing that expected DOM elements are visible based on the state of input data, or that the expect text is visible based on user action (i.e. did a panel display text when the user clicked it open). This is the layer we have to be fairly careful not to write "lazy" tests (did the framework render the text assigned to a variable and interpolated in the template isn't super valuable).

If it matters (and I don't think it should, because the practice of writing good tests, even for client apps, isn't specific to language/framework) our primary apps right now are written in Flutter and Angular. We also use or have used Swift and Kotlin (iOS/Android respectively), Java, React (little bit of React Native but quickly abandoned in favor of Flutter), and Ember (had a pretty big test suite for an Ember app, since shut down though). And, despite all of the above, most of our logic does not actually reside on the client side but rather lives in the API/backend and we are mindful to try to keep as much logic there as possible. And we have good test coverage there as well. Of course, for all our code, the coverage could always be better.

Anyways, I can't really pull code samples as the apps are proprietary (and this is getting long enough as it is), but I hope that answers your question and helps illustrate at least why I believe there can be significant value in client side tests.

comment 3y ago · link · parent

We have hundreds of tests for our client side projects (web app, mobile app), and they definitely do more than what you describe.

Some are simple (although very few are as simple as your example) and some are complex, depending on the portion of the app being tested. Some are basically integration tests for components/widgets, where it runs it in isolation to test the inputs and outputs. Others are more like traditional unit tests where it's purely testing business logic, API and model interactions (mocked), form validation logic, etc.

Unless you're talking about very simple client apps, there's always stuff that can be tested that will provide significant business value by preventing bugs and broken code from getting to end users

comment 3y ago · link · parent

I'm guessing he'll (Wes Bos) bring it up on Syntax.fm, the podcast he does with Scott Tolinski. They've talked about this site before and I would be surprised if they don't bring this up and discuss how/why it failed and any plans for changes to avoid it in the future. As it's a little hobby site for him, not sure how much in the way of resources or money he really throws at it.

comment 3y ago · link · parent

The real money isn't in VR right now though. The real money is in AR. Does this fit that? Not sure, but there are hundreds of use cases for something like this in the workplace (and not just for developers/desk workers). Think the person who needs to reference a manual while working on something (machinery, car, top of a telephone pole, etc.). Just a single example, but I feel that is the kind of market that the executives are aiming at cause they know for businesses, the cost is immaterial if it solves their issue or makes it so 1 person can do the job of 2. Not endorsing it either, fwiw, just saying, that has to be part of the thinking. The gaming market just isn't big enough, especially when you figure in the cost of the equipment (even at half the cost).

comment 3y ago · link · parent

Disabling a key does not help with the spacial issues having a key there in the first place adds for some folks.

comment 3y ago · link · parent

> Someone who has to ask permission of a 3rd party not involved in a transaction is a partial slave.

That is the framing I don't buy

comment 3y ago · link · parent

I feel like your comparisons to slavery are an appeal to emotion rather than a rational argument. Can you either expand further on your argument (rather than just stating it as fact) or link to somewhere where you (or someone who represents that point of view well) discusses it further?

I don't buy the "exert control over another person in their home" argument. I'm not sure why laws about information rise to the level of "slavery" in your view. I think even calling digital items simply "information" is a bit of a (likely intentional) misclassification.

I think there are a ton of problems with the way we handle digital materials from a legal standpoint, and I do think vast swaths should be more freely available, and that the length of copyright and other laws are way too long. So I'm sympathetic, to a point. But the argument you make in the above post isn't really convincing, even to me (someone who likely leans closer to your PoV than many here).

comment 3y ago · link · parent

There is a LOT of room for improvement on copyright and patent laws, no disagreement. But there is a lot of middle ground between where we are now and no laws at all around copyright/patents. In an increasingly digital society, creators should be able to exercise some level of control over what they create for some (relatively short) period of time.

FWIW, I probably lean slightly closer to your side of the spectrum than most, and even I feel this take is extreme.

comment 3y ago · link · parent

Ah cool, thanks, that's why I was clarifying. I'll check it out.

comment 3y ago · link · parent

Eh, "many others"? It's about 2% generally, and it's folks who are generally very well aware of how to re-enable it if needed. IMO, JavaScript is a building block of the web and there is no need in 2023 to build without it, even for progressive enhancement. You may have been able to argue that in 2011 +/- but now the average site should be able to assume it will be available if they have some reason to want to use it.

I'm not saying you need to enable it, but that is a choice you are making, and you have the skill to turn it on/off as needed, and realize that there may be sites you won't be able to use without it. I don't think it's a reasonable expectation today that JS may not be available, except maybe to display a nice warning page stating that.

comment 3y ago · link · parent

Oh sure, I am aware, just mis-typed it in the comment.

comment 3y ago · link · parent

Are you making a claim that him changing his opinion is a negative (real question, I could not tell if you were making a value judgement from your post).

I don't know enough about that specific scientist, but in general, I tend to respect scientists more when they are willing to change their opinion (assuming it's in light of new evidence and not just on a whim) and admit they were wrong previously. That isn't a bad thing, IMO, that is a valuable trait to have, which is why I tend to listen to and respect those who have that trait more than those who dogmatically stick to an opinion regardless of new information.

comment 3y ago · link · parent

FWIW, it's been shown that just the act of taking notes enhances the memory of the person doing it, whether they refer back to the notes at a later time or not.

As to the value of note taking in general, for devs, I equate it to telling someone to "put that in the ticket, don't verbally instruct what needs to be done". Documenting decisions made, who will do what, etc. can all be valuable and prevent needless discussions later about who's memory is correct about X (i.e. how something is supposed to function). Some people have great memories, but others do not, and even if you think yours is not in need of this kind of assistance, having something to reference back to can be a big help, especially when you can say something like "hmm, that's interesting, in my notes, I wrote down we decided to go with Y, but you are saying Z, when did that change?"

I should note that taking notes is a skill like any other, done poorly it can probably have the opposite effect of causing distraction and missing things that are being discussed.

comment 3y ago · link · parent

Not really super important, but thoughts on using an SVG when the same hamburger button affect can be generated with just a tiny bit of HTML/CSS? As little as one element with :before/:after for the top/bottom bars, although sometimes it needs a wrapping element for best styling.

comment 3y ago · link · parent

Definitely - there's a whole class of stuff related to Progressive Enhancement that is being re-learned (and re-shared) every couple years, it seems like. There was whether CSS was expected to be available. In 2011, it was still being argued whether or not JS could be reliably be expected to be on. Now it's probably more about specific features of CSS/JS depending on browser support, but it's still all basically the same stuff, just maybe different techniques.

I don't know if it's still true as I heard this state a few years ago, but at one point the growth rate of new web devs meant that at any given year, more than 50% of all web devs had less than 2 years of experience.

comment 3y ago · link · parent

You could actually skip the button altogether and just make the checkbox input keyboard focus-able but visually hidden. You also avoid the issues with the hash also, as the user is then directly interacting with the element that toggles the menu. With some massaging (ensuring what is read for screen readers is set and that the visual focus state still appears to be on the hamburger when the checkbox is focused), it works quite well both for screen reader users and for non-mouse users. I don't have a current example (looks like it's been redesigned since I worked on it), but I've done something similar to this in the past on extremely large websites (thousands of views an hour in at least one instance) with much success.

comment 3y ago · link · parent

I do think they are being very intentional in how they release and frame things, and one of the things dripping it out can do also is produce some level of fatigue on reporting it. It definitely seems like they knew some things before it came out - some people have looked at changes to their site and there are new or updated marketing changes that in retrospect seem very correlated to what we're learning now. Not definitive proof, but very concerning.

I also think you are correct to a point, they are really bad at security so it is also possible that some of these things are just coming out also.

comment 3y ago · link · parent

Excusing the fact it was a joke, on the serious side, a person shouldn't have any kind of set of "good" passwords. They should just have secure passwords they have auto-generated and have some way of retrieving the password from where they are stored when needed.

comment 3y ago · link · parent

I don't think I actually put this together until I read your comment. My actual diagnosis came just after I went off keto after having been doing it pretty steadily for about 3 years. I wonder now if the reason I noticed the symptoms of lack of focus more prior to seeking help and my diagnosis now was because it was better controlled while I was on keto and in ketosis.

I know looking back I still had symptoms. I can remember days during those 3 years just sitting in the office and realizing I had not gotten a single thing actually done and it was mid-afternoon already. But also had stretches of incredible productivity also.

Thanks for the prompt - been considering going back on keto, one of the reasons I went off is the mixed scientific evidence for its efficacy over other diets (not specifically for weight loss, just diet in the context of "way of eating") and some warnings about the lack of long-term study data because it's so hard for individuals to stay on long term. But this gives me another data point to consider and something to watch if I do try it again.

comment 3y ago · link · parent

I have that on my Pixel phone, if it detects a number that isn't in my contacts, it'll auto-screen the call and provide me with a text transcript of their response. I can see what the person says and choose to answer or let them just continue on to leave a message.

And if it thinks it's actually a spam call, I don't even get it ringing, it just quietly "handles" it (but obviously takes a message so I can call back if it was wrong).

comment 3y ago · link · parent

Definitely felt like a pretty low cost. I've worked with their support briefly also which helped me resolve an issue I was having (been so long ago now I honestly don't remember what it was). I'm literally typing on my Windows PC from my Mac laptop right now. I used to use it a lot for testing Windows browsers (less needed now that IE is dead and Edge is Chromium).

The only issue I really have now is once in a while I can't use my keyboard on the client computer(s), and that is because my server is currently my work Mac, and the terminal will occasionally request secure lock (probably when I use sudo) and as part of that, the keyboard is not allowed to be accessed by programs like Synergy until the lock is released. But Mac gets kinda buggy once in a while and doesn't properly release the lock.

Most of the time it just works though, and I've gotten way more than my $30 worth at this point.

comment 3y ago · link · parent

Been using Synergy and recommending it for many years, paid for it a long time ago as I thought it was worth supporting given how much use I've gotten from it.

Besides being OS, what are the advantages of Barrier? Worth the (probably small amount of) time to switch?

comment 3y ago · link · parent

Also of note, the activities listed are often considered "thrill seeking" which those with ADHD are often more highly attracted to (compared to the average person) for the extra dopamine hits.

comment 3y ago · link · parent

It's actually about 5% of the population expected to have ADHD (diagnosed or not). A lot of people get distracted or bored, procrastinate at times, without it being a symptom of ADHD.

comment 3y ago · link · parent

Definitely a lot of study in this, and much of it has shown there is a very strong sign that it is genetic and inheritable. As others have mentioned, twin studies and family studies have strongly supported a genetic component.

Doesn't mean there isn't also some nuture involved also, likely not the "over-stimulation" argument you make, but more likely the "if you have it, more likely to recognize it in your children" type of thing.

From the following link

> Decades of research show that genes play an vital role in the etiology of attention deficit hyperactivity disorder (ADHD) and its comorbidity with other disorders. Family, twin, and adoption studies show that ADHD runs in families. ADHD’s high heritability of 74% motivated the search for ADHD susceptibility genes. Genetic linkage studies show that the effects of DNA risk variants on ADHD must, individually, be very small. Genome-wide association studies (GWAS) have implicated several genetic loci at the genome-wide level of statistical significance. These studies also show that about a third of ADHD’s heritability is due to a polygenic component comprising many common variants each having small effects.

> Family, twin, and adoption studies provide a firm foundation for asserting that genes are involved in the etiology of ADHD.

> Adoption studies suggest that the familial factors of ADHD are attributable to genetic factors rather than shared environmental factors

> A similar heritability estimate of around 80% was seen in a study of MZ and DZ twins, full siblings, and maternal and paternal half-siblings

> There can be no doubt that DNA variants in genes or regulatory regions increase the risk for ADHD. In rare cases, a single genetic defect may lead to ADHD in the absence of other DNA variants. We do not know how many of these rare variants exist or if such variants require environmental triggers for ADHD to emerge. It is equally clear that no common DNA variants are necessary and sufficient causes of ADHD.

It doesn't preclude environmental factors either:

> The convincing evidence for genes as risk factors for ADHD does not exclude the environment as a source of etiology. The fact that twin estimates of heritability are less than 100% asserts quite strongly that environmental factors must be involved. ADHD’s heritability is high, and that estimate encompasses gene by environment interaction.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6477889/

comment 3y ago · link · parent

> nothing at all like severe ADHD ... cases generally diagnosed in children because it's so obvious

I think the thing you might overlook with this statement (truncated slightly) is that sometime people are able to mask their symptoms, especially those who are highly intelligent and who may fall into an "inattentive" diagnosis, rather than the "hyperactive" side. I agree there are different levels that the affect can have on folks, however there is a difference between the boredom/procrastination/etc. struggles with someone who has ADHD and someone who doesn't. It's isn't just something that "everyone deals with to some extent or another". And proper diagnosis techniques will also sort for false positives, to eliminate folks who are actually "just bored", for example.

That said, this is something that studies have shown very much needs to be addressed not only from a medication aspect - sometimes it is definitely necessary and in many cases all the behavior techniques in the world won't make up for the chemical imbalances. But it should also be addressed from a behavior standpoint, via CBT or other therapy as well as other wellness techniques you mention, like good nurtition, sleep, exercise. From the studies I've read, the best results come from a combination of the two, not from ignoring or promoting one over the other.

comment 3y ago · link · parent

People who are gifted definitely do just what I think you are saying - they blame their failures on their own personal inabilities to cultivate habits. And because they are smart, they were often able to compensate for potential ADHD symptoms throughout school and while young, and so it's often ruled out and not even considered until they are adults (and then often not considered because they "did good in school" etc.) Obviously not everyone who thinks they are gifted actually is, but talking about those that are here.

As one of those persons (tested 98th percentile on SAT in 8th grade, for example, and was in gifted or advanced classes until I just got bored of "extra work"), I think it is important to really consider this and reflect on whether or not something like ADHD could be at play and getting in the way of life goals. The rejection sensitivity dysphoria mentioned in the article, while it is not a diagnosed condition (won't find it in the DSM), does describe one of the states of mind of a lot of people with undiagnosed ADHD because of a lot of negative conditioning for many years, being told they just didn't have enough willpower to do things "right".

12345
21