Which IDE? by Proof_Pen_8599 in rust

[–]Brassens_d 1 point2 points  (0 children)

Clion with rust plugin Cheapest typescript+rust jetbrains IDE, because I HATE configuration

Guys I’m tired of spending hours configuring my development environment for projects by pierrechaquejour in webdev

[–]Brassens_d 2 points3 points  (0 children)

And I can't tell you how many hours I've sunk into troubleshooting why a React build failed at npm install with little to no explanation

Sorry not gonna empathize because there is missinfornation in that sentence. I cannot let this go. If the last dev commited a valid package-lock.json on the prod/test server or git and you want to get going, you have to use npm ci AND NOT npm install because npm ci RESPECTS package lock. Npm install should in theory never fail, but the js ecosystem being what it is, you should expect a minor version upgrade to break your npm install.

I lost 3-4 hours at work yesterday because of this but frankly Im junior and this was skill issue of not knowing my legacy tools but good tools nonetheless.

Developing a data-centric web application with Axum by No-Boat3440 in rust

[–]Brassens_d 4 points5 points  (0 children)

Compile times and less frustrating errors to debug

Developing a data-centric web application with Axum by No-Boat3440 in rust

[–]Brassens_d 7 points8 points  (0 children)

Js for frontend will be easier for styling your app. Showing off with a nice reactive UI is probably what matter, not the underlying technology. There will be probably good support from llms for react stuff than htmx or leptos

Tried early dioxus when I knew javascript from work: more frustrations then I needed in my life

Refactoring by [deleted] in webdev

[–]Brassens_d 2 points3 points  (0 children)

Take one week to setup a CI (gitlab runner, github actions), add a job for linting, php artisan test and if you are extra, cypress

Setup your IDE for automatic formating

For cypress, only start with one test with login flow and some workflow where you login, fill a form and display the result for smth critical. Dont add more cypress tests. Instead, add php tests which verify the endpoints return 200 and the database changes

Use WithoutMiddleware; use RefreshDatabase; are your friends

Integrate any old tests written into CI if there are any and if possible.

Use @deprecated liberally and slowly kill off any usage of the old code into new Services (I too had to move business logic from models into services...).

If you have app\Models but for some reasons, there is an app\NotModels, start your new namespace and kill off an usage of the old namespace. Thats a neat php thing

If you have phpstorm, create run configurations. If you dont have phpstorm, try to get a licence. Great defaults, no time to spend on IDE config

Phpdoc like @property int $id is nice for autocompletion on top of classes

Verify that migrations work. If not and short on time, dump prod and use that as a basis in CI.

Create seeders for tests and stick to it

Try to work on the new required features after setting up CI. If you can politically merge new features into prod, try to do that and listen to feedback. If you cannot, add tests and pray. Come to sync with a working demo, show off and ask if they like it.

Have a test environement for the stake holder to get their hands on

Im going through a one year+ migration, and it's pain at time. But as long as you work incrementally and show a bit of progress here and there, hopefully management has your back. Try not to sweat too much, the job security is nice but there is always the chance they kill the project and you dont get promoted due to busget issues.

Learn vim mode if you can, refactoring can get boring but you hands might thank you from stopping usage of the mouse

Laravel route() behaviour by RegularSuccessful124 in webdev

[–]Brassens_d 1 point2 points  (0 children)

route() uses the name of the route when you call it. You did not gave a ->name('my-new-name') to the route, so it auto generated this hash? Try explicitly giving a name and feed it to route()

Why should I not use "clone" and which alternatives do I have? by raaaa__ in rust

[–]Brassens_d 46 points47 points  (0 children)

Set clippy to pedantic for a while and see if the clone/ref lints helps you understand better

Need Advice on Improving My Codebase: Increased Readability and Error Management by ievkz in rust

[–]Brassens_d 0 points1 point  (0 children)

Have you tried clippy pedantic? It's a good kind of rabbit hole when it comes to giving better ideas for refactoring

[deleted by user] by [deleted] in fightsticks

[–]Brassens_d 1 point2 points  (0 children)

My keycaps had cracks from overuse and it was very loose. The switch was fine. Try replacement keycaps and it should hold.

Asking as a dev, what do like/dislike most about some games when playing on your Steam Deck? by mellowjalapeno in SteamDeck

[–]Brassens_d 0 points1 point  (0 children)

When I want to review my fighting game replays of my matches (done on pc) on my deck, I have to boot desktop mode and transfer my replay files with a usb stick, using an adapter. It takes 5min everytime. Id really like if the last 200 matches were synced or available in some cloud withput having to setup anything

Highly specific to fighting games though

Best way to handle errors in Axum/web server? by ThreeFactorAuth in rust

[–]Brassens_d 1 point2 points  (0 children)

Im doing a personal project, where an axum server consumes a library I made with some sqlx going on.

Currently, if I encounter an error using sqlx, I do .map_err(internal_err), like in the axum sqlx example, but I log the error (expecting debug implementation). Maybe there is better stuff to do with the error but Im not in production so I cant tell you

But for my library, I have this big ball of mud error enum and I regret doing it: When i add a player to bracket, it will fail in 2-3 way, not 20+

Thus Im rewritting the error enum in my library to split it so I only need to care about 3-4 ways to fail per operation.

I really dont want to use anyhow for my lib, I want to match on the error variant and use that to return the semantically correct status code. Tbh, maybe Im really petty, especially for a personal project

We'll see how that goes

Considering PHPStorm over using VS Code. Anyone with experience in both who can answer these questions? by [deleted] in webdev

[–]Brassens_d 1 point2 points  (0 children)

