News for hackers. Stuff that matters.
Re:Analog Chess – pieces are not constrained to a grid by panki27 on Friday January 13, 2023 @01:23PM (#34371765)
I love the versioning approach here - use git but still create fileV1.py, fileV2.py...
Re:Analog Chess – pieces are not constrained to a grid by FpUser on Friday January 13, 2023 @01:29PM (#34371859)
I did not look at their particular code but I had files named like this in my projects: api_v1, api_v2. Reason being that the software V2 still supported v1 api so both were present and needed.
Re:Analog Chess – pieces are not constrained to a grid by actinium226 on Friday January 13, 2023 @01:47PM (#34372099)
A reasonable approach but from the README:

"To run the code you will need to install Python and the PyGame library, and then run the latest .py file because I can't be bothered to actually use version control."

Re:Analog Chess – pieces are not constrained to a grid by ChildOfEru on Friday January 13, 2023 @01:59PM (#34372280)
I'm just reminded of the last line of the README.md

"I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends." -- https://github.com/ehulinsky/AnalogChess/blob/main/README.md...

Re:Analog Chess – pieces are not constrained to a grid by The_Colonel on Friday January 13, 2023 @03:30PM (#34373468)
It's a relatively common approach in e.g. web services, but not in standalone games.
Re:Analog Chess – pieces are not constrained to a grid by FpUser on Friday January 13, 2023 @09:30PM (#34376784)
I did not really look at the project, just at the comments so yes sure.
Re:Analog Chess – pieces are not constrained to a grid by Kiro on Friday January 13, 2023 @07:25PM (#34375852)
I do the same. I think it's nice to have the old version readily available as reference instead of hidden in git.
Re:Analog Chess – pieces are not constrained to a grid by DangerousPie on Friday January 13, 2023 @07:55PM (#34376073)
You need a better ide!
Re:Analog Chess – pieces are not constrained to a grid by 8n4vidtmkvmk on Saturday January 14, 2023 @03:46AM (#34378525)
phpstorm has good history. vs code can die in a fire.
Re:Analog Chess – pieces are not constrained to a grid by Kiro on Saturday January 14, 2023 @09:57AM (#34380753)
What has VS Code done to you to deserve that?
Re:Analog Chess – pieces are not constrained to a grid by 8n4vidtmkvmk on Sunday January 15, 2023 @02:47PM (#34392558)
:-) I don't hate it that much, in fact, I use it a bit, but I still think it's inferior, but the fact that it's so popular means that a lot of extension developers are now targeting it and only it which forces me to use inferior tooling for some things. I already have this problem with Git. I think Mercurial is better but all the good tooling is built around Git.
Re:Analog Chess – pieces are not constrained to a grid by userbinator on Saturday January 14, 2023 @04:30AM (#34378760)
It's so cliche to recommend a more complex tool --- with its own associated learning curve and more complex failure modes --- when there's already a simple method that works perfectly well, but isn't "best practice" or whatever the dogmatists call it.

Can you run two or more versions and compare their behaviour simultaneously, even debug them side-by-side? I'm sure there's some sort of plugin and IDE ecosystem that you can spend tons of time learning how to configure just to be able to do that, but if all I need to do is to copy the files and rename them, why not?

Do some people really love excess complexity so much?

Re:Analog Chess – pieces are not constrained to a grid by JelteF on Saturday January 14, 2023 @04:43AM (#34378833)
I agree with the general gist if your post, but still wanted to call out the "git worktree" because that would solve the problem you're describing. It's pretty much a better version of cloning the repo twice.
Re:Analog Chess – pieces are not constrained to a grid by DangerousPie on Saturday January 14, 2023 @06:32AM (#34379443)
I guess it depends on your use case. If you have a basic tool where most of the functionality lives in a single file and which you need to compare to previous versions frequently, I can see how just having incrementing file names could be useful.

I would say that this is a bit of an exception though. Most projects are spread across many files and dependencies, so it would be a huge mess trying to manually version those by renaming files all the time. I also rarely want to compare several different versions of my code side by side, so I prefer having all of the old stuff 'hidden away' in git by default.

Re:Analog Chess – pieces are not constrained to a grid by leni536 on Saturday January 14, 2023 @09:29AM (#34380556)
Alternatively to "better IDE", use git worktree. git allows to check out multiple revisions to distinct working directories.

Or just clone the same repo multiple times, or have some releases unpacked outside of version control.