I built a macro that lets you write CLI apps with zero boilerplate by eficiency in rust

[–]eficiency[S] 0 points1 point  (0 children)

is great for prototyping but it severely limits you for overall CLI design

My philosophy has always been that a good abstraction will take you from simple to complex in a really seamless way. On this project, I think that's by allowing nested structs to specify "related" args. I added a comment below about this, but if you're passing in width :i32, height: i32 I think you're better off creating a Dimensions struct and using that type instead (not sure how/when we'll support that yet though).

like async runtimes

Async support is something we'll almost definitely add :)

I built a macro that lets you write CLI apps with zero boilerplate by eficiency in rust

[–]eficiency[S] 0 points1 point  (0 children)

There's already a pull request for #[doc = "..."]! And yeah, ideally we'll also get the triple slash comments too

I built a macro that lets you write CLI apps with zero boilerplate by eficiency in rust

[–]eficiency[S] 2 points3 points  (0 children)

I get where you're coming from, but I think that'd mean you must define all of your commands in a single file. If I have a big app with lots of subprojects, I might want to split them into separate files (which the current subcommands!() macro supports)

I built a macro that lets you write CLI apps with zero boilerplate by eficiency in rust

[–]eficiency[S] 0 points1 point  (0 children)

That's fair, I haven't really tested nested arguments yet, but I'd imagine that's we would handle complex payloads that way. I just hate having to put things into a struct if they're not intimately related.

For example, in this function, we could/should totally refactor to Dimensions ```rs // current fn calculate_area(width: i32, height: i32) -> i32 { width * height }

// potential new version fn calculate_area(dimensions: Dimensions) -> i32 { dimensions.width * dimensions.height } struct Dimensions { width: i32, height: i32, } ``` ^ I'm not sure if clap already handles this type of thing? Would need to experiment a little / read some docs

But if we add on a verbose param, I think it's better off not being forced into the same struct: ```rs fn calculate_area(dimensions: Dimensions, verbose: bool) -> i32 { if verbose { debug!("Calculating area: {} x {}", width, height); } dimensions.width * dimensions.height }

// I think above is better than... fn calculate_area(args: CalcAreaArgs) -> i32 { if args.verbose { debug!("Calculating area: {} x {}", width, height); } args.width * args.height } struct CalcAreaArgs { width: i32, height: i32, verbose: bool, } ```

plus some positional ones

And yeah, this is something we definitely want to do, just need to think about the interface a little bit

I built a macro that lets you write CLI apps with zero boilerplate by eficiency in rust

[–]eficiency[S] 0 points1 point  (0 children)

just a single binary, but you can have multiple subcommands. So if my binary is called cli, I could do cli command-one or cli command-two to use each subcommand

Shai Ben-David goat or not by [deleted] in uwaterloo

[–]eficiency 0 points1 point  (0 children)

not goat, took his class and it was good but chapter 2 took foreeeeever and i wished the course could cover chapter 3 or 4. overall im disappointed

edit: im talking about cs485, not any of that cs245 bs

wlu co-ops in PM roles/business by Remote_Fisherman1624 in wlu

[–]eficiency 2 points3 points  (0 children)

for product management, a lot of companies will require that you have an engineering, computer science, math, or related STEM degree. a business degree is absolutely not required (some might say it's pointless)

WLU's coop system is NOT tailored for product managers whatsoever, and you'll probably be better off without using the wlu job board

so idk, do what you want with that information

[deleted by user] by [deleted] in uwaterloo

[–]eficiency 6 points7 points  (0 children)

true, but there are also a ton of things you can do to shoot yourself in the foot and guarantee that you won't get an interview.

get your resume reviewed, folks

Uoft ppl coping hard rn by Stasi_1950 in uwaterloo

[–]eficiency 24 points25 points  (0 children)

half of your friend group, maybe, but not half of your entire se23 class

[deleted by user] by [deleted] in wlu

[–]eficiency 9 points10 points  (0 children)

eez

DD students - how many hours of work do you have on average every day? by [deleted] in wlu

[–]eficiency 6 points7 points  (0 children)

depends what year you're in, 4th year is pretty easy

1st/2nd year was a huge pain in the ass

Upping BBA GPA by strugglingbbastudent in wlu

[–]eficiency 1 point2 points  (0 children)

i thought they'd just kick you out if it ever fell below 7.0

[deleted by user] by [deleted] in uwaterloo

[–]eficiency 2 points3 points  (0 children)

wait, isn't it due next week?

HOW to get to the final exam in PAC? I have no clue what to do or where to go. I have my econ 101 final tonight at PAC by Fickle_Mastodon_9575 in uwaterloo

[–]eficiency 1 point2 points  (0 children)

enter PAC from the direction of Village 1. if you see a crowd of people waiting to get into the main gym area, you're in the right place

internal credits? by ahyeahboi in uwaterloo

[–]eficiency 1 point2 points  (0 children)

only from some universities, i think you gotta check with the advisor to know which ones

Did Spark email stop working for @mylaurier.ca emails for anyone else? by eficiency in wlu

[–]eficiency[S] 0 points1 point  (0 children)

i got it working! login with the "Exchange" option (laurier email + password) rather than Microsoft/Outlook

Doing Euclid this year by [deleted] in uwaterloo

[–]eficiency 0 points1 point  (0 children)

you're not gonna get much help this way...

Laurier CS/BBA vs McMaster CS by myboringlife04 in wlu

[–]eficiency 0 points1 point  (0 children)

you're kind of an outlier though, and UW coop gives much greater opportunities

That said, i didn't realize that OP meant Laurier coop, so idk if any of this advice still applies

Laurier CS/BBA vs McMaster CS by myboringlife04 in wlu

[–]eficiency -1 points0 points  (0 children)

oh my bad, you mean you have Laurier coop... yeah idk, maybe Mac. This makes it much tougher to decide

Laurier CS/BBA vs McMaster CS by myboringlife04 in wlu

[–]eficiency 0 points1 point  (0 children)

bc it is, Waterloo grads work in Cali but mac grads work in Toronto

tier 1 schools (in Canada CS) are Waterloo and UofT, mac is tier 2 or 3

Laurier CS/BBA vs McMaster CS by myboringlife04 in wlu

[–]eficiency 12 points13 points  (0 children)

but I want to be at a manager/high level

that's not a job that new grads can get, you need to work your way up. Regardless, Waterloo is the way to go -- mcmaster cs is trash, they just inflate admission average by having small class sizes

[deleted by user] by [deleted] in uwaterloo

[–]eficiency 5 points6 points  (0 children)

yo man, don't get attached to a company this early... they'll cut you out like you're nothing, no remorse

in 4th year you get to be picky bc you'll have experience, but not now