Live data from Hacker News

Show HN: Cot: a Rust web framework for lazy developers

mackow.ski

101–110 of 115 posts

Re: Show HN: Cot: a Rust web framework for lazy developers

#101
post #88

Earlier quoted context omitted.

Thanks a lot for this extensive feedback! About performance: I agree, and I'm not even trying to make performance a priority in Cot. I mean, of course, it's nice to have an actual compiled language, but I think a bigger perk in using Rust is having *a lot* of stuff checked in compile time, rather than in runtime. This is something I'm trying to make the main perk of, and it is reflected in multiple parts in Cot (temp…

You could potentially address both templating and front-end integration by adopting Dioxus which does full stack rendering with React-like components (but in Rust). A "batteries included" full-stack framework could be quite exciting I think. (Disclaimer: I work on dioxus's native renderer)

+1 (Disclaimer: I dont work on Dioxus's but i am admirer of Dioxus)

Re: Show HN: Cot: a Rust web framework for lazy developers

#102
post #24

Earlier quoted context omitted.

Writing raw SQL is perhaps indeed easier for simple queries, but put some foreign keys inside or slightly more complex relationships between tables and you'll probably quickly fall into the trap of having to remember your entire database schema to write anything. Yes, the example from the documentation is slightly more complicated, but it checks at compile time the exact column names and types, so you get feedback mu…

I never understood the hate against ORMs. It always seems like a superiority complex or some claim that SQL is “so simple”. Yeah SQL is extremely simple to write, that isn’t really the problem ORMs solve for me, but rather they solve composability and reuse of queries. I think there is a similar vein of people crying about sites not using 100% vanilla js without a framework. They are missing the point or don’t have e…

This is one of my biggest pet peeves against HN. It's also obvious ORMS won, every new framework creates them. People who keep speaking about not using them are crazy.

Re: Show HN: Cot: a Rust web framework for lazy developers

#103
post #81

Earlier quoted context omitted.

which totally say nothing and vague idea, because loco already easy enough and more higher than that would introduce "magic layer" that would really hard to customize (?)

The major difference between Rails-style frameworks do not support automatic migrations.

it uses seaorm and do just that

Re: Show HN: Cot: a Rust web framework for lazy developers

#104
post #92

Earlier quoted context omitted.

Why would you want to?

The fundamentals of software design. DRY If you have a complex predicate that defines a set of rows, and you use that set in many different queries, are you rewriting it each time?

So you don't actually have an answer for me?

Maybe I do, maybe I don't. It depends. Most likely I won't, unless it's used in like 80 % or more of queries and the problem domain guarantees that it will basically never change and if it does it will for sure, absolutely, change everywhere at once.

I like easily testable SQL queries that are easy to read, right there in the code. No need to execute anything to get to the SQL that would execute in the database. 'But then I need to write thousands of queries?!' Yes, you do, and you'll have a chill and easy time whenever they change, and they will if your software gets use and your data grows. Because you can just search/replace on the SQL text, and don't need to figure out every place some mutilated piece might get called from and probably get it wrong a few times or need to figure out how to split it into two or more fragments.

In some cases you can figure out a robust way to generate SQL but it's rare, it mostly comes up in one-off scenarios.

Re: Show HN: Cot: a Rust web framework for lazy developers

#105
post #35

Frameworks that do “everything” are not a good idea. I’m from the Java ecosystem. Spring is the “batteries included” framework there. If you have migrated any real world application to a new major version once, you’ve learned forever that “all in one” frameworks are bad. Please don’t do it! Instead, use scaffolding tools, that give you a head start on creating a new project, using smaller, specialized libs. Also, don…

I program Rust using the Axum framework and Sqlx.

Github copilot is so good at writing CRUD db queries that it feels as easy as an ORM, but without the baggage, complexity, and the n+1 performance issues.

Re: Show HN: Cot: a Rust web framework for lazy developers

#106

Anything that has Oauth2 integration with Github, Google, Facebook, etc. out of the box is going to win this by a country mile. That's by far the most annoying thing about setting up any website that has user accounts in my experience.

I understand people use these logins, but I'm not trusting a third-party login to gate access to anything I might miss. It's already annoying enough that there are virtually no access guarantees for a service , but to add a second point of failure is a risk I'm not going to take if I have any fear of losing access. For something like TikTok where I can download the recipe videos the risk is appropriately low, but tha…

> Plus, it offers very little convenience for users vs just using a password manager.

It definitely does - the sign-up process is much quicker with oath2.

Once you're signed up, sure.

Re: Show HN: Cot: a Rust web framework for lazy developers

#107
post #104

Earlier quoted context omitted.

The fundamentals of software design. DRY If you have a complex predicate that defines a set of rows, and you use that set in many different queries, are you rewriting it each time?

So you don't actually have an answer for me? Maybe I do, maybe I don't. It depends. Most likely I won't, unless it's used in like 80 % or more of queries and the problem domain guarantees that it will basically never change and if it does it will for sure, absolutely, change everywhere at once. I like easily testable SQL queries that are easy to read, right there in the code. No need to execute anything to get to the…

I completely agree. People often bring up edge cases like this, but they rarely occur in real-world scenarios. If you have such a complex predicate that’s used everywhere, you should probably be using a view anyway.

Re: Show HN: Cot: a Rust web framework for lazy developers

#108
post #72

Earlier quoted context omitted.

> Also, people like ORMs. Type safety is nice too without having to map manually. Sqlx is also great Don't you get type safety anyway with parameterised parameters?

on return values?

Good point. I suppose doing a runtime type-check is possible if using the ORM, too.
Post reply on HN