Debugging is an art of finding errors. There are certain constants in life which are unavoidable – death, taxes, and bugs in programming! Debugging comprises of finding the source of a problem in a code base, identifying possible causes, testing out hypotheses until the ultimate cause is found, and then eventually eliminating that cause and ensuring that it will never happen again.
Before we take a deep dive into mastering debugging, let me draw your attention to my previous article Pre-requisites for Learning Apex – Logical Mind and Confidence! I discussed Variables naming convention and Operators. There were few assignments for you in that article, if you did not get a chance to complete it, do it right now. It will not take more than 30 minutes to complete them.
Irrespective of whether you are a newbie, just starting a career as a Salesforce Developer, or have some programming background, I would suggest you complete the assignments. The assignments will help you to, either learn few new things or, at the least, brush up your concepts.
This is the third article in learning Apex series. If you have not read first two articles – Mastering Apex Variables – a Stepping Stone in your Apex Journey and Pre-requisites for Learning Apex – Logical Mind and Confidence! – I strongly recommend going through it now. At bare minimum, these articles will help you to brush up your basic concepts of programming.
The common question people repeatedly ask me is – Are there any prerequisites to start learning Apex Programming? To that, my simple answer is – yes! However, my recommended prerequisites is not to practice ABCs of Apex! But, it is to cultivate your ability to build logic! If you cultivate your logical mind then, it is not difficult to learn programming languages. After all programming languages are created by mortals like us!
A person who really wants something will find a way, a person who does not will find an excuse.
To learn Apex programming, remove the rust! One of the most efficient ways to do so is to complete a Sudoku puzzle daily – start with easy puzzles. Let this be a starting point, or a pre-requisite, of your Salesforce Developer Journey!
Second suggestion – start writing Pseudocode instead of writing Apex code directly. It means solving the problem in plain English (Pseudocode)! And, only then, write the code. Pseudocode is an easy way of writing programming code in English – it is not an actual programming language. It uses short phrases to spell out the logic on how one would solve a requirement before one creates codes in a particular language. Once you are confident about Pseudocode, only then start converting your Pseudocode into any programming language – in our case, into Apex. Remember Pseudocode is just plain English not related to any programming language.
Salesforce offers lots of content to get you started on your Apex journey. If you are just starting your Salesforce Developer career then read this article – Creatively Decode Your Salesforce Developer Journey– to get some guidance, as well as, to learn how to achieve your Salesforce Developer goal.
My primary purpose, through this and other blogs, is to be your guide and a mentor. As for Apex learning tools – such as browsing through Apex content to get you started on learning the language – there is no shortage of material available on the Web. For example, search for ‘best practice to write Apex trigger’ and you will Read the rest of this entry!