Looking for resources on idioms and patterns

Hey all!

Coming from a dotnet background, I’m pretty used to clean architecture, dependency injection, config and service registration on program.cs etc - doing stuff the dotnet way really.

What are some good resources on crystal idioms, patterns and how to structure projects?

Thank you for your time

You can ask GPT such a question, and it will answer something like: generate a project with crystal init app name, dependency injection in shard.yml, config and service registration with external shards.

I’m afraid there are a lot less written about crystal than dotnet, but that of course does not mean that you are completely alone working in crystal.

For basic stuff, a good place to start is docs site.

For depency injection, there haven’t been to many shards available, but you can start by checking out either Athena Depency Injection or the di shard.

Lastly, please keep using the forum. There are lots of friendly programmers here and I have never been let down when asking how to do something “the crystal way”.

The most de-facto reference everyone agrees on for Crystal are the official resources: the guides and documentations, and also the language itself (stdlib & compiler).

By reading how the language is implemented we can learn a lot about how doing some things the Crystal-way.

I second @j8r advice on starting by learn from the official guides at Crystal Docs, because it opens the mind to understand the Crystal-way of doing things.

My own take on this is to avoid trying to bringing your own way before understanding how Crystal works. Then you have a clearer view to decide how to proceed in your project.

All good tips, thanks alot! Yeah there is definitely something special about a smaller community

Fair point, and really what I want to avoid. It’s easy to try to shoehorn known ways of doing things, coming from another oop language