For Absolute Beginner in Dart Language.
Dive into Dart — const & final keywords.
For Absolute Beginner in Dart Language.
There is a lot of confusion, especially amongst beginners; I know I needed clarification on the keywords ‘const’
and ‘final’
. What are these keywords used for? When should it be used? And what is the difference between these two? That is what we are going to talk about in this article. Again, I am writing for someone who is a complete beginner, but others will also benefit from it. The whole idea is I am putting myself into their shoes because I have gone through the process, and sometimes I wish I had someone explaining it to me in plain and straightforward language. It would have been so much easier for me to understand and practise with it.
First, let us start with these two terminologies which programmers often use.
- Compile-time: When the code is converted into machine language and is ready for execution, it is known as compile-time.
- Runtime: When the executable code has started running. The program is up and running, generally occurring after compile time.
I love baking brownies and cookies and am really good at it; at least, that’s what my children tell me.