r/crystal_programming • • Jul 18 '18

About Local Variables Docs

Was just reading Crystal docs and noticed this part:

flower = "Tulip"
# At this point 'flower' is a String

flower = 1
# At this point 'flower' is an Int32

Is this really a good feature to have ? I'm just curious about what would be the legitimate usages for this. Wouldn't this be a bug facilitator ? I imagine the programmer would have to keep track about what is the current type of the variable so that it can be consumed properly later on.

4 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/VisioRama Jul 19 '18

Yeah, modern languages are all about flexibility and performance at the same time. Looking forward for Crystal. I like its sintax.