Readit News logoReadit News
oleksandr_dem commented on Ask HN: DHH on Lex, a multi-hour ode to Ruby on Rails, but is it any good?    · Posted by u/oleksandr_dem
aeonflux · a month ago
Types are helpful in large codebases, but in Web Apps they tend to get into the way more than they help. You can still use semi-typed constructs in Ruby, but you have the freedom to choose where you need them.

After moving to writing web in Go (from Ruby) I am still baffled how much more boiler plate there is and how much slower things move because of this. Types are great when you want to refactor some things, but thats just part of the job.

In Ruby I loved how can you just quickly jump into REPL or just do inline breakpoint to inspect state: `scope.map(&:names).last.tally.sort_by(&:last).reverse.first(10)`

Something like this is such a chore in Go that I simply skip it more often than not.

> it uses a lot of special characters, which makes writing the code slower

I don't get this part. What special characters?

oleksandr_dem · a month ago
Unfortunately I don't have much experience with Go, I did try it for the sake of trying it, and I see your point, it is a bit more complicated to write code compared to JS/TS (two languages I know very well) or even Java (disclaimer: I think Java sucks).

> I don't get this part. What special characters?

For example let's look at this code:

```

class ProductsController < ApplicationController before_action :set_product, only: %i[ show edit update destroy ]

  def index
    @products = Product.all
  end
...

```

You can see a bunch of special characters: < : , % [] @

For example, if I wanted to write the same code in Typescript, based on my setup I might just need do something like this:

```

instance.get("/products", () => ProductsRepository.find());

```

Where instance is my router instance (fastify, express, whatever) and ProductsRepository is a TypeORM repository. My before_action might just be a middleware I pass to the callbacks chain or register as global middleware

oleksandr_dem commented on Ask HN: DHH on Lex, a multi-hour ode to Ruby on Rails, but is it any good?    · Posted by u/oleksandr_dem
codingdave · a month ago
I can't find it anymore, but I remember way back when Rails first launched, DHH saying something along the lines of: "I don't know databases, so I found one way that worked and ran with it as an ORM." I'm sure the dude has learned more since then, so Rails has improved, but if you are asking if you should listen to DHH, you need to know that he is a pragmatist, not an idealist. That is not a bad thing... but if you are an idealist, it would explain why his work does not appeal to you.
oleksandr_dem · a month ago
I'm not doubting DHH skills as web developer, actually, the reason I've dedicated my time listening to the podcast and writing this post is because I kind-of see his point. However, during my 10 years career (which is nothing compared to DHH, and I'm not saying that I'm right and he is wrong) I've learned what works and what doesn't (at least for me). And looking at Ruby on Rails my feeling is that it shouldn't work, but as stated in the post description, I've heard different people saying that Ruby is great- And so I'm wondering if they are just a small niche group or if it is as good as people say it is.

> "I don't know databases, so I found one way that worked and ran with it as an ORM"

This doesn't really play in favor of Ruby on Rails, the same applies to Typescript and Java (and I'm quite sure to any language that is popular with web developers).

oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
giancarlostoro · a month ago
I get what he meant, but tools like Navicat as far as I know were unknown DB client tools, someone had to trust that it wouldnt mess up their PROD db somehow.

Then again, never use a new DB tool on a PROD DB, always test in lower environments.

oleksandr_dem · a month ago
Sure, if the product fits the market needs, some people will start using (and I can see there was an increase in CLI installations yesterday from NPM).

So hypothetically yes, you can build trust overtime (Navicat has over 20 years of development), for every N users who don't trust it now, there is 1 yolo guy who just said "Yeah, this might help me do my job".

I should've presented this post in a different way. A lot of people that came here expected production ready tool, while the reality is that I did this in my free time to help me do my job, I wrote landing page in 10 minutes, and I published this post to get some feedback to see if it is something that may be interesting.

And based on what I read, I think there is interest for this tool.

oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
googoloid · a month ago
I think for me, either would work but in different contexts: - as an npm package for convenience for a node project, so i can just add an npm script to launch it on a local db - for more general personal use, a flatpak-distributed app would be preferred (installing npm packages globally is a hassle)

