Is this negative? (or need for speed #2)

Avatar von Johannes Schlüter

As Pierre wrote before sometimes you need functions you usually would say "no, you’ll never need this, this task can be done with just one line PHP" but later you see "Okay, now I could use it".

We had such a situation a few days ago: Thorsten once complained that PHP has functions for everything but no is_negative(). We all in the office, including Pierre, knew that we don’t need such a function since everybody should be able to do this using the < or > operators and would neeevvveeeerrr demand it. A few weeks later, Thorsten and Pierre are working on a project where they are doing some complex calculations and Pierre recognizes the need for such a function. As a result I can present you our companies new friend: is_negative().

Avatar von Johannes Schlüter

Kommentare

4 Antworten zu „Is this negative? (or need for speed #2)“

  1. If you are doing so very complex applications you shouldn’t be using PHP if you want to do it fast, but instead write the backend in C as an extension.

    1. When you have the choice this is the way. When not… :)

  2. just make it a user defned function inside your database :-)

    nobody will know that way :-)

  3. The two main advantages are better support for multi-threaded environments (allocations don’t need to do any mutual exclusion locks) and after each request freeing the allocated memory blocks is much more efficient. As this is an underlying infra-structure change you will not notice it directly as the end-user.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert


Für das Handling unseres Newsletters nutzen wir den Dienst HubSpot. Mehr Informationen, insbesondere auch zu Deinem Widerrufsrecht, kannst Du jederzeit unserer Datenschutzerklärung entnehmen.