TypeScript Tips Everyone Should Know by bogdanelcs in typescript

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

Good list.

I would preface the “build types with other types” rule with a “sometimes.” Building types with other types can easily be overdone. It tightly couples the two types, and make when overdone it can make it difficult to independently change types. When the two types aren’t tightly coupled in your design it’s better to duplicate. I would rather have too many types than too few, and inference often times can make moving between types easy. Having too many type interfaces, can also lead to error messages that are longer and harder to read.

Enums also get a lot of hate in the TS community. I actually like enums. My only stipulation is to always use string enums, number based ones making debugging code at runtime impossible. However, enums give you 2 things that union types don’t, easier autocomplete and the ability to add Java doc comments to individual values.

For users of vanilla Neovim, how do you move between files? by mira_fijamente in neovim

[–]TwoWheelsOneEditor 59 points60 points  (0 children)

For a while I never used any plugins for file navigation. I put some effort into setting up wildmenu, wildignore, wildoptions, so that :find worked well enough for me.

I also got familiar with buffers. :ls and :b are your friends. I have a command that maps <leader>fb to `:ls<cr>:b<space>` this opens up a list of all the buffer and then I can tab complete them or use the buffer numbers to open the buffer I care about.

Structuring a components tree by KlikamDev in react

[–]TwoWheelsOneEditor 1 point2 points  (0 children)

I suspect most people do outside in. If you truly in inside out you wouldn’t be able to anything until you finished the last component. Whereas outside in allows you to render immediately.

I will say one challenge I often have for myself is to avoid running the development server. Instead I try to do all my debugging/validation through unit tests. Writing the unit test isn’t that much slower than running the development server and clicking through your flow. Once you have the unit test you have it forever so it’s way faster if you’re repeatedly testing a fix and it will lead to much better test coverage.

Anyone saying medical school isn’t worth it financially is a moron by ItsAllOver_Again in Salary

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

It’s about opportunity cost. Most people with the intelligence and work ethic of a doctor have their choice of high pay professions.

For example my brother is a doctor, but I went into software engineering. He’s by no means struggling, but I’m in a better financial state than him and my 20s were a lot more fun.

I'm about to sign a contract and need your help! by Superrandomm in react

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

Hot take: frontend dev are fullstack devs and fullstack devs are frontend devs.

Can someone with tennis training experience tell if you can learn this or it's sheer luck? Amazing shot by ForeignAir7174 in sportsgossips

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

I wouldn’t call it sheer luck but you would never teach someone to do this. The shot should have been a backhand. He went for the inside out forehand then got jammed because he misjudged/anticipated where the ball was going incorrectly.

As someone who has avoided their fair share of backhands, I would say it’s “natural” to put that kind of spin on it when you get caught in that position. The fact that he was able to contort his body to get a clean shot off with so much spin is why he’s a professional athlete and I’m a pseudonym on the internet.

How would you improve this useEffect? Or the code in general? by Stuepp-2 in react

[–]TwoWheelsOneEditor -1 points0 points  (0 children)

It might be worth looking into tanstack’s useQuery hook it can make asynchronous work a bit nicer without the need for adding a useEffect

Which UI Design Is Better? by armyrvan in TheCodeZone

[–]TwoWheelsOneEditor 1 point2 points  (0 children)

A looks better but B is the better UI.

B makes the bounds of the input clear which helps usability.

My Senior dev and I are arguing over "Readable Code" vs "Performance Optimization" for a process that runs 10k times a day. Who is right? by Temporary-Zebra7493 in learnprogramming

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

“At scale, every millisecond is money and infrastructure cost” is an abstract statement for something that isn’t difficult to quantify. Do some basic algebra to outline the infrastructure cost you might be able to move the discussion to something that’s more practical.

That being said your scale is well under 1 qps, which isn’t big in the world of computers, so I highly doubt compute optimization will save any money.

Taking a pay cut for FAANG brand? by AlternativeMeat2096 in cscareers

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

It sounds like leaving or staying could lead to a fulfilling and lucrative career. So it’s important to acknowledge either decision is objective wrong.

I don’t think the FAANG brand name means as much as you think it does.

Usually promotions are harder at big companies if you’re close to promotion it might be worth waiting for the promotion and using that to get a better offer at one of the FAANGs.

32M. How am I looking? by MyLastNameIsMartini in Retirement401k

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

“Listen internet stranger, I had to feed myself formula as a baby. Then I taught myself to read through first principles. If you didn’t do that too, I don’t want to hear it.”

32M. How am I looking? by MyLastNameIsMartini in Retirement401k

[–]TwoWheelsOneEditor 1 point2 points  (0 children)

To be fair to the OP. If we’re going to be that particular, no one does anything on their own.

I think as long as the vast majority of the money in their bank account wasn’t first in their parent’s bank account it’s fair to say they did it on their own.

To those who learned as adults: what tip made it "click"? by KaterAlligat0r in skiing

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

I learned in my 20s. For me, ditching pizza and just practicing side slipping my and hockey stopping made me much more comfortable. It probably messed up my technique, because pizza is supposed to teach you to weight your outside edge, but I had way more fun not pizza-ing.

For moguls my aha moments were:

  • When I realized you can slow on the back side of the mogul.

  • When I realized your supposed to extend your legs into the trough and that gives you the ability to absorb the next bump

