<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 1, 2015 at 9:38 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le mercredi 01 avril 2015 17:24:47, Sean Gillies a écrit :<br>
> Hi all,<br>
><br>
> I'm not entirely clear on the signatures of the new functions. Are we<br>
> considering new functions that would be called with a single string<br>
> argument like this?<br>
><br>
>   ogr2ogr('-of "ESRI Shapefile" example.shp example.json')<br>
><br>
> From my perspective this would be sort of a disaster. Instead of using<br>
> features of our programming languages to handle function arguments (good),<br>
> we'd be formatting strings (bad). It's much better to have this:<br>
><br>
>   ogr2ogr('example.json', 'example.shp', of='ESRI Shapefile')<br>
><br>
> Why? Your compiler can then catch trivial errors at compile time if you're<br>
> using a statically typed language. Your Python linter (for example) can<br>
> warn you about whether you're calling the function properly or not if<br>
> you're using a dynamic language. Not to mention that there are many<br>
> different ways to generate strings in programming languages. Python has<br>
> some fast ones and some slow ones. I'm concerned that introducing functions<br>
> with a single string argument, while a shortcut now, increases the number<br>
> of dumb string munging questions and cost of support over time.<br>
<br>
</span>Sean,<br>
<br>
The latest orientation while discuting with Robert & Faza would drop the<br>
single string approach in favor of function arguments, with a minimal list of<br>
arguments for the required arguments, and put the others in a dedicated option<br>
structure.<br>
<br>
See:<br>
<a href="https://github.com/fazam/gdal/commit/a0979a621b0041d25a9d628430b5f1dd2c967fb5#commitcomment-10173885" target="_blank">https://github.com/fazam/gdal/commit/a0979a621b0041d25a9d628430b5f1dd2c967fb5#commitcomment-10173885</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Even<br></font></span></blockquote><div><br></div><div>Great! <img src="cid:ezweb_ne_jp.B97@goomoji.gmail" goomoji="ezweb_ne_jp.B97" style="margin: 0px 0.2ex; vertical-align: middle;"><img src="cid:ezweb_ne_jp.B97@goomoji.gmail" goomoji="ezweb_ne_jp.B97" style="margin: 0px 0.2ex; vertical-align: middle;"></div><div> </div></div></div></div>