mac_wyc
mac_wyc

Reputation: 45

Is it required to use kv language in kivy app development?

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?

Upvotes: 4

Views: 871

Answers (2)

Peter Cohen
Peter Cohen

Reputation: 1

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.

Upvotes: 0

Connor
Connor

Reputation: 297

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.

Upvotes: 4

Related Questions