I would want the source to be open for either case though (like others have mentioned too).

oleksandr_dem · a month ago
Before I posted this, opensourcing this tool was something I would do in the far future. However, based on all the different threads, it is clear that in order to gain some trust I have to go opensource sooner rather than later.
oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
quesera · a month ago
Check out asciinema for easy creation of CLI demos.

https://asciinema.org/

oleksandr_dem · a month ago
I don't have much to showcase in the CLI department (in case of DataRamen CLI is just to start the local server), but the tool looks great.
oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
oleksandr_dem · a month ago
Sure thing, I have to polish it a bit before getting any more exposure, once it is in a presentable state I will push it on Super Launch as well.
oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
googoloid · a month ago
Ok so it does work as I understood originally.

If the CLI allows your domain to connect to it and do arbitrary DB queries, it's definitely not something I could trust. Even if I knew you to be perfectly respectable, your hosting could get hacked and then there would be a pipeline for an attacker to my DB.

It's a reasonable way to do some things, but I definitely feel this cannot be called local-first, since it explicitly allows and expects external domains to connect to it.

The bundle size is no issue whatsoever for a cli tool for devs, it's only really a problem when serving via the internet.

oleksandr_dem · a month ago
Makes sense. Following all the feedback in this post I will have to make a lot of changes, I will also think on this one. But you are probably right, incorporating the app as part of the CLI might make sense.

I have a question: assume I moved the webapp into the CLI (so now everything is localhost), would you prefer using a CLI + webapp or an actual app you have to install (no more CLI, you open the app and do your stuff)?

oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
googoloid · a month ago
Your instructions say to go to https://app.dataramen.xyz/, which definitely isn't the locally hosted server. You might want to change that (and disclose if the local server makes data available to websites outside localhost, which the current instructions seem to imply)
oleksandr_dem · a month ago
Yeah, the entire presentation is a mess, I should've worked more on this side.

I see your concern about running it locally and then visiting a remotely hosted webapp. The way it works is that app.dataramen.xyz will call a localhost server (running on your machine, there is no remote code executed) to connect to the database. So all the data stay on your local machine, plus some webapp stuff stored in browser localstorage.

I went for this setup for essentially 2 reasons:

- I didn't want to ship webapp as part of the CLI tool due to the webapp size (it uses React, so the bundle is 800kb or so, while the entire local server code is 45kb).

- In the long term I want the users being able to connect to multiple servers from one webapp. For example you may have a local server running to interact with your local DB, but at the same time you might have configured a remote self hosted server within your company VPN.

It is a weird setup, but you end up doing weird things when you run an app on $0.00 budget

oleksandr_dem commented on Show HN: DataRamen, a Fast SQL Explorer with Automatic Joins and Data Navigation   dataramen.xyz/... · Posted by u/oleksandr_dem
giancarlostoro · a month ago
Companies have to start somewhere though, lots of software exists that never was open source. I think he needs to get his tool in the hands of people who review dev tools.
oleksandr_dem · a month ago
> Companies have to start somewhere though, lots of software exists that never was open source

I think koolba's point was not as much about the tool being open-source as it is for a tool that runs on your machine and accesses your database with write permission, not having any guarantees it does the job it promises.

I could not agree more with him. This tool was born as a side project for my personal need, so I obviously use it without hesitation. But obviously, there is nothing to ensure you the tool won't drop your DB out of nowhere, or dumps your data somewhere else.

I think going open source will allow me to build some credibility for now.

PS. I use this tool daily, but I have to admit, in prod env I have read only user.

u/oleksandr_dem

KarmaCake day25September 2, 2024
About
A full-stack web developer based in Milan. My core stack is TypeScript, React, Next.js, and Node.js, but I’m also very comfortable with Java (Spring) and SQL - especially PostgreSQL and MySQL. Over the years, I’ve helped ship cloud-native products used by millions of people across the AI, fintech, and marketing sectors.
View Original