[Pre]Steps to modernize the code - What do you think? #228
Replies: 1 comment
-
|
Most of this is way beyond the scope of this project. As I've inferred previously I don't want to change things for changing things sake. Just because something isn't optional doesn't mean we need to change it, it only adds needless work that will not bring anything to the user and bring more potential bugs. The idea is to enhance an already mature code base, not completely change it. I don't think the problem with newcomers is that their are big monolithic classes, but more that they aren't programmers and a lot of stuff is behind layers of abstractions/delegates that makes it hard to follow. When you need to go through half a dozen calls to find the actual place to change is probably why a lot of users that have tried to understand the code have not been able. The way the program is structured is fine like it is, we are working on an existing code base, there is no needs split it up using different model like MVVM, etc. Also the fact that it is a Winforms projects make it simpler for newcomers than adding layers would help. In fact changes like your I would be more inclined to accept changes like your My main pain point are not the big classes, but the big methods that would help to be cleaned-up. Things like Ex from if (thumbTileRenderer2.RatingStripRenderer == null || !Comic.EditMode.CanEditProperties())
{
break;
}Should be: if (thumbTileRenderer2.RatingStripRenderer == null || !Comic.EditMode.CanEditProperties())
break;About
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to figure out a way to make the codebase less unwieldy. After several attempts, think I'm starting to get somewhere and wanted to get people's thoughts around how the ComicRackCE codebase should look in the future.
To be clear, "somewhere" is barely scratching the surface, but I still think it can make a significant difference to making the code more approachable.
Note: This discussion differs from #10 (Steps to modernize the code) in that the focus is NOT making functional changes. Instead the aim is to re-organize the codebase so that you don't have to be a surgeon to work on it.
I've listed a few of the threads I'm currently thinking about below, but really the intention is to get an idea of what the community thinks.
How do you think the codebase should be structured?
What do you think needs to happen to make it more approachable to newcomers?
Which parts are sorely in need of some TLC? (don't say OpenGL)
Program and MainForm
They're the first 2 classes and they're monolithic; they need to be massively cut down. They talk to everything and everything talks to them. I hope this one isn't too controversial.
I've taken a crack at this here for MainForm and here. I'm not raising a pull request for these changes anytime soon; they're POC.
For Program, the idea was to move towards dedicated classes for the (many) roles it's currently playing.
For MainForm, the branch only looked at splitting up the menus and related commands. It needs a similar treatment of breaking way all of the many things it shouldn't be responsible for, as a UI component.
Layers : Split up UI and non-UI
Idk whether MVP/MVC/MVVM or whatever model makes sense for ComicRack, but it's not the current spider(-man)'s web.
This is tied to the points above and below but is wider in scope, so thought it deserved highlighting. I've tried a few different approaches, none of which I'm completely happy with, although they are steps forward.
Restrict problematic references
This one might be a bit more controversial. It's a looking-forward approach. Native Win32 calls are unmanaged, and they're being made everywhere.
System.Windows.Formslocks CRCE to Windows only.System.Windows.Drawinghas been deprecated for a number of years, and it shows.The aim isn't to get rid of these things, it's to abstract away from them so that they're easier to replace in future. For
Forms, this is partly splitting up the UI and non-UI components. ForDrawingand Win32, it's a case of restricting where they are directly referenced.Build: make betterer
This one is probably more controversial, in the sense that it's probably a pretty opinionated change.
Started with with opinions on whether it's needed or not.
IMO the build process could so with some TLC. Here are some of things I've messed around with and want to happen:
srcsubdirectory, to clearly distinguish from configuration filesbinroot directory instead ofComicRackproject subdirectoryBeta Was this translation helpful? Give feedback.
All reactions