[yast-devel] Defensive programming or "it doesn't change that often"?
Dear Developers, I've just seen another PR fixing `The World Has Changed` issue at https://github.com/openSUSE/installation-images/pull/192 It's indeed a simple fix, no brainer, but it's not the first time I see such fix. That again raised a question that comes to my mind from time to time: Should YaST blindly write "something somewhere and just wish that it will work"? There is another way - Defensive Programming which checks that what we write actually makes sense/exists/... In this case, we would check whether the directory in question exists and ... either report an error and skip writing or write some default value if it doesn't. That would make the code much more robust. Another example is for instance setting the default systemd target (recent bug). What is a problem is that we'd sometimes need to know a bit more about the system/solution, e.g. which directory to check. Robust code makes also debugging easier and if path changes, we would find out the next time openQA runs the test. What's your opinion? Thx Lukas -- Lukas Ocilka, Systems Management (Yast) Team Leader SLE Department, SUSE Linux -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (1)
-
Lukas Ocilka