Live data from Hacker News

Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

news.ycombinator.com

51–60 of 79 posts

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#51
post #12

Earlier quoted context omitted.

I don't know why something with many LOC is a problem. Why does OP care about LOC?

More code, more liability. If you can get away with achieving the same with less code, things tend to be harder to turn into big messy piles of code.

Oh huh. I hadn't considered liability implications of using a framework. Thanks for the viewpoint.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#52
post #12

Earlier quoted context omitted.

I don't know why something with many LOC is a problem. Why does OP care about LOC?

More code, more liability. If you can get away with achieving the same with less code, things tend to be harder to turn into big messy piles of code.

This is a real inexperienced take about a codebase with a huge number of contributors and users, with a lot of test coverage, that has a history of addressing P0/P1 issues quickly.

Do you have the same concerns about your compilers? Your web servers? "More code, more liability" is a very sloganeering/cargo-cult take.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#53

I like Ruby but I don't like Rails. No idea if this is better now but I would get weird exceptions that would be from metaprogramming goofiness that was really difficult to debug and find documentation for, and it uniquely bothers me when I can't figure out where errors are coming from in code (same critique of async/nodejs). The general heaviness also just didn't mesh well with my programming style, I like things cl…

This sounds like my experience with Django... After 5 years I still haven't mastered it and it still continuous make me think why is this so complicated.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#54

Earlier quoted context omitted.

> What do you mean by "heavyweight"? Rails latest release (7.0.4) have 386,970 lines of code in total, 310,779 of it being Ruby code. 3000 files in total. Just the `lib` directory of `activerecord` has 33,036 lines of code, across 369 files. By most metrics, RoR is pretty heavyweight, as their literal taglines are "Ruby on Rails scales from HELLO WORLD to IPO" and "A web-app framework that includes everything needed…

> By most metrics, RoR is pretty heavyweight, as their literal taglines are "Ruby on Rails scales from HELLO WORLD to IPO" and "A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern", so it needs to be pretty big to support those use cases. Not sure what do you mean by "most metrics". Framework supporting features is not sam…

I’d call Postgres “heavyweight” compared to SQLite. Maintaining a SQLite db is as simple as a file, and then you can use litefs or litestream to back it up.

Maintaining a Postgres server or cluster is hard. But it offers way more functionality.

I agree that the term heavyweight can mean many things to people. I’ve take it as a generic mix of maintenance, complexity of project, ease of use for your purposes.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#55

Earlier quoted context omitted.

> What do you mean by "heavyweight"? Rails latest release (7.0.4) have 386,970 lines of code in total, 310,779 of it being Ruby code. 3000 files in total. Just the `lib` directory of `activerecord` has 33,036 lines of code, across 369 files. By most metrics, RoR is pretty heavyweight, as their literal taglines are "Ruby on Rails scales from HELLO WORLD to IPO" and "A web-app framework that includes everything needed…

> By most metrics, RoR is pretty heavyweight, as their literal taglines are "Ruby on Rails scales from HELLO WORLD to IPO" and "A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern", so it needs to be pretty big to support those use cases. Not sure what do you mean by "most metrics". Framework supporting features is not sam…

> PostgreSQL has more than 1.3M lines of code and it gets used by projects of all sizes, would you call it "heavyweight" too?

Yes. There’s not a definition of “lightweight” that could be applied to psql, at least without making the word useless.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#56
I am a solopreneur with Smart Kiosks running on Raspberry pi.

The whole service (which isn't too complex) is a file script in Ruby managed through SystemD. This script turns off/on the screen based on API calls, and is also in charge of scheduled/remote restarts, pinging the backend and stuff like that.

What I like the most is how easy and reliable is. Beeing a below average guy, ruby makes really easy to combine system calls, API calls and shell commands within the same context.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#57
post #11

Ruby is pretty good for writing scripts to run in the terminal. For things where I need to do a bunch of string manipulations, I prefer it over something like creating a shell script.

Same. I’ve moved a lot of my personal scripts from zsh/bash to Ruby, and they’re so much easier for me to reason about now — or six months in the future when I’ve forgotten what exactly they do.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#58
post #13

We have a lot of internal APIs written using Sinatra. I first started writing my APIs using Sinatra about 10 years ago. I had started with Rails when it first came out around 2005, liked it, but then ran up against a lot of issues. Sinatra and the Sequel gem were amazing so I switched to that, since I didn’t need most of what Rails had. Now I just use those two out of habit. Rails is a LOT better now, but i still jus…

I really like Sinatra but a lot of the Rails improvements kind of took away some of the benefits of using Sinatra over Rails.

I believe it. I keep reading about Rails improvements but haven’t really tried it in anger in a long time.

I started with Rails when migrations were just .sql files you wrote by hand. I switched to Sinatra mostly to use Sequel, because ActiveRecord at the time would do horrible queries unless you wrote them by hand. I know they have solved that issue, so I should try Rails again… but my Sequel muscle memory is pretty strong at this point.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#59

Earlier quoted context omitted.

More code, more liability. If you can get away with achieving the same with less code, things tend to be harder to turn into big messy piles of code.

This is a real inexperienced take about a codebase with a huge number of contributors and users, with a lot of test coverage, that has a history of addressing P0/P1 issues quickly. Do you have the same concerns about your compilers? Your web servers? "More code, more liability" is a very sloganeering/cargo-cult take.

It’s true, though. Code costs money. I looked into this years ago for a former employer and at the time it was broadly estimated that for each line of code that a company owns it costs at least $30 every time a developer has to look at a given LOC. This is true whether the dev is writing it, fixing a bug in it, or just looking at it to investigate something related. And that’s for every developer on the company. So if you have code that, for whatever reason, is constantly being looked at by developers, that cost rapidly jumps, even though no one is actually touching it.

I’m currently down with the Flu B, so don’t feel like looking up citations, and for that I apologize. My recollection is that this was, unsurprisingly, a fluid estimated, with lots of caveats attached to it. Regardless, it struck me as true, and something I’ve never failed to take into consideration when writing my own code.

Re: Ask HN: Who’s using Ruby for web development, without Ruby on Rails?

#60

Earlier quoted context omitted.

> By most metrics, RoR is pretty heavyweight, as their literal taglines are "Ruby on Rails scales from HELLO WORLD to IPO" and "A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern", so it needs to be pretty big to support those use cases. Not sure what do you mean by "most metrics". Framework supporting features is not sam…

yes is heavyweight, SQLite for example isn't , but is kind the point you want database to use multiple formats, have acid compliance, json support, parallelism, easy debuggability, scalability, fault tolerance. this are problems that you pay only little cost because 1 PostgreSQL database can scale to thousands or millions of users, and is more like a video editor you doesn't code directly in it, and data replication…

SQLite claims at least 180K LOC (~145K+25%, covering a substantial but incomplete part of the codebase), and the above report shows Rails at 386K LOC.

Suggesting that LOC does not support this argument, and perhaps is not a great metric in general, especially across different languages.

https://www.sqlite.org/amalgamation.html (as of Version 3.37.0 - 2021-11-27)

Post reply on HN