DEV Community

loading...

Discussion on: What do you do to practice new programming languages and/or frameworks?

Collapse
hoelzro profile image
Rob Hoelz

One strategy I like to use when learning a new language (which you could probably apply to frameworks as well) is try to take example code from tutorials and purposefully break it to see what kinds of error messages I get. Here are some examples:

  • Misspell a variable or function name - how does the compiler communicate that to me?
  • If a tutorial says "just put this keyword here - trust me, and we'll explain why later" - definitely see what the compiler says if you omit the keyword!
  • If you learn about keywords that serve a similar purpose (eg. public and private in Java, my and our in Perl), try interchanging them in examples and see what breaks.

Although compilers' outputs are getting much friendlier these days, I've found that doing this helps to build an intuition for what the compiler is trying to tell you for later - when you're not trying to write invalid code!

Collapse
leoat12 profile image
Leonardo Teteo Author

I've never thought about that and I value greatly the learning experience that comes from a error or mistake. I will remember that one!