Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.

top 95 comments

sorted by: hot top controversial new old
[–] 44 points 2 weeks ago (3 children)

Cloud computing is the biggest breach of privacy out there that we've adopted whole hearted.

  • source
  • hideshow 3 child comments
  • [–] 120 points 2 weeks ago (8 children)

    Getters and setters are ridiculous

  • source
  • hideshow 8 child comments
  • [–] 61 points 2 weeks ago (3 children)

    I don't like working with them any more than you do, but they're necessary to enforce read/write-level security. Without them, there'd be no differentiation between reading a variable and writing variable from an external class, which kinda defeats the point.

    From a development standpoint, they're an extra hurdle to clear. From a security standpoint, they're a necessary evil.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 30 points 2 weeks ago* (2 children)

    Moreso correctness, not security. In the end, your user is shooting themselves in their foot, if they mutate a variable that they shouldn't, and by making the variable private and only offering a getter, we document that.

    Having said that, there's also big differences between languages and paradigms, though.
    In object-oriented / garbage-collected languages, you often pass around references to an object into so many places that you need to code defensively versus your own codebase. That's why getters/setters were taught religiously during the height of OOP.

    In other paradigms, you often just have one place that uses an object and then you can ...simply not shoot yourself in the foot there. When you control both the definition and the access, you don't need to protect yourself from yourself. In particular, you would probably think twice before mutating an object anyways.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 2 weeks ago (1 child)

    Damn, I was gonna disagree but you bring up some good points.

    I really need to get into functional programming.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 2 weeks ago

    Functional programming is definitely worth a look in this regard as well, but what really drove this home for me is Rust.

    Its ownership+borrowing concept is exactly that, it enforces that you've got one place where an object is managed and in particular mutating can only be done in at most one place.
    Obviously, there's also ways to get out of that, in case you do want some memory managed centrally, but it just isn't the default.

  • source
  • parent
  • [–] 40 points 2 weeks ago (3 children)

    The entire modern web tech stack should be thrown in a dumpster, ignited with gasoline, and blown up with a nuke for good measure.

  • source
  • hideshow 3 child comments
  • [–] 78 points 2 weeks ago* (5 children)

    if you're making a user-facing program, you should always design with the possibility that it will be run on some truly dogshit hardware and you should make sure that they still have a good experience. good computer hardware is a luxury on the world scale, even before the rampocalypse

    related, but the answer to the question "who still uses {x} these days?" is almost always way, wayyyy more people than you think

  • source
  • hideshow 5 child comments
  • [–] 18 points 2 weeks ago*

    Me when I got my commercial NAS with 7 years of support, I was thinking: "who even keeps hardware for this long?"

    Me, 7 years later: "What do you mean EOL?!"

    I certainly learned to care for and appreciate the hardware these years.

  • source
  • parent
  • [–] 10 points 2 weeks ago

    That’s so why a lot of artists I know of when mixing, like to test their songs on stock/sub-par monitors. Not everyone has reference quality equipment and you want to make sure your song works just as well thumping with the windows down as with your hi-fi system.

  • source
  • parent
  • [–] 57 points 2 weeks ago (13 children)

    I am still not convinced vim does much of anything for your productivity.

  • source
  • hideshow 13 child comments
  • [–] 7 points 2 weeks ago (3 children)

    Do other editors let you save multiple sessions? Where you can open up any large project exactly where you left off, every tab, split, window, layout, and file already in your buffer for all of your projects or just the last one you were working on?

    If not, this feature has saved me a lot of set up time. It's been a long time since I used anything else.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 2 weeks ago*

    People (such as myself) make the argument that it does a better job because it's focused more on reading code than writing it since you don't start in the "write" mode like in most editors.

    I would say the choice of text editor shouldn't make a difference in productivity so long as it doesn't actively get in your way too often (looking at you, poorly implemented autopairs) and it supports the relevant LSP and debugging protocols.

  • source
  • parent
  • [–] 3 points 2 weeks ago

    It does but not because it's vim or about any features really. It does for me personally only because I'm so used to it, most of the tasks like search, highlight, open diff, list compile errors, follow function calls etc work without mental load. Any editor will do that for you if you customize/memorize common hotkeys for your use case.

  • source
  • parent
  • [–] 2 points 2 weeks ago

    It really doesn't. The time you spend learning it and setting your config will never pay off and even after you do these things the time it saves you is negligible. I can use Zed and have 90% what Neovim offers me, it even has really good vim motions. Picking them up for productivity is a bad reason to do it.

    I really liked a talk by TJ titled (Neo)Vim Made Me a Better Software Developer. The reason he uses it - is because it was basically a playground where he could play around with his code and get instant feedback as he's the "customer".

    I can relate to this. Neovim is really extensible and minimal by default. This encourages 2 things:

    1. To live close to your code. You really get an understanding of all of the underlying tools related to your development environment and it gives you control to make it as minimal as you want it. There's wayy less abstractions on top to simplify stuff for you. When I was a beginner using Webstorm or whatever I had no clue what a LSP was. Git? Just use built in GUI why bother learning commands? Terminal? Why would I need that? Ripgrep? Treesitter?
    2. To play around, customize, build stuff. There's lots of API's and you can change a lot in the editor. I made Neovim my main markdown editor with a few tweaks in my config. It's minimal and I like it. Wayyy better than Obsidian.

    And at the end of the day it's kinda fun. It makes writing code more more enjoyable as you always end up learning how to navigate your code base more efficiently. Like a game almost :)

  • source
  • parent
  • It's pretty useful for text editing, but for any more serious code work I prefer to use an actual IDE.

    As far as software development, Vim seems to me like an excellent solution for an irrelevant problem (typing speed).

    Also, it's great that it's lightweight, but I bought the entire RAM and I'm going to use the entire RAM :P

  • source
  • parent
  • [–] 28 points 2 weeks ago (1 child)

    I remember on Reddit several years ago I said that automatic bitlocker is the curse of installing W11 on a laptop.

    I got down voted so hard. One comment even said you should be thankful because encrypting by default should be the norm.

    But yet if I add any thunderbolt device to my windows before I boot it, it requires me to input my 25 character bitlocker key... that's hosted online within my Microsoft account.

    Bitlocker enabling by default without user input is horrible. Hosting the keys online is also horrible. It could be so easy to socal engineer into your Microsoft account.

  • source
  • hideshow 1 child comment
  • [–] 3 points 2 weeks ago

    Bitlocker enabling by default without user input is horrible.

    I disagree

    Hosting the keys online is also horrible.

    I agree

    It shouldn't require a loophole to use Windows without a Microsoft account. Cloud hosting the bitlocker key does remove a lot of the security benefit in the first place. But I also recognize if you're going to enable it by default, you have to automatically store it somewhere since most people will not save it themselves. But Microsoft should not be able to access the keys either, they should be fully encrypted without the users password.

  • source
  • parent
  • [–] 75 points 2 weeks ago (20 children)
  • [–] 28 points 2 weeks ago (3 children)

    Firefox is good, Mozilla is bad

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 2 weeks ago* (last edited 1 week ago) (2 children)

    You know what, I’ve been a Firefox user since the days of beta Phoenix. I’ve expressed your view for years now - Firefox was great, but held back by a commercial org that wanted fancy SF offices, fancy SF compensation etc.

    But I tried out Helium a little while ago and in truth, I’m not sure Firefox is all that good these days. Helium is basically ungoogled-chromium + extension support + super lean UI.

    The upside is that you no longer have to contend with sites that have given up on Firefox testing. The downside is manifest v3. But all in all, I find it a better browser. Firefox is so busy telling its story, and finding revenue, that it just seems to have left behind product market fit.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 8 points 2 weeks ago (5 children)

    It's the only non chrome browser

  • source
  • parent
  • hideshow 5 child comments
  • [–] 4 points 2 weeks ago (7 children)

    This would not cause the reaction in the picture lol.

  • source
  • parent
  • hideshow 7 child comments
  • [–] 4 points 2 weeks ago (3 children)

    Yeah maybe not here but sometimes I feel like it

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 2 weeks ago (2 children)

    Where? On the Chrome/Brave subreddit? :p

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 2 weeks ago

    No need to go to reddit, there's enough trolls here saying Firefox is trash and to use brave instead.

    Y'know like, the guys saying accessibility features are trash no one wants to use because they use local AI models.

  • source
  • parent
  • [–] 23 points 2 weeks ago (7 children)

    Care to elaborate on this? Not saying you're wrong necessarily, that's just a pretty bold claim and I'm curious why.

  • source
  • hideshow 7 child comments
  • [–] [S] 31 points 2 weeks ago (6 children)

    React works by maintaining a virtual representation of the DOM. When you dispatch state changes into the virtual DOM react can determine which components depend on the change and which side useEffects run.

    My gripe is that YouTube tutorials teach that the useState is the equivalent of a variable. This encourages average developers to problem solve solutions that end up using React's Virtual DOM for business logic. The YouTube tutorials have react devs planting 100s of useStates - some of which don't directly induce a visible-on-screen rerender - and then ⅒ as many useEffects to bind these states together. This means that for the Virtual DOM to come to the conclusion as to what html elements need to be changed and how it has already mutated 20-50-100s of times and the CTO tells me the react app is slow and they're mad.

    If 2 states have the opportunity to mutate each other back and forth then the truth is that you have 2 perspectives of the same state. And React gives you solutions for that - proper solutions - the useReducer hook is for defining these complex state mutations and the Context API for communicating that state to any component.

    And this has me quintuple pissed off because these same tutorial grade react devs install REDUX as compulsively as a pack-a-day smoker (that's #3). They use Redux to file variables in JavaScript memory (that's #4) like it's a global variable and rarely if ever use it for the complex state mutations they need instead I've seen react devs write components pull state out of redux into a component just so it can mount useEffect and process the state and dispatch the result back into redux. Let's not even bring up how the react-redux binding library literally uses the React Context API (that's #5).

  • source
  • parent
  • hideshow 6 child comments
  • [–] 25 points 2 weeks ago (2 children)

    As someone who's worked with react for years, I'm convinced that react itself is the problem and there's no way to educate new people on the proper way to use it without essentially teaching them everything the abstraction is intended to do for them. Why should newbs have to care about mutations and state dependencies when the api is apparently designed to help them forget about those things?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 7 points 2 weeks ago

    Exactly this. Instead of learning about the complexity and footguns of working directly on the DOM, people get to learn about the complexity and footguns of manipulating the virtual DOM.

    React isn't bad, but it was designed in a very opinionated way to build certain kinds of apps. Excessive abuse of React hooks shows a common desire path to build things that don't require that framework. Most people basically just want signal based reactivity but don't know that it exists.

  • source
  • parent
  • [–] 13 points 2 weeks ago

    As a tutorial grade react developer (please return me to the backend where I am mediocre instead of bad), having more senior developers take the time to explain why my code was bad was really helpful.

    Also I think I just kind of hate JavaScript. It always feels like everything is more complicated and booby trapped than it should be.

  • source
  • parent
  • [–] 4 points 2 weeks ago

    Since it's apparent you can spot what tutorials do it wrong, would you be able to provide links or references to online tutorials that get it right?

    One of the most valuable things you can do if you know a technology well enough to have these gripes is not just to condemn people fucking it up but shine a light on people that are trying to do it well.

  • source
  • parent
  • [–] 21 points 2 weeks ago

    Java Is actually good for what it does, maintain long term systems that only need updating every once in a while

  • source
  • [–] 20 points 2 weeks ago

    Vue > React

  • source
  • [–] 19 points 2 weeks ago (2 children)

    I've talked about it before, but I really hate PDFs. Specifically the things PDFs are used for. If you aren't planning to print something and will only ever look at it on a screen, HTML is better. It's so frustrating when you're going to a website, you know, a thing that serves content in HTML, and then some piece of information is in a PDF.

  • source
  • hideshow 2 child comments
  • [–] 2 points 2 weeks ago (1 child)

    If you're sharing graphical elements then I prefer pdfs when you know it's final, and you want to make sure people see it how you intended, and you want it to be vector format. Similar thing if the information is some complex format/layout. People can zoom in instead of having their device messing it up.

    But I agree on simple contents like documents, tables, and such

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 weeks ago*

    A PDF file being "final", displaying the same everywhere, and being reliable is a myth.

    I have never worked with a messier file format, and I have seen many PDFs displaying in as many ways as I have applications able to view PDFs.

  • source
  • parent
  • [–] 76 points 2 weeks ago (17 children)

    Tabs are better than spaces

  • source
  • hideshow 17 child comments
  • [–] [S] 24 points 2 weeks ago (6 children)

    Tab chars are better than spaces AND the correct tab width is 2 spaces

  • source
  • parent
  • hideshow 6 child comments
  • [–] 1 point 2 weeks ago (3 children)

    I was on board with the first guy, but this is going too far. We should compromise between the 2- and 4-spaces camp, and we settle on 3 spaces.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 2 weeks ago*

    @Humanius @danhab99 Formating is so 1990. Modern would be to store Program code as database. Formating and UX of program code would be separated and an IDE would show Program code in the user preferred way.But every Developer: "Hey modern way to store structured Data, you are wrong for my Work."#structureddata #developer #conservatives #notonmywatch #codeformatting

  • source
  • parent
  • [–] 19 points 2 weeks ago* (5 children)

    Want to know something horrendous? Odin, my current favorite language, recommends mixing tabs and spaces in their style guide.

    What's worse, their justification actually makes sense.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 16 points 2 weeks ago (3 children)

    Linux should be forked at a pre-ai date.

  • source
  • hideshow 3 child comments
  • [–] 6 points 2 weeks ago (2 children)
  • load more comments
    view more: next ›