c++ in pros

In the next version of pros it will be c++ out of the box. Thus what changes will we see to how the pros api is implemented. will it remain just a list of function or will it be placed into a namespace?
example:


int ex = pros::digitalRead(1);
//or
int ex = digitalRead(1);

I don’t know how viable this even is, and there are PROS and cons to each, however I would like to know how my current code will be affected and if I need to change things.
Thanks in advance :slight_smile:

Alex,

Nothing will change for PROS 2.0 (the version for the Cortex). With PROS 3.0 (for the v5), we’ll support C++ out of the box and encourage it.

IOW, your current code will be largely incompatible with the new platform, and you will have to rewrite it. (The logic should carry over, just not the implementation(s))

That’s disappointing. I wanted to have a code template for my team’s future programmers (I am the only one right now and am graduating…).

If you’re determined enough, you could probably create an API for using current PROS implementations with PROS 3.0.

I’d suggest creating a set of algorithms for common operations, as the major differences will be in implementation. For example:


tankDriveForward:
    set left motors to joystick input
    set right motors to joystick input
    sleep

(yes, it’s a pretty naïve function, but I hope it illustrates my point)

Disclaimer
PROS 3.0 is still under development, and very few things are finalized. My intention in bringing up the idea that code will likely have to be rewritten was to give everyone some fair, advance warning that there will be differences. We won’t reveal much more before we are ready. I thank you all for your understanding.