<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 6 avr. 2017 à 16:12, Yaniv Kaul <<a href="mailto:ykaul@redhat.com" class="">ykaul@redhat.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Apr 6, 2017 at 4:49 PM, Fabrice Bacchella <span dir="ltr" class=""><<a href="mailto:fabrice.bacchella@orange.fr" target="_blank" class="">fabrice.bacchella@orange.fr</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><span class="gmail-"><br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 6 avr. 2017 à 15:32, Yaniv Kaul <<a href="mailto:ykaul@redhat.com" target="_blank" class="">ykaul@redhat.com</a>> a écrit :</div><br class="gmail-m_-6007873883923554742Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Apr 6, 2017 at 3:58 PM, Fabrice Bacchella <span dir="ltr" class=""><<a href="mailto:fabrice.bacchella@orange.fr" target="_blank" class="">fabrice.bacchella@orange.fr</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Yes I'm starting to understand that thinking about migrating code is pointless.<div class=""><br class=""></div><div class="">The old skd3 code is just good to be thrown away. There is no hope thinking about "migrating code". And as it's just a thin layer around REST calls, it's up to us to try to make something usable around that. So I expect a lot of sweat and tears to adapt my existing code.</div></div></blockquote><div class=""><br class=""></div><div class="">Well, yes and no. Yes, it's not smooth, but once you 'get' the idea behind the v4 API philosophy, it's quite easy to write to (at least in Python).</div></div></div></div></div></blockquote><br class=""></div></span><div class="">An example of code that I'm unhappy to write and that a good sdk should have provided:</div><div class=""><br class=""></div><div class="">searchfilter = "%s=%s" % (type, value)</div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">vm </span><span class="gmail-m_-6007873883923554742pl-k" style="box-sizing:border-box;color:rgb(167,29,93);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">=</span><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""> vms_service.list(</span><span class="gmail-m_-6007873883923554742pl-v" style="box-sizing:border-box;color:rgb(237,106,67);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">search</span><span class="gmail-m_-6007873883923554742pl-k" style="box-sizing:border-box;color:rgb(167,29,93);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">=</span> <wbr class="">searchfilter<span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">)[</span><span class="gmail-m_-6007873883923554742pl-c1" style="box-sizing:border-box;color:rgb(0,134,179);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">0</span><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">]</span></div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><br class=""></span></div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">instead of :</span></div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">vms_service.list(</span><span class="gmail-m_-6007873883923554742pl-v" style="box-sizing:border-box;color:rgb(237,106,67);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">search</span><span class="gmail-m_-6007873883923554742pl-k" style="box-sizing:border-box;color:rgb(167,29,93);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">=</span> {<wbr class="">type: value}<span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">)[</span><span class="gmail-m_-6007873883923554742pl-c1" style="box-sizing:border-box;color:rgb(0,134,179);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap">0</span><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">]</span></div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class=""><br class=""></span></div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">or even better:</span></div><div class=""><span style="color:rgb(36,41,46);font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">vms_service.get(**{type: value})</span></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Yes, I see what you mean. 100% more LoC are currently needed vs. your idea ;-)</div></div></div></div></div></blockquote><br class=""></div><div>It's not about the number of LoC, it's about legibility, having code that says what's it's doing and doing what it says.</div></body></html>