The Apex Master Class

What Is an IDE? (Apex Master Class Ep. 4)

4 min read

Subscribe on YouTube

What Does IDE Even Stand For?

Now that we know what Apex is, let’s talk about where you’re going to write it. And the answer is not the Developer Console.

IDE stands for Integrated Development Environment. All that really means is a single place where a pile of genuinely useful development tools live together, so you can build faster and with less friction.

This applies to any tech stack, not just Salesforce. If you’re writing code, use an IDE. It will make your life meaningfully easier.

For these examples I’m in IntelliJ with the Illuminated Cloud 2 plugin, which is my personal preference. Everything I’m about to describe works in VS Code with the Salesforce Extension Pack too, and we set both up in the next two episodes.


“But The Developer Console Does That Too”

This is the fair objection, so let’s take it head on.

Yes, the Developer Console lets you write Apex, run SOQL queries, view debug logs and execute anonymous Apex. All true. Here’s what it doesn’t do.

Jump to definition. Say I’m looking at a reference to OpportunityCalculatorService and I want to see the class itself. In the Developer Console I’d open the file browser, hunt for the file, open it. In IntelliJ I put my cursor on it and hit Ctrl+B. I’m there in a tenth of a second. In VS Code it’s F12.

Find every usage. Where is this class actually being used across my entire codebase? Ctrl+Shift+F and I have every reference in front of me. The Developer Console simply cannot do this, and once you’re working in an org of any real size you will need it constantly.

Autocomplete that actually works. This is the big one. I start typing System, hit tab, type a period, and I get a complete list of everything that class can do. The Developer Console does offer some autocomplete, but it’s inconsistent and frequently incomplete. Proper autocomplete means you spend a lot less time reading docs just to remember a method name. It works for JavaScript too, so you get the same benefit building Lightning Web Components.

Version control. You can wire your IDE straight into Git, which means local history and the ability to revert when you inevitably break something. There is no version control in the Developer Console at all. If you want the full picture on why this matters, I’ve got a whole post on building a CI/CD pipeline.

A terminal. Right there in the same window, so you can run the Salesforce CLI without alt-tabbing anywhere. Not possible in the Developer Console.


Code Formatting You Only Configure Once

Dig into your IDE settings and you’ll find a full code style section for Apex. Want your else statements on a new line instead of hugging the brace? Tick a box. The IDE reformats for you from then on.

The genuinely useful part is that you can export those settings and hand them to your team. Everybody’s code comes out looking the same, and you stop having pointless formatting arguments in code review. Same thing works for JavaScript.

You can also configure your comment headers so every new class starts with a properly formatted doc block. Small thing, saves you thousands of keystrokes over a year. (If you’re on VS Code, I’ve got a separate post on setting up Uncrustify to format your Apex automatically.)


Running Tests And Seeing Coverage

You can run your Apex tests directly from the IDE and see code coverage displayed right next to the classes being tested. It breaks down exactly which classes were covered and gives you line by line coverage inline.

The Developer Console can run tests too, but the presentation here is considerably better, and having it in the same window as the code you’re fixing matters more than it sounds like it should.


And Saving Just Works

Probably the single nicest thing day to day: hit Ctrl+S and your code deploys straight into your org. You don’t write it locally, switch to a browser, and paste it in. You write it, you save it, it’s live in your org basically instantly.


What’s Next

And honestly, all of that is barely scratching the surface. The goal here was just to convince you that the twenty five minutes it takes to set one up is the best twenty five minutes you’ll spend this week.

So let’s go do that. In the next episode we set up VS Code, and in the one after that we set up IntelliJ with Illuminated Cloud 2. Pick whichever appeals to you, or do both and see which you prefer.

See you next time!


Get Coding With The Force Merch!!

We now have a redbubble store setup so you can buy cool Coding With The Force merchandise! Please check it out! Every purchase goes to supporting the blog and YouTube channel.

Get Shirts Here!
Get Cups, Artwork, Coffee Cups, Bags, Masks and more here!


Check Out More Coding With The Force Stuff!

If you liked this post make sure to follow us on all our social media outlets to stay as up to date as possible with everything!

Youtube
Patreon
Github
Facebook
Twitter
Instagram


Salesforce Development Books I Recommend

Advanced Apex Programming
Salesforce Lightning Platform Enterprise Architecture
Mastering Salesforce DevOps

Good Non-SF Specific Development Books:

Clean Code
Clean Architecture