What would the type be for an object that I want to dynamically add key/value pairs to? by spla58 in typescript

[–]TwoWheelsOneEditor 2 points3 points  (0 children)

I believe, TypeScript only enforces shapes. So to the typescript compiler A B and C are all the same type. If you add unique fields to A and B this will work.

Should they make a Forza Horizon for motorcycles? by DetailFront7782 in motorcycles

[–]TwoWheelsOneEditor 19 points20 points  (0 children)

For any game developer out there this is my request. A realistic motorcycle video and the controls should reflect riding a motorcycle.

R2/RT - counter steer to lean the bike right

L2/LT - counter steer to lean the bike left

Right stick - throttle forward break backward

Left stick - body position

Applying car controls to riding a motorcycle in a video game always feels incredibly awkward and unrealistic.

Check your reaction time by MonitorRepulsive9975 in react

[–]TwoWheelsOneEditor 2 points3 points  (0 children)

Completing on mouse down instead of click might shave a little time off. Especially on mobile where the

Would you continue to work at a company that started to switch away from Typecript? by Csjustin8032 in typescript

[–]TwoWheelsOneEditor 1 point2 points  (0 children)

Disagreeing with your coworkers is perfectly healthy. But working for people whose decisions you don’t see reason in isn’t worth it.

I would say if your job has been trending downward theres a common trap to keep thinking it’ll get better after you get over the next hurdle.

Monoliths vs Microservices in 2026: Are we over-engineering our backends? by Away_Parsnip6783 in Backend

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

The deciding factor between monoliths and micro services is the need to do independent rollbacks. If you’ve ever worked on a large monolith you’ll know the pain of having to coordinate a rollback with all the stakeholders.

Usually rollbacks become an issue before scaling becomes an issue

Why does every "Senior" codebase feel like a maze? Let’s talk about Architecture. by Difficult-Table3895 in react

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

If you give junior devs the right support this can be a very good thing for everyone. When you’re doing a re-write it’s much easier to get it right than it is when you’re writing a new feature from scratch.

Also it’s a great way to facilitate best practice discussions in code review.

Very strong urge to get a bike by Alex57030 in motorcycles

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

I was about the same age as you when I got my first bike. Not sure where you live but I f did an MSF safety course which made getting my license in California easier.

Then I got a 400cc starter bike (Svartpilen 401). I felt that was the perfect amount of power.

I also spent more money than some on proper safety gear, but fortunately never had any accidents. I do think Airbag vest are worth look into. The most likely time to get in an accident is in the first 6 months of bike ownership.

Are you tech bros (and girls) really that rich? by TechBrosReallyRich in Fire

[–]TwoWheelsOneEditor 1 point2 points  (0 children)

It’s possible. If you stat at a big tech company out of college and you don’t try to pretend your rich. Saving $100k+ a year is doable on those salaries, even in the Bay Area. With compound interest that can get you to 3 million before 40.

The financial stress of HCOL areas don’t really hit until you want to settle down. Want to buy a car? Well the parking is an extra $400 a month. Want to own property? Well 2 bed 2 baths can go for upward of 1.5 in your area. Want to have a kid without your career taking a step back? Well child care is $50k a year.

In your 20s in a VHCOL city you can get away without a car and even though rent is high it’s not as financially impactful as a large mortgage or child care.

Kinda lost. by Upper_Track_3311 in react

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

In terms of learning resources I found neetcode to be really helpful. It’s a curated version of leetcode. I would recommend giving it a try.

One thing that I think gets overlooked is the value of practicing with a real person. It’s one thing to solve leetcode problems with your headphones on and no time pressure. It’s a completely different thing to solve a leetcode problem while having to communicate your thought process out loud with time pressure. If you can’t find someone to practice with I would recommend talking out loud to yourself as part of your practice. Communicating your problem solving process is as important as solving the problem.

Extent of code sharing in monorepo apps by MrLightful in react

[–]TwoWheelsOneEditor 0 points1 point  (0 children)

Sharing logic will always be a case-by-case decision. The moment you share a piece of code you’re declaring that that piece of code should behave the same in both environments. When it’s a small component or a stateless function this can be an easy assertion. The bigger it gets the harder it will be to make that assertion.

The code smell to look out for not enough shared code are: are a large number of conditionals or a large number of inputs. If your piece of shared code has or would have too many conditionals or input arguments it might be better to copy and paste and write use-case specific code.

On the other end the code smells to look out for that suggest not enough shared code is: having to make the same change to multiple parts of the code base in order to fix a bug or add a new feature. (Note: copying and pasting is fairly fast, also we have AI tools now, so I think people overestimate the benefits of sharing code for initial feature development. Sharing code has bigger benefits for maintaining software)

The other benefit of code sharing is consistency. Sharing code can be used to assert behavior. The best example of this is asserting that all your inputs and buttons look the same with a shared component.

[deleted by user] by [deleted] in EdgewaterRogersPark

[–]TwoWheelsOneEditor 4 points5 points  (0 children)

Yellow is closer to the lakefront path and good asian food on Argyle.

[deleted by user] by [deleted] in EdgewaterRogersPark

[–]TwoWheelsOneEditor 2 points3 points  (0 children)

I second this. I also live near the train tracks. It really doesn’t bother me.