I’m very interested in Crystal, but I’m confused about where to start learning it. I tried opening its documentation, but I got lost in it. There’s nothing like a complete tutorial teaching this language for beginners. I’m amazed by Python, where the documentation is very beginner-friendly. Is there any website who can teach this language to beginners? Or should I learn Ruby first before diving into this language?
I would start with
- Introduction Language introduction - Crystal
- Semantics About this guide - Crystal
- Guides Guides - Crystal
- API Crystal 1.14.0
This is an interesting question.
To answer it, I checked the official Crystal website.
Install
First, you need to install Crystal.
You can find the guide here:
Crystal Install
On some platforms, you may need to build the code yourself to use the interpreter.
This can be hard for beginners.
Crystal as a Command Line Tool
Next, you need to learn how to use the crystal
command line tool.
Run this command to see basic help:
crystal --help
For more details, check the manual here:
Using the compiler
Learn Basic Classes
Next, you need to learn about Crystal’s basic classes.
This information is in the “Specification” section of the official docs.
If you read from the start, you might find the Documenting code
part hard and stop reading.
Important topics for beginners include:
Tutorials
Crystal has official tutorials:
Crystal Tutorials
But “Getting Started” feels too hard for beginners.
“Language Introduction” is useful, but it is placed after “Getting Started,” so it is hard to find.
Beginners may want to learn about Array
and Hash
early, but the tutorials do not cover them much.
Easy Learning and Order of Topics
A teacher once said, “The order of teaching materials shows the teacher’s skill.”
It is important to give tasks in a good order so the learner does not lose interest.
This is like making levels in a game with the right difficulty.
Making Better Materials
We are not teachers or game creators.
I think it is very difficult to motivate people to create teaching materials for beginners.
Unlike Python, there are very few people making money with Crystal, and the majority of people are doing it because they like it.
Books
There are also books about Crystal:
Crystal Programming
You probably have to read a Ruby book then you will read Crystal official document happy.
Hahaha
No wonder the “read the Ruby book first” opinion is unpopular, but since it is quite emotional, I think there is a possibility that you are actually right.
Unless you create a large cohort of students and conduct a study comparing the learning outcomes of the Crystal language with and without Ruby materials, we will never know the truth about which one has better results. (I know what I am writing here is a lot of nonsense.)
The practice of teaching Ruby and Python has been repeated tens of thousands of times around the world. The materials are well developed and well tested with real students. I think it’s actually not a bad idea to collect parts from Ruby teaching materials for beginners that could be used in Crystal.
I don’t have the time or energy to do that, but if I had to teach Crystal to someone, I would do so.
Myself is a example(a little static programming language experience, in fact, before age 35, i am never been a programmer, I only have Ruby experience start from age 35), but, when I start to use Crystal, and read official doc, except the part about type, static programming language, all other parts are completely painless.
I am very familiar with Ruby, i can say 80%, even more about good part of Crystal almost SAME as Ruby, considering Ruby has many good books, and the most of SPECIAL part of this language directly inspired from Ruby, why not start from Ruby? things you learn in Ruby are always useful, Even if you have few time to used Ruby for now, just like me.
No wonder the “read the Ruby book first” opinion is unpopular,
It’s clearly this is not a good trend, probably many user don’t know, Crystal original corp, original author, all come from Ruby, and even early versions of Crystal were written in Ruby, now in order to attract developers of other languages, they want to put a great deal of effort into distancing themselves from Ruby.
Yes, in fact, using Ruby as a learning tool for Crystal is not such a bad idea.
However, I would like to note that the idea of “Making Ruby users use Crystal” is an idea that will never work and has nothing to do with using Ruby books to learn Crystal.
I think our direction should be “to let young people who are used to modern static languages experience the Crystal language and realize that the nature of a dynamic language like Ruby is not as bad as people say it is.
See External resources - The Crystal Programming Language for some good learning materials.
What kind of tutorials do you think would be needed? Maybe share some examples to get a better idea.
For which target audience? Complete beginner to programming?
Programmers who know the basics of programming and are coming from another language?
Also not sure if you were aware there is a crystal track in exercism that could be useful.
But in any case tutorials could be written on such a wide variety of topics and wide range of audiences that if you could provide a bit more details that could be helpful.
Actually went and checked that out and it gave me this tagline:
133 coding exercises for Crystal on Exercism. From Robot Simulator to Ary's Amazing Lasagna.
Did @asterite work on these? If not that is a hilarious coincidence.
No, I think they have perhaps made a pr or two. But the majority of the content on Exercism, have I written together with some other contributors.
Quite often is the first syllabus exercise named after the creator of the language. Python’s version is: “Guido’s Gorgeous Lasagna”, which is a refrence to Guido van Rossum.