As in title, i have recently picked up Kivy for Python GUI development. I do not enjoy using the kv files, as i prefer to do binding myself, and not rely on some background "magic". Is it acceptable to write apps in Kivy without using the kv files?
2 Answers
It is not required to use the kv language in app development. You can do everything you need to without using a kv file. However, I have found the kv language to be very helpful in making apps. I would recommend getting comfortable with using it, but it ultimately comes down to your preference.

- 272
- 1
- 2
- 10
-
1@mac_wyc, I would also mention that there definitely *is* a lot of "magic", that the kv-language is doing under the hood. While I also prefer the idea of pure-python, be aware that you may have to do a lot of research, to find the exact equivalent. I've certainly spent days, trying to figure out why my Python-code wasn't working like the KV file it was replacing. – John C May 23 '22 at 18:41
As well as what John C said about the magic under the hood, you might also be missing out on some advantages of keeping your gui definition separate from your code logic.
Having separate code and gui files also means you can welcome other people into your project development easily, and you can develop the skills to be part of a team in future. If you ever intend to code as part of a team it will help you develop the skills you need. Especially, to think in terms of separating code, gui, and data.
Using a kv file also gives you the opportunity to subsitute different gui experiments easily. This might be more relevant if you are making cross-platform code. The app can test and substitute the appropriate kvs depending on OS circumstances.
Professional software development training always teaches the advantages of separating business logic from ui, some of which are:
- increased maintainability
- better debugging
- portability
For example, if you want to switch to another gui framework in future it's going to be much easier if you have the ui definition separate to the code logic. Especially if you're inviting third party help.

- 1
- 1