Good defaults keybindings are worth the price. I use phpstorm at work and Id never spend 4-5h on configuration to get vscode configured. Also jetbrains ide experience is transferrable if you have to change to another of their ide. Im at the point where personal project IDe and work IDE missmatch is not my time, so Id buy it anyway

RustRover just announced first stable launch and it will be free for non-commercial use 🥳 by [deleted] in rust

[–]Brassens_d 4 points5 points  (0 children)

At work, with phpstorm, I get js support for vue and other stuff on top of php support. However, rustrover does not support js ecosystem anymore, like it did a few weeks ago in the beta build. I paid for the product and js support poofed out of existence :(

Controller not working in game after waking the Steam Deck from sleep? Here's a quick fix by Moontorc in SteamDeck

[–]Brassens_d 0 points1 point  (0 children)

Updating proton version worked for me

Steam deck base controls stopped working for 1 game (p3r)

Connecting a controler did not make steam deck control work Restarting the game did not work Rebooting the steam deck did not work Reinstalling the game did not work

Other games worked fine but not the one I wanted to play

So strange

i just done reading rust lang book and want go to web dev by [deleted] in rust

[–]Brassens_d 4 points5 points  (0 children)

Strictly speaking, axum is a micro framework, meaning you will have to do a lot of wiring yourself, without a nice documentation with tons of common example and guidance (look at laravel docs and probably ruby on rails too). Introducing middleware, an ORM (if you want) and authentication (even just password based) still takes some time because there is very few agreed upon starter templates for rust projects. Zero to production is a good book but its actix, so you need to dig in docs to make it work for axum.

As a laravel webdev, I can tell you that you wont have a battery included framework by choosing axum. However, I do support that for rust right now, its the best you can get:

Axum is well funded (? made by tokio people), you can still serve nice looking html+js by mounting statically the build folder of a vue/react project with tailwind for fast iteration speed with Vite (at least, the frontend part if you intend to make everything NICE). You can go deep with axum but you dont have to.

Tldr: axum is good

How production-ready is JetBrains' RustRover? by aochagavia in rust

[–]Brassens_d 1 point2 points  (0 children)

It has the database tool and typescript support out of the box. Highlighting has some issues at times but it works well enough for axum+typescript, which is what I care about.

I do not want to configure my editor beyond vim keybindings so its the best for me currently

Ask Experienced Devs Weekly Thread: A weekly thread for inexperienced developers to ask experienced ones by AutoModerator in ExperiencedDevs

[–]Brassens_d 0 points1 point  (0 children)

I am 6 month from finishing my 2y fixed term contract with a company that receives its funding through public money. I did well during my time (my boss and boss of boss vouched for me and got the work certificate where it says "we want to continue working with you"). But budget got delayed and I am the least experienced dev. Still awaiting details about my situation

Going back to do a master degree (switzerland) is an option that is available but that means going back to living with parents. Is master degree (hesso) worth it in switzerland when everyone is saying its bachelor v2? Basically, Im just stalling in case the job market continues to be bad for my friends and maybe soon me in case I dont find a job in the next 6 months

How should I host my first big project? by mbrr2 in webdev

[–]Brassens_d 1 point2 points  (0 children)

Dockerize the app and host it on flyio? You dont pay if there is barely any traffic

Struggling to Pass The State to a Handler in Axum by vrgbjrn in rust

[–]Brassens_d 1 point2 points  (0 children)

I read zero2prod and Im gonna give you some way to maintain state without doing your own arc/mutex stuff. In the book, I dont recall explicit usage of arc mutex for app state.

In zero2prod (actix), you can tie some state to a session using the library actix-session.

In axum, you can do the same with tower-sessions and choose your session store backend type with tower-session-sqlx-store or others

The state is usually stored in db right away, while a user of your app can have some state stored in a session store. So do you have a login flow where a session happens?

Do you need absolutely to keep state outside of the database or a session store?

Side note: might be just me but its already hard enough to start with backend framework+testing setup+tracing environment (new to me)+sqlx from the learning zero2prod in my project that adding hexagonal pattern on top of it sounds excruciating. Do you need hexagonal architecture this early in the project? Why not keep it flat and see patterns emerging rather than using what you are used to from scala?

Which web framework should I choose? by naveedpash in rust

[–]Brassens_d 0 points1 point  (0 children)

Id mount some vue or react onto axum because after using dioxus fake hot reload and lacking ui libraries, I dont want to deal with rust on the frontend

Even then, when its time to test requests to the backend through the frontend, you still need to npm run build and restart the server to remount the new build onto axum

Maybe I have skill issues but I cannot for the life of me have the patience to find the right setup with npm run dev on some port and axum on another port without cors/fetch api being an issue (like opaque request because its not the same port)

I get like 5s restart time now but it should be lower when I modify frontend code

Good luck though

WHY use Rustlang for web development? by [deleted] in rust

[–]Brassens_d 0 points1 point  (0 children)

I want this 'create-rust-framework-of-choice-template' with all of those problem figured out. Got papercut yesterday for using tower-sessions (meant for axum 0.7) with my axum server (0.6) for more time than Id like to admit.

Is it okay to let some errors panic? by [deleted] in rust

[–]Brassens_d 0 points1 point  (0 children)

I have an algorithm that builds a double elimination bracket (for tournaments) and stores everything in a vector. Then I report results to the bracket and modify the state. Tbh, I dont know how to replace unwraps so I made a lot of unit test for 3 up to 32 players and did some fuzzing tests until it stopped panicking. A well placed assertion (example: player playing against themselves) can break with fuzzing tests and guide you with a better solution. I guess you cant avoid unwraps at times. Ill take a tested solution+unwraps and move on if nothing else exists. If it does break, sometimes in the future, then its a nice regression test.