HackerTrans
TopNewTrendsCommentsPastAskShowJobs

davetron5000

no profile record

comments

davetron5000
·10 miesięcy temu·discuss
There’s also a typography element to formatting source code. The notion that all code formatting is mere personal preference isn’t true. Formatting code a certain way can help to communicate meaning and structure. This is lost when the minimal tokens are serialized and re-constituted using an automated tool.

https://naildrivin5.com/blog/2013/05/17/source-code-typograp...
davetron5000
·w zeszłym roku·discuss
Thanks for the kind words!
davetron5000
·w zeszłym roku·discuss
(author here) It only uses Sinatra because I happened to know it and needed to bootstrap the low-level stuff. I don't know if it needs to be based on Sinatra in the long term - it should probably just use Rack.
davetron5000
·w zeszłym roku·discuss
I'm OK not using a compiler. Used one for years and am good on that for now. I like writing Ruby.
davetron5000
·w zeszłym roku·discuss
I like Ruby! Ruby has types. They just aren't enforced by a compiler.
davetron5000
·w zeszłym roku·discuss
Yeah, that makes sense. Where I end up wanting mocks is when this happens:

1 - build first version of feature, all core logic in a class I can test conventionally 2 - logic gets complex, test gets complex 3 - Eventually, I need to create some layering, where the class from step 1 now delegates to other classes. The initial test is more like an integration test and gets harder to keep up

At this point, there is a camp that says I should be using dependency injection and inject null objects for the dependencies. I get that idea. I am in the other camp that does not want to make custom objects just to satisfy a test. A mocking system can do that for me. So that's what I would do - mock the dependencies. The "real" versions would be tested conventionally.

I definitely do NOT just start with mocking imaginary internals though - I guess that's a whole other camp :)
davetron5000
·w zeszłym roku·discuss
I didn't come up with the license. You can read about it here: https://firstdonoharm.dev/

I didn't want the code to be All Rights Reserved, so I chose the best license I could find that communicates my desires - I assume that's what most people do when choosing a license?

I'm OK if a "semi serious business" don't want to use my software.
davetron5000
·w zeszłym roku·discuss
The biggest thing is the mocking system. MiniTest's feels so difficult to use.

I also like creating custom matchers vs. creating my own assert_* methods.

I would agree that many features of RSpec are, honestly, bad: shared examples, shared contexts, etc. Excessive use of let! and let, plus the predicate matchers are all just really confusing to me.

I actually thought about patching the RSpec gem to remove the features I didn't like :) Might still consider it heh
davetron5000
·w zeszłym roku·discuss
I thought hard about this decision. Every time I use MiniTest, I end up wanting a bit more that RSpec has and then switching to it. I also have been surprised over the years that the `expect(x).to eq(y)` seems to be relatively intuitive to people, despite the fact that it doesn't seem like it ought to be.
davetron5000
·w zeszłym roku·discuss
Author here. The framework does require setting stuff up. RSpec is not one of those things. It's the testing library you will use if you use this framework. I didn't create a lot of flexibility in the framework. For example, if you don't like RSpec, you will not like this framework :)

You may want to examine the docs more closely. There are plenty of conventions and very few that can be circumvented.

But day one of a new framework is not going to compete with Rails. Sorry!
davetron5000
·w zeszłym roku·discuss
Author here - the example doesn't allow logins now to avoid abuse. I wasn't 100% sure I'd make it public and just decided today to do it, so it's not yet ready for just anyone to login.

You can run the site locally, or view pages on the site by going to https://brutrb.com/adrs.html and clicking those links.
davetron5000
·w zeszłym roku·discuss
This is my favorite game for the 2600.

I built a clone of it for Windows using Direct X in probably 1999/2000. I don't have a Windows machine, but I think Microsoft's obsession with backward compatibility means it probably still works:

https://naildrivin5.com/adventure/index.html

Here's the C++ code in all its glory: https://github.com/davetron5000/adventureclone/

It replicates the 2600 game, and adds two new levels (additional castle and maze), and two new (optional) objects, a candle that shows more of the labyrinths, and a shield that prevents the dragons from eating you.
davetron5000
·w zeszłym roku·discuss
Where you live matters. In the US there is a significant tax burden on exercising. Talk to an accountant. Also look into QSBS which can shield your tax burden if the company was small enough when you were granted stocks. Highly recommend you get informed before talking to a professional. Not all accountants understand this stuff.
davetron5000
·2 lata temu·discuss
It wants to act on GitHub on my behalf. Not clear why I should allow it to do that, especially when the only info about this app that is presented is that it will store my data on GCP.

Can you modify your oauth request to only ask for what permissions you need and/or itemize out what the app is going to do on my behalf?
davetron5000
·2 lata temu·discuss
I built a toy app using this, with a front-end only app and postgrest + RBS. The app was seriously two forms behind a login. It was a huge pain.

RBS is "insecure by default" meaning if you don't set it up right, all users can access all data. And, because it's SQL, it's really easy to write a valid and successful configuration that doesn't work. You have to test it. And for views, you have to do some real heroics to get them to respect RBS.

PostGREST is very very basic and far less powerful than just writing SQL. I found it pretty frustrating to use, knowing that SQL would be far simpler.

Yes, I know that I could make a direct SQL connection to the database, but at that point, it would've been easier to put a Rails app on Heroku and use their offering, which is far more mature.

The Supabase dev environment was pretty slick and worked well, though I had to docker implode a couple times.

I wish them luck, but I could not figure out what the use case was for their product, given that Heroku has an awesome managed Postgres and RDS is there if you have more knowledge and want more controls. I don't see how you could make a complex app that is front-end only with Supabase as your entire back-end.
davetron5000
·2 lata temu·discuss
I built one recently. Much simpler and more opinionated, but can generate a Tailwind configuration: https://ghola.dev (desktop/ipad is best)

Long read on how it was built with web components: https://www.naildrivin5.com/blog/2024/01/24/web-components-i...