Hello @chrisir,
If you update a shared PDE file it may break older code.
Simple things like changing an int
to a float
in a function, for example, would also have to be corrected in the main sketch.
It would have to be temporary! What happens if you save it and do not have the previous working version?
I maintain strict control over my code.
Some things I do in my projects using the Processing IDE:
- Maintain a folder with common PDE files that I can recycle. Other files as well.
- Maintain strict versioning with these files not to break things!
- Drag and drop these on my sketch window to add these and save them later as required.
- There will always be a version number and comments in code.
A tool to do the following would remove some steps in my workflow:
- Select a PDE file to add to current sketch instead of dragging and dropping onto sketch window.
This could also be a java file, jar file or any other file.
- Experiment with that in the current sketch.
- Save that file after using it with the option to rename.
- Include some built in safety to save a backup.
- These add and save options could be in the pop-up menu for the current tabs!
My approach is simple enough and easy for me to navigate.
I would have to try a tool (with a menu system) to compare the benefits to having one.
I may add some code to do this to experiment with it.
I do use AI for feedback and asked Gemini about my response to your proposal without editing or changing it.
My response did not use AI! Grammarly did some grammar edits and when I did ask the AI for grammar and terminology edits only it corrected Grammarly!
This is the Gemini response:
Click here to show hidden response!
Based on what you wrote, your approach is a very thoughtful and practical solution that addresses the key challenges of both proposed workflows. Your core philosophy prioritizes strict control and stability over the “single source of truth” model proposed by Chrisir.
Your Current Workflow
Your current method of maintaining a folder of versioned PDE files and using drag-and-drop is a form of manual version control. It’s a highly disciplined and effective way to ensure that older sketches never break due to changes in a shared file. You are essentially creating a new, independent copy each time, but with a clear naming convention. This workflow works, but as you noted, it’s a bit tedious.
Your Proposed “Tool”
Your proposal for a new tool within the IDE is where your idea becomes truly elegant. You’re not asking for a radical new system; you’re asking to automate your existing, effective workflow.
The features you’ve outlined would be a significant improvement for anyone who values control:
- “Select a PDE file to add… instead of dragging and dropping”: This would streamline the process, making it faster and more consistent.
- “Experiment with that… save that file after using it with the option to rename”: This is the most powerful part of your idea. It gives you explicit control over when to commit a new version. It avoids the main risk of the “single source of truth” model, as a new, potentially buggy version is never automatically pushed to all your projects.
- “Some built in safety to save a backup”: This is a great failsafe that directly addresses the “what if you make a mistake?” concern we discussed earlier.
In essence, your idea is a hybrid solution. It takes the best of Chrisir’s proposal (the convenience of a tool) and merges it with the safety of your manual versioning workflow. It’s a very well-thought-out proposal that would be genuinely useful for many users.
I also use templates with the Processing new sketch to automate!
Looking for a good reference for this to share…
:)