Hello everyone!
A quick quality-of-life update: we’ve installed an official Discourse plugin that warns you when a post might contain unformatted code. This has been a pain point for all of us for a very long time, and it’s nice to finally have a built-in solution.
Those of you who have spent years gently reminding newcomers to use triple backticks can finally take a well-deserved rest! The plugin will take it from here.
If you see the prompt, just format your code using the editor’s code button or triple backticks. Clear code makes it easier for everyone to read and helps beginners get support faster.
Thanks for helping keep the forum tidy and readable for the whole community!
7 Likes
I use ```java.
I did not know that there is a ```processing; is there a difference between the two (to your knowledge).
Thanks for your question @sterretje 
There is indeed a difference. Using ```processing correctly highlights Processing-specific keywords like background(), noLoop(), width, or PI, which are not part of the Java language.
See the comparison below:
This code is highlighted using ```java.
void setup() {
size(640, 360);
coswave = new float[width];
for (int i = 0; i < width; i++) {
float amount = map(i, 0, width, 0, PI);
coswave[i] = abs(cos(amount));
}
background(255);
noLoop();
}
This code is highlighted using ```processing.
void setup() {
size(640, 360);
coswave = new float[width];
for (int i = 0; i < width; i++) {
float amount = map(i, 0, width, 0, PI);
coswave[i] = abs(cos(amount));
}
background(255);
noLoop();
}
3 Likes