Am Donnerstag 19 Juni 2008 20:37:44 schrieb Hans Melis: > Hi Thomas, > > Thomas Koch wrote: > > Hi, > > > > I'm about to start implementing > > > > #010534: Command Line Runner to install/save Database Schemes > > > > and would like to get your feedback on the following suggestions: > > > > > > commandline tools in eZComponents > > ================================= > > > > - scripts are executable, without suffix (.php) and start > > with ezc-COMPID-, where COMPID specifies the component > > they belong to. The COMPID can be a shortcut like > > dbschema for DatabaseSchema. > > > > The minus signs are borrowed from git, but we can also > > agree on dropping them. > > I'm worried about the "without suffix" part. Could you please elaborate > on why you'd create scripts without the .php extension? > > Regards, > Hans
Hi Hans, thanks for your interest! As with many things in programming, I think it is a matter of taste to skip the ".php". :-) Some reasons that come to my mind: - By skipping the .php you indicate that you do not call them via #> php myscript.php but directly via #> myscript - Many commands that you call from the commandline are not compiled, but actually scripts in different languages: perl, python, shellscript. But only very few of this scripts are suffixed with .pl, .py of .sh - Take for example GIT: Many commands were initially shell scripts, but have been reimplemented or will be reimplemented in C, to make them faster. If you'd have suffixed them with .sh, you would need to keep the suffix, even for C programms. - The commandline is short: If you show the current dir in the prompt and have many options, then you easily span over two lines when entering a command. This is complicate to read and therefor I like short commands. - Even if you have tab completion, then there is still one keystroke more to complete the command with ".php". Do you have reasons, why you worry about the ".php"? What do you think about the rest of my proposal? Best regards, -- Thomas Koch, Software Developer http://www.koch.ro Young Media Concepts GmbH Sonnenstr. 4 CH-8280 Kreuzlingen Switzerland Tel +41 (0)71 / 508 24 86 Fax +41 (0)71 / 560 53 89 Mobile +49 (0)170 / 753 89 16 Web www.ymc.ch -- Components mailing list Components@lists.ez.no http://lists.ez.no/mailman/listinfo/components