-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separating between Development and Release #599
Comments
Unless I'm misunderstanding something, I am highly against this idea. It's very important to me that what I see in the repo and what I see in the This would make the code base be two different ones even though they are On Thu, Apr 21, 2016 at 12:31 AM, Marcus Ottosson notifications@github.com
|
Agree with @Roflraging |
Thanks for chiming in. The goal would to reduce the amount of problems you would need to point out in the first place. It's possible that the larger and more intertwined the existing file gets, the more difficult it might get to maintain and understand. Breaking it up into smaller chunks might make it easier to spot unintended coupling and also communicate the library more easily to newcomers. @Roflraging and @dumganhar is it possible that you are not the target audience for such a feature? The end result would be a release header-only file for (a majority of) newcomers and hobbyists, and a full project of multiple source and headers files for advanced users. If you fall into the advanced category, you might even benefit from the change. |
I also have to agree with roflraging etc. above and think it creates more problems that it solves it. The library is in active development and I wouldn't want users to stumble on code in an amalgamated file that was different from the development one. It also create an extra barrier between being a user and being a developer, and hopefully there shouldn't be such barrier. It would create extra confusion on the repository itself. There's no release step and I'd prefer users just getting master which is the best way as a community to catch bugs early. A) If it is a matter of adding files to a project, you can use this imgui_in_one_file.h
Done! B) You give the example of It would bring more value to improve comments, improve the general structure documentation, keep massaging the code, and maybe add a developer guide on the wiki to describe some the architecture. I think there is a point where we have to accept that a given library is written in a certain style which make some developers more or less comfortable with working on it. The performance-oriented coding style of imgui is very specific and splitting into more file wouldn't make that easier? |
Thanks @ocornut, I appreciate that you took the time to consider this. I am of course much too new to the project to know what's best, but wanted to explore the option.
I think you've hit the nail on the head here. See, this doesn't surprise me. It sounds like a side effect of developing with too many globals. I'm not sure it will ever get easier unless deliberate steps are taken to untangle the code. In any case, it looks like a majority is in favour of keeping things as they are and you all may well be right. I look forward to learning more about the library and to experience things first hand! |
It's cool - proposals and ideas always welcome! There's 1 global variable and it is a current context pointer. Development isn't really hard or bottlenecked because of the code base style. The reason I say I can't easily split the code much more is just the nature of the code, functions are rather flats, there aren't a lot of sensible "categories" that are big enough to warrant their own file. Some people would create extra files for 300 lines of code but I wouldn't do that (e.g. "all tree functions in imgui_tree.cpp", if you add up the line count that sort of category ends up being very small), so I think it would actually harm development to split, in addition to making inlining trickier. That said, I am not against adding extra files if there are natural candidates but I don't see any right now (apart perhaps from all the text input stuff, which I aim to cleanup / refactor at some point after I can implement UTF-8 supporting changes in stb_textedit.h). It's not easy partly because there's many users using the library so API can't be casually broken all the time and some things needs to be engineering accordingly to limit breakage. In addition, subtle things may break easily which I why I would really love to implement the test suite drafted at #435 this would definitively make it much more welcoming for new developers ihmo. |
Hi @ocornut,
I had a quick thought about how to potentially improve how imgui is developed and how it is used.
The end result is meant to be..
### Motivation
At the extreme, there are two major ways of distributing any library; as a single file (such as stb), or as multiple files (like most other projects). Each of which has a few pros and cons.
Single, header-only library
Multiple files
And at the moment, I feel there is some tension between which of these routes to take.
### Implementation
The idea is to combine the best of both by introducing a release step.
The single file would be automatically merged at the time of producing a GitHub release such that (1) the end-user can simply drop-in the file into any project, almost like they can today but easier, and (2) developers of the project can split source code up into however many files and folders is necessary to make better sense out of things.
The advanced user would then be able to use the project as-is and cut down on things not required for a particular tasks.
### Example
Development files are divided.
logic.cpp
drawing.cpp
text.cpp
light.cpp
...
A single release file is built.
imgui.h
logic.cpp
drawing.cpp
imgui.h
The text was updated successfully, but these errors were encountered: