Live data from Hacker News

Ruby on Rails in a week

simplethread.com

21–30 of 176 posts

Re: Ruby on Rails in a week

#21

Years ago I put together a Rails app to store iPhone/iPad apps for curation. There was a backend that connected to the iTunes API and then I parsed the data elements I needed and entered them into the DB. The most infuriating thing was realizing that I needed to update the model with a new data element, or that some API responses didn't include the needed data. There was all this controller and model code and then th…

Kinda, but there's a subsequent phase of maturity where you realise that you are knee-deep in technical debt as a result of spurning the framework and infrastructure and find yourself reinventing relational behaviours such as joins and foreign keys, but badly and expensively and in application memory, because your attributes are a freeform uncontrolled grab-bag of poorly typed whatever, and you'll wish you'd just had the discipline to trust that the framework folks really did know their stuff after all.

Re: Ruby on Rails in a week

#22
post #2

Having picked up Rails 9 years ago and having been using it literally daily ever since, it's joyful to read from someone that is just starting. I also started with https://www.railstutorial.org/book , highly recommend it. I also loved Metaprogramming Ruby (Paolo Perrotta) - it's more advanced and starts to open your mind to how Rails magic DSL's were built. I just bought today "Rebuilding Rails" ( https://rebuilding-…

Love the Rebuilding Rails concept! I'm doing a very similar thing in Ruby, focused more on "web application development from first principles" (https://theodorekimble.ck.page/e0bb43b156). I know I better absorb concepts if I can trace them back to a more fundamental "truth".

Curious to hear if anyone else has found success with Rebuilding Rails, and what they found most helpful.

Re: Ruby on Rails in a week

#23
post #14

Rails is in a really good place. When I learned it back in 2015 there were so many resources for learning, it felt like every time I had a specific problem related to a feature I was implementing there was either a railscasts or gorails video on it, along with 10 blog posts and stack overflow results. I can only imagine how much better it is now. It has been one of the only semi-modern learning experiences where I wa…

This 10,000 times. And it’s not just Rails, the quality of the Rails documentation made an impact on the Ruby community that was generally replicated. Compare that to the JavaScript world where cornerstone, insanely popular libraries will have documentation that covers roughly 10% of a library’s API surface area and maybe one simple example that doesn’t cover production use cases. And dozens of out of date Medium blogs.

I don’t understand how people operate like this day-to-day either guessing at APIs or having to dig through large, complex open source codebases just to figure out basic library functionality.

Maybe it’s my conception of how things should work that’s off, because I’ve met developers who actually enjoyed guessing at library APIs and said they don’t like reading documentation. I hoped they were the reckless fringe minority. Maybe they are actually the majority?

I worked so much faster in Rails. The community made that possible by writing well about how their libraries were meant to be used. And if anyone’s response is “well you should read your open source dependencies’s code anyway,” many times I did have to jump into the code of Ruby libraries and it was a lot easier to read the codebase when the library APIs were well documented, providing a context for understanding. I miss Ruby and Rails.

Re: Ruby on Rails in a week

#24

Years ago I put together a Rails app to store iPhone/iPad apps for curation. There was a backend that connected to the iTunes API and then I parsed the data elements I needed and entered them into the DB. The most infuriating thing was realizing that I needed to update the model with a new data element, or that some API responses didn't include the needed data. There was all this controller and model code and then th…

NoSQL's initial purpose was scale/speed. But yes, the flexibility it provides for things like trivially adding fields is another factor that leads to NoSQL adoption.

Re: Ruby on Rails in a week

#26

Years ago I put together a Rails app to store iPhone/iPad apps for curation. There was a backend that connected to the iTunes API and then I parsed the data elements I needed and entered them into the DB. The most infuriating thing was realizing that I needed to update the model with a new data element, or that some API responses didn't include the needed data. There was all this controller and model code and then th…

You're just describing any software problem where things aren't static or you haven't yet mapped the domain. Storing the whole response in the database so that you aren't losing data is a good solution while you make your logic robust against the domain of values.

You run into this talking to an undocumented API for example. But notice that to "query it later", you still have to write/polish the rest of your logic to handle the actual data which is how you end up with a system that doesn't need to store every API response to disk. This isn't a web thing, it's any time you don't have a 100% handle on the interface between two systems.

Nothing to do with Rails, though. You were trying to create harder to change solutions based on a premature understanding of the values you were working with which caused churn in solutions (like DB columns) that are annoying to change frequently.

But in that situation, you as an engineer have to be able to step back and go "okay, what can I do to handle this at a more dynamic layer until I understand what I'm working with?"

Re: Ruby on Rails in a week

#27

Years ago I put together a Rails app to store iPhone/iPad apps for curation. There was a backend that connected to the iTunes API and then I parsed the data elements I needed and entered them into the DB. The most infuriating thing was realizing that I needed to update the model with a new data element, or that some API responses didn't include the needed data. There was all this controller and model code and then th…

No, the problem was more you were dancing to the tune of someone else's fiddle. It's always boring having to slice, dice and store someone else's JSON data from an API.

As others have noted, maybe you should have just stored that data in a JSON column, but it depends on the app. Making it relational can be useful if you're going to be running reports, etc. on it.

Re: Ruby on Rails in a week

#28

Years ago I put together a Rails app to store iPhone/iPad apps for curation. There was a backend that connected to the iTunes API and then I parsed the data elements I needed and entered them into the DB. The most infuriating thing was realizing that I needed to update the model with a new data element, or that some API responses didn't include the needed data. There was all this controller and model code and then th…

You could have cached the entire API response in a field for a given record (or their own table) from the beginning. Then you could reprocess it if you had to change the schema, assuming Apple didn't change the response on their end in the interim.

Schema changes are normal in web applications, yes.

Re: Ruby on Rails in a week

#29
post #25

Anyone doing/thinking about Rails in 2020 should give matestack a try :) reactive user interfaces in pure Ruby (and Vue.js under the hood!) https://github.com/matestack/matestack-ui-core

You can roll this yourself with Cells (https://github.com/trailblazer/cells) and Stimulus Reflex (https://docs.stimulusreflex.com/). I've been watching view_component too but the simplicity of cells keeps me happy.

I've been working full time using both and love the flexibility. My process is mostly using state machines on cells which take in a struct and output the html for that state with Stimulus Reflex.

Re: Ruby on Rails in a week

#30
> For example, take the idea of inheritance. Low level thinking might sound like, “All the other classes are adding > But high level thinking might be more like, “I need to access the ApplicationController class’ methods. Ruby supports inheritance, so I’ll add I don't think this is "high level" vs "low level" thinking. Both are just different approaches to discovering the same thing. It's akin to learning guitar through tabulature vs standard notation.
Post reply on HN