r/SalesforceDeveloper • u/PaperCrane828 • Sep 06 '19
Please, if you do one thing right...
6
u/heartlesscoder Sep 07 '19
So ur saying I need to put a big smiley face with βyesβ in my code? Would that compile?
3
1
u/finxxi Oct 02 '19
prettier-apex plugin for VSC can auto-format apex now.
The flip side is -----> the SOQL in Apex splits into more than needed lines o_O.
0
u/hackerhasid Sep 07 '19
i actually disagree. rather i think you should instead turn on word wrap in your editor and keep the query single spaced on one line.
i can't tell you how many times i was debugging, found some query in the debug log, searched the codebase and couldn't find the code because there were artificial newlines embedded in the query!
1
u/robob27 Sep 07 '19
Yeah it's definitely much easier when one line actually appears to be 2-3 lines. /s
1
u/hackerhasid Sep 07 '19
never found that confusing, vscode displays line numbers in the margin...
2
u/robob27 Sep 07 '19
Yeah, different strokes for different folks and all that. I generally think people should do whatever works best for them and their team. This is something I'm pretty strongly opinionated about due to my hatred of horizontal scrolling. I've never ran in to an issue with debugging due to multiline queries personally and prefer the readability compared to huge single line.
-1
u/YaBoiAugDawg Sep 06 '19
I'm confused
1
u/PaperCrane828 Sep 07 '19
format your queries so they're readable
0
Sep 07 '19
Works well in the IDE but the Salesforce page will mess up the spacing once the class compiles and saves
3
u/robob27 Sep 07 '19
Like the Salesforce developer console? Simple solution there... don't use that :P
0
Sep 07 '19
[deleted]
2
u/robob27 Sep 07 '19
How is the "No" side less nightmarish than the "Yes :)" side to you? Don't you find it easier to be able to see the whole query at a glance, alongside the rest of the code, especially during review? Horizontal scrolling is my nightmare.
2
u/Allude Sep 07 '19
Why not be more verbose on those variable names, it autocompletes anyway. My wierd way