On 19 February 2013 16:46, Marcello Duarte <mdua...@inviqa.com> wrote:

> I find that more and more my developers have to learn ruby just to be able
> to work in our projects. We are one of the largest PHP shops in Europe and
> even the proprietary tools we are writing for DevOps stuff we are writing
> in Ruby. This small syntax arrangement would make it possible to write DSLs
> in PHP. The result is that I can have my PHP developers focusing on one
> language only and get the job done. The problem of the web is a bit more
> complex now, if you look on all you need to develop and deploy a large PHP
> application.
>

That is one of the choices you made for your projects. You looked at what
was available, and decided that Ruby was the best choice for the task at
hand.

While I agree it's unfortunate that your developers to have to waste their
time learning Ruby, when they could be doing more productive things, that
doesn't mean it's a good idea to try and retrofit some evil syntax into PHP
"just for you", no matter how large an organisation you are.

By the way, PHP is open source, feel free to make the parser do whatever
you want.



On 19 February 2013 16:40, Levi Morrison <morrison.l...@gmail.com> wrote:

> > Say we agree on the syntax above
> >> ($n) |$m| => $m * $n;
> > What happens when my one liner function needs to do one more operation
> > like checking the value of $n before multiplication?
>
> As I stated before suggesting the syntax: It's only meant for a single
> expression. It's purposefully NOT intended to cover multiple
> expressions.  In that case the current (verbose) syntax is better for
> all criteria I care about. Additionally, neither Python nor Dart
> allows multiple expressions in their short-syntax functions.
>

I prefer this. In this case (imho), a simplified syntax *should* go hand in
hand with simplified functionality. If PHP is to adopt such a syntax I'd
much prefer it takes the single expression approach. This does achieve the
goals of easy readability and maintenance because you know the expression
is bound by certain limitations.

Reply via email to