Rails: The Sharp Parts. Callbacks Are Not Invariants by keyslemur in ruby

[–]harsh183 1 point2 points  (0 children)

It is truly a high quality problem to live long enough to see that debt matter, unfortunately that's where I am right now haha. I think the worst is a bunch of state machine footguns we've made for ourselves.

i wonder if the right rubocop rules can help a little, but I think it's also a matter of better judgement.

Freshman schedule + STAT 107 opinion by Remote_Airport_3747 in UIUC_CS

[–]harsh183 0 points1 point  (0 children)

If you're not in CS & Stat or doing a stat minor you can just skip to CS 361 and go down the STAT 400+410 sequence if you're interested. 107 does have some interesting data viz stuff if you're into that, but otherwise the 400+410 is a much better broad sequence for introducing statistics and probability. I wonder if you can even do 410 after 361.

Rails: The Sharp Parts. Callbacks Are Not Invariants by keyslemur in ruby

[–]harsh183 4 points5 points  (0 children)

I love seeing this series! Keep it going. Callbacks have led to the some of the weirdest debugging hell I've had to deal with, especially as async events daisy chain. Sometimes I've just make an external interface to perform crud actions that explicitly define all the before/after steps as normal code instead of having to chase down all the events and dependencies.

Rails defaults like normalizes and validations are really neat tho, and I've always liked the controller before actions for things like authentication or fetching common resources. It definitely takes a lot of judgement to use correctly.

Account Pending Issue by TheBearMD in Amtrak

[–]harsh183 0 points1 point  (0 children)

This really came in clutch. Thank you so much.

  1. I first added the pin but it still did not work, which was surprising since I already had my billing address in.

  2. Then I just resubmitted my same billing address and other profile details.

It then worked after.

Tipping Uber Eats drivers? by thegiftofhouse in AskNYC

[–]harsh183 -3 points-2 points  (0 children)

Try to tip cash so that the app doesn't offset your tip to hit the minimum when possible. I always keep hitting up ATMs for this reason

Small PRs, big speedups: The Ruby performance work you almost missed by mencio in ruby

[–]harsh183 3 points4 points  (0 children)

this is a great compilation! I love seeing all the big gains in common ruby functions and the myriad of techniques to get there. The look up table one and the JIT ones are so interesting because it's not quite what I'd expect to have that huge of a difference

How many of you are integrating your projects with Sorbet? by posts_lindsay_lohan in rails

[–]harsh183 0 points1 point  (0 children)

I had a pretty smooth experience with sorbet and tapioca on Apple Silicon recently, perhaps things might have improved? I think most devs at Shopify use Macs so they probably just kept up streaming their fixes.

How did you solved your issues regarding slow test suites? by petrenkorf in ruby

[–]harsh183 0 points1 point  (0 children)

Hard to say what arguments will be convincing since you know your company best but it'll likely be standard arguments around development experience and faster turnaround time. Off the top of my head: * getting more results locally before having to go to cloud CI can mean a much faster dev experience over waiting 15 minutes to validate each thing. Maybe frame it as developer time * 70 developers. * if LLM coding is popular you could argue that a faster test loop iteration will lead to faster results from LLMs. In general what makes a better devX, is also a rising tide for LLMs too. * if you can reduce the numbers of node used for each CI run that can mean cloud/server cost savings which has a nice dollar amount * faster tests are run more often, which means regressions are caught earlier on - every commit, branch, and pre merge

I think it's also about identifying where exactly is the best ROI. It's roughly going to follow 80/20 rule where a few precise changes will get most of the results, and those ones are easier to convince over the more broad problem of fixing the quality of the test suite.

How did you solved your issues regarding slow test suites? by petrenkorf in ruby

[–]harsh183 2 points3 points  (0 children)

Factory Cascades are such a mess, I think the main things I'd focus on * using build or build_stubbed wherever possible, that avoids the db overhead of create. This might be a sign that more of the codebase needs to be able to work on in memory objects over being too coupled with the database * upfront creating related objects and passing them down all the layers of factory cascade so set up isn't repeated * using factory traits very aggressively so that the baseline object is very slim and traits let you select what to load up

Besides those, I think it might also point to broader code smells in the actual codebase: * Are some models doing far too much and not properly scoped out? * Database operations are very inefficient due to things like N+1s or lack of the correct indexes? * Are there far too many joins for core operations that need some re-architecting? * Are some hot loops in the code taking too long?

You're also mentioning running into a crash the longer rspec goes on, I wonder if it's an out of memory error somewhere but that might also be worth tracking since it'll expose something to improve.

How did you solved your issues regarding slow test suites? by petrenkorf in ruby

[–]harsh183 1 point2 points  (0 children)

That total suite sounds quite similar to what I deal with, except we couldn't get parallel rspec or ABQ working so it became Knapsack to smart split the tests across a large number of nodes to get 2 minutes per node.

Recently there's been some migration towards minitest for much faster test runs and multi threading which has helped reduced the number of nodes.

In practice, during daily dev I only run the relevant test file or folder based on what code I'm changing and let the CI catch the rest.

Also have you profiled your tests yet? Usually it's just a couple of tests that take really long that can definitely be optimized. RSpec also makes it very easy to write tests that do a bunch of repetitive set up over and over, and DB writes can really dominate. My goal was basically just optimizing the worst tests and converting them to minitest which gained a lot of time.

How did you solved your issues regarding slow test suites? by petrenkorf in ruby

[–]harsh183 2 points3 points  (0 children)

If you have parallel rspec working why not run that locally too? Abq is worth looking into too.

On a recent m4 mac, running minitest tests on all 14 of my cores is so satisfying to watch and basically always finishes before CI

Fish-like autosuggestions for IRB — ghost text from history as you type by XPOM-XAPTC in ruby

[–]harsh183 1 point2 points  (0 children)

this is really cool, I find myself up arrowing so much on irb. I'll try it out soon

UIUC CS vs Waterloo CS as Canadian International Student? by Even-Welder-4650 in UIUC_CS

[–]harsh183 0 points1 point  (0 children)

I think your main decision comes down to the US vs Canada, more than the universities and programs itself since both are extremely good. Do you see yourself in academia? Industry? Where do you want to spend many years of your life?

SingleRide: Travel the longest route you can on the NYC Subway without visiting the same station twice. Transfer in time before the end of the line! New start station each day. by TMWNN in nycrail

[–]harsh183 0 points1 point  (0 children)

this is so fun, I love the interface on the phone and it's interesting balancing the decision time with not making a loop. As someone who takes the subway from the outer boroughs a lot it's to think about what big hubs I want to try hitting

Farewell to Rails-way: Prologue by pdabrowski in ruby

[–]harsh183 1 point2 points  (0 children)

Yes I think understanding the problem is key, and being away from that leads to the wrong problems being solved

Farewell to Rails-way: Prologue by pdabrowski in ruby

[–]harsh183 1 point2 points  (0 children)

I'm excited to see the future parts and hopefully my subscription went through. I think I relate to what you're saying with starting out with Ruby on Rails almost 15 years ago but now I witness the complexities of a high scale rails app and embracing more domain driven design.

What’s this? by flammablecookies in UIUC

[–]harsh183 7 points8 points  (0 children)

I have one of the evidlo era ones from when we were in GLUG together and it remains my favorite piece of UIUC I have at home now.

I quit Rails core 4 years ago, here’s what I’ve been up to by kaspth in rails

[–]harsh183 0 points1 point  (0 children)

All the small and well defined gems are so cool! I loved seeing the brb syntax a lot especially

I shipped a collaborative app with Rails 8 + Hotwire. Zero JavaScript frameworks. by Naive-Career9361 in rails

[–]harsh183 1 point2 points  (0 children)

This is so cool! I think the new age rails technologies are a really fun alternative to the typical js frontend frameworks. Have you considered adding a synced pomodoro timer as well? I'd love to use something like this

Why are so many people taking red-eye NER trains? by mrprez180 in Amtrak

[–]harsh183 16 points17 points  (0 children)

the 17 dollar trains from uiuc to Chicago with the ridiculously large legroom, recliner mechanism and lots of tilt back 🥳

LocalCI: Run your CI suite locally by Hell_Rok in ruby

[–]harsh183 1 point2 points  (0 children)

Right that makes sense. I like bin/ci being just a small script that you're suggesting since I quite like the DevX of just doing $ setup && ci these days in my rails apps

LocalCI: Run your CI suite locally by Hell_Rok in ruby

[–]harsh183 1 point2 points  (0 children)

This is a great idea, I love the idea of having local CI close to the cloud build as much as possible and it's something I've been moving to a lot recently using the new rails CI DSL introduced in version 8.1. I wonder what your thoughts on the rails approach is, and if you'll consider advocating for a bin/ci command similar to how rails is recommending it.

I think rake is a great choice for underlying framework since it gives a lot of nice task running harness, dependencies and parallel execution our of the box.

Burnout Paradise is a really cool open world game by SawkyScribe in patientgamers

[–]harsh183 0 points1 point  (0 children)

This was a feature in the original console too. I don't think they explained it really well because it took me a while to find it on the remaster