alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo21 is now known as alexherbo2
duane has quit [Ping timeout: 264 seconds]
duane has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 256 seconds]
<FromGitter>
<3n-k1> is there a way to have generic class variables? i tried what i thought was the obvious way and i'm getting a type error https://play.crystal-lang.org/#/r/9jzs
<jhass>
also in your case I would probably go with a single binary and a subcommand structure
<FromGitter>
<j8r> I was going to say that :)
<FromGitter>
<j8r> also, when possible, avoid back references like `../../`. This is a simple to avoid circle dependencies. (likely won't in such little project)
<FromGitter>
<j8r> Not a good deal in this little repo
<FromGitter>
<alexherbo2> you would put all commands in a single file?
<FromGitter>
<alexherbo2> can you show me?
<FromGitter>
<alexherbo2> I felt I have to create independant file and binaries, because the commands where not related
<FromGitter>
<alexherbo2> they do very different things
<FromGitter>
<j8r> but they are all related to passwords?
<FromGitter>
<alexherbo2> yes
<FromGitter>
<j8r> get one, edit one, create one... make sense to have a single binary, no?
<FromGitter>
<j8r> sounds like `kubectl get`, `kubectl edit`, `kubectl create`
<FromGitter>
<alexherbo2> the structure you suggest me is `src/password.cr` containing a module with the `create`, `edit`, etc. commands, and `src/password/cli.cr` used in shards.yml to build the binary?
<FromGitter>
<j8r> you can have `src/cli.cr` or `src/password_cli.cr`
<FromGitter>
<Blacksmoke16> thats how i handled it at first as well
<FromGitter>
<Blacksmoke16> i like the `alias` usage, i could get behind that pattern, maybe `private alias` instead, otherwise all those are going to be added to public docs/usable elsewhere
<FromGitter>
<grkek> Yeah I know the alias is global
<FromGitter>
<grkek> if defined outside
<FromGitter>
<grkek> of the scope
<FromGitter>
<grkek> it is a pretty neat thing
<FromGitter>
<grkek> reminds me of the elixir alias
<FromGitter>
<Blacksmoke16> thing i do for athena is define some short aliases on top level for common stuff
<FromGitter>
<Blacksmoke16> `ART::Controller` versus `Athena::Routing::Controller`
<FromGitter>
<grkek> right one looks explicit
<FromGitter>
<grkek> its nice
<FromGitter>
<Blacksmoke16> both work ofc, former is just shorter 😉
<FromGitter>
<grkek> Your project is just a gold mine for those who wish to learn crystal
<FromGitter>
<Blacksmoke16> doc wise you mean?
<FromGitter>
<grkek> The annotations
<FromGitter>
<grkek> are just mind boggling
<FromGitter>
<j8r> I don't think it is a good start for those wanting to learn crystal, will be too complicated
<FromGitter>
<j8r> Annotations and macros are advanced features
<FromGitter>
<j8r> For those wanting to learn those and see what's possible, Athena is great indeed
<FromGitter>
<grkek> > For those wanting to learn those and see what's possible, Athena is great indeed ⏎ ⏎ That is what I mean my friend
<FromGitter>
<grkek> also I released a new version of grip
<FromGitter>
<grkek> you should check it out
<FromGitter>
<grkek> I stole the file and body parsers from kemal and implemented them as well :p
<FromGitter>
<Blacksmoke16> its a good resource for whats possible with annotations, but prob not so good if you dont already have a basic understanding of macros/annotations
<FromGitter>
<grkek> I still cant get my head around the annotations
<FromGitter>
<grkek> and I hate them because I don't understand them
<FromGitter>
<Blacksmoke16> the tl;dr is they are just like markers that store data that can be read at compile time via macros
<FromGitter>
<Blacksmoke16> yes, would make things a lot easier to work with, since you dont need separate types that are essentially the same thing
<FromGitter>
<grkek> Have you tried making anything in Grip?
<FromGitter>
<Blacksmoke16> i havent even made anything in athena :D
<FromGitter>
<grkek> Omega based
<FromGitter>
<grkek> why not?
<FromGitter>
<grkek> I really need to write tests for Grip
<FromGitter>
<Blacksmoke16> one of those "i want to do project, but to do the project i want to be able to x, y, and z so i have to do those first"
<FromGitter>
<Blacksmoke16> is how athena got started...
<FromGitter>
<Blacksmoke16> now i have to get it to a point so that i can start the other project 😆
<FromGitter>
<Blacksmoke16> yes, tests would be a great idea
<FromGitter>
<grkek> that is how grip got started
<FromGitter>
<grkek> as well
<FromGitter>
<grkek> i hated kemals way of doing things
<FromGitter>
<Blacksmoke16> the global namespace is 😢
<FromGitter>
<grkek> i circumvented that
<FromGitter>
<grkek> at somewhat extent
<FromGitter>
<grkek> even if it had no global namespace
<FromGitter>
<grkek> the routes are defined in the dsl
<FromGitter>
<grkek> so basically each file will have its own route
<FromGitter>
<grkek> and youll have to search for the routes
<FromGitter>
<grkek> I must say the routing is pretty strong
<FromGitter>
<grkek> that is why I chose it
<FromGitter>
<grkek> Grip is next to the h2o.cr
<FromGitter>
<grkek> on the tech empower
<FromGitter>
<grkek> basically taking the 2nd place
<FromGitter>
<grkek> in speed
<FromGitter>
<Blacksmoke16> speed isnt everything, also should consider testability and maintainability
<FromGitter>
<Blacksmoke16> i.e. how would someone go about testing their controllers etc
<FromGitter>
<grkek> testing is done by spec grip
<FromGitter>
<Blacksmoke16> well there you go
<FromGitter>
<grkek> and maintainability is really nice since the structure is great
<FromGitter>
<wyhaines> "i havent even made anything in athena :D" ⏎ ⏎ Shhhh. Don't say that too loudly, since I am chest deep in implementing something with it.
<FromGitter>
<grkek> depends on how you design it
<FromGitter>
<grkek> What do you think making the cookiecutter template was a mistake or nah?
<FromGitter>
<dscottboggs_gitlab> I finally tried athena recently. very sold
<FromGitter>
<Blacksmoke16> an actual app that explains what the structure/things are would prob be better
<FromGitter>
<grkek> > an actual app that explains what the structure/things are would prob be better ⏎ ⏎ I already have that :p