Readit News logoReadit News
thomaslangston commented on Reasons Not to Refactor   thoughtbot.com/blog/reaso... · Posted by u/chmaynard
lelanthran · a year ago
Simple and brief rules are more successful in practice than long and complicated rules.

I feel a briefer and more-to-the-point "When To Refactor" guide is to ask the following questions in the following order and only proceed when you can answer YES to every single question.

1. Do we have test coverage of the use-cases that are affected?

2. Are any non-trivial logic and business changes on the horizon for the code in question?

3. Has the code in question been undergoing multiple modifications in the last two/three/four weeks/months/years?

Honestly, if you answer NO to any of the questions above, you're in for a world of hurt and expense if you then proceed to refactor.

That last one might seem a bit of a reach, but the reality is that if there is some code in production that has been working unchanged for the last two years, you're wasting your time refactoring it.

More importantly, no changes over the last few years means that absolutely no one in the company has in-depth and current knowledge of how that code works, so a refactor is pointless because no one knows what the specific problems actually are.

thomaslangston · a year ago
I'd say #2 and #3 need to be modified.

#2 Are there related changes on the horizon for the code being refactored?

I think more qualifications than that probably miss times you should refactor.

#3 Has the code been changing recently OR have changes been delayed because modifying the unrefactored code is considered too difficult.

I've seen too many times where unrefactored code is considered too dangerous/difficult to modify even with total test coverage. Refactoring is a necessary step towards self documenting code in those cases.

thomaslangston commented on String of recent killings linked to Bay Area 'Zizians'   sfgate.com/bayarea/articl... · Posted by u/davikr
ddtaylor · a year ago
What is LW?
thomaslangston · a year ago
Less Wrong
thomaslangston commented on The history of spaghetti squash in America   atlasobscura.com/articles... · Posted by u/pepys
thomaslangston · 2 years ago
Recommendation for eating spaghetti squash in the spaghetti style, use half actual spaghetti pasta. You get the taste of pasta you're craving in each bite but with half the benefits of substituting of a full plate of spaghetti squash.
thomaslangston commented on Goodreads has no incentive to be good   countercraft.substack.com... · Posted by u/lawgimenez
manojlds · 2 years ago
Genuine question, why does it matter which version?
thomaslangston · 2 years ago
Not OP, but

Different Translations

Corrections or Updates

Additions

Different Illustrations

thomaslangston commented on A Senior Engineer’s Guide to FAANG Interviews   interviewing.io/guides/hi... · Posted by u/leeny
claudiulodro · 3 years ago
Tangentially related, is it worth it to do the leetcode grind and all the FAANG-interview preparations if I'm always planning on working remote? Are there remote companies with FAANG-level compensation that would warrant this sort of interview prep?
thomaslangston · 3 years ago
Yes
thomaslangston commented on Framework Laptop 13 Review   theguardian.com/technolog... · Posted by u/sandebert
theshrike79 · 3 years ago
Still no Scandinavian layout and they don't sell it here either...
thomaslangston · 3 years ago
Would a blank ISO keyboard work?

My Google skills are failing me and I can't seem to get a clear answer if the Scandinavian layout fits on ISO keys.

thomaslangston commented on For the first time, renewable energy generation beat out coal in the US   popsci.com/environment/re... · Posted by u/doener
simion314 · 3 years ago
I will install solar(not in US) but AFAIK batteries are not yet cost effective, Am I wrong and someone invented some cheap batteries? I expect that a company could be more efficient building giant batteries(chemical, gravity, etc) then a household buying something and maintaining it.
thomaslangston · 3 years ago
Batteries are not cheap, but they are cost effective based on local conditions.

Time of use billing. The battery is generating ROI if it can arbitrage energy over the day.

Net metering + solar. If net metering is not available, or sufficiently discounted, and your energy usage is not high enough during the day to use all your solar power, then batteries generate ROI.

Grid stability. A battery effectively is insurance against outages of a few hours. With sufficient solar and rationing, that may extend to week long outages (think natural disasters).

thomaslangston commented on NPR cancels 4 podcasts amid major layoffs   npr.org/2023/03/23/116555... · Posted by u/axiomdata316
hanklazard · 3 years ago
I listen to a ton of tech, current events/news and finance podcasts. Their radio programming seemed to weaken over the last few years so I lost touch. Are there any NPR podcasts worth listening to ?(asking honestly, looking for recs)
thomaslangston · 3 years ago
Short Wave is a short week day science NPR podcast I enjoy.
thomaslangston commented on Building a city optimized for bikes is a choice   distilled.earth/p/how-the... · Posted by u/wienke
afarrell · 3 years ago
Also, it doesn’t get very cold or hot there, in comparison to Chicago or Atlanta.
thomaslangston · 3 years ago
Cold doesn't have to be an obstacle. Here's a video on Finland's bike infrastructure.

https://youtu.be/Uhx-26GfCBU

thomaslangston commented on Twilight of the Libraries: What Gets Lost When Books Go Off-Site and Online (2022)   thewalrus.ca/library-digi... · Posted by u/laurex
kmeisthax · 3 years ago
Keep in mind there's one other problem with digitization: a lack of ownership. The law does not recognize any concept of digital sale: all digital copies are licensed property of the publisher[0], and it is not possible to legally sell them. This gives publishers the ability to retroactively wipe libraries' catalogs on the basis that they own them.

Yes, this isn't a problem with public domain works; but those have bigger preservation problems. DRM is a self-inflicted wound.

[0] I resisted the urge to write "author" here as American copyright is assignable. It shouldn't be, because this assignability is usually demanded up-front by publishers.

thomaslangston · 3 years ago
> This gives publishers the ability to retroactively wipe libraries' catalogs on the basis that they own them.

This doesn't have to be true. We could have licenses that are perpetual.

u/thomaslangston

KarmaCake day591June 11, 2011
About
www.langstonsoftware.com

All opinions are my own. My opinions do not represent my employers past, present, or future.

View Original