On Thu, Apr 30, 2015 at 12:06 AM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:

> Hi Walter,
>
> On Thu, Apr 30, 2015 at 3:54 PM, Walter Parker <walt...@gmail.com> wrote:
>
>> You didn't answer the question: why should we care? Is there enough of
>> user base now to care? IOT might be able to run PHP, but how many actually
>> do? And of the ones that do, is automatically half fixing the code that bad
>> programmers might write for the last remaining 32 bit platforms a good use
>> of our time?
>>
>>
> I don't suppose anyone objects view that IoT will be a big market in near
> future.
> The main problem is not only code IoT developers write, but libraries used
> by them.
> If you know embedded devices, they care every single dollar costs. I don't
> see
> any reason that they use 64 bit CPUs while 32 bit CPU is enough.
>
> We may say using PHP and it's library is not safe, so don't use it.
> I just don't like to say or anyone else say this.
>
>
>> I don't see the numeric type as fixing any of these problems...
>>
>
> Which is easier to advocate?
>  - Use "string" type hints for record ID/etc and validate value by
> yourself.
>  - Use "numeric" type hints for record ID/etc.
> or even
>  - Use _weak_ mode "int" type hints (If it's relaxed)
>
> Regards,
>
> --
> Yasuo Ohgaki
> yohg...@ohgaki.net
>
>
I didn't says there wouldn't be big. I think they could be giant. What I
said is that I think you are trying to solve a 1% edge problem that might
not be much of an issue when the are bigger problems and better solutions.

In an IOT where cost matter, using PHP is usually a poor design decision.
There are better languages. If costs matter, use the proper language for
this sort of environment (or use PHP correctly). I do not accept the
argument that we must use 32 bit CPUs and 32 bit PHP, but then go and use a
64 bit DB. Use a 32 bit DB, or restrict your self to 31 bit keys (or just
use strings). How many IOT systems use a language like PHP and not some
simplified system (picoBasic, microJava). I've worked on embedded systems.
When I worked with real world, cost sensitive systems, we used C, or a
stripped down language. Not a language like PHP. Note, Android uses Davik
(Java) or C/C++. iOS uses Objective-C, Windows Phone uses C#. All compiled
languages with mostly static type systems that map to the type systems of
the DB using a richer set of native types. PHP is not in a race to spread
to any and all platforms, regardless of suitability. Let's use the right
tools for the job.

You do know that you that can control the schema of the DB. Have you
suggested to SQLite that they make the default schemas PHP safe (instead of
making PHP SQLite safe). Why should PHP dance to SQLite's tune rather than
SQLite dancing to PHP's tune? I know this is a PHP mailing list, but PHP is
not the end all, be all of programming languages and anybody programming
IOT devices should know that. I'd prefer not to mess up PHP for its primary
market while trying to fix side issues for secondary targets.

I thing using string type hints are are easier to advocate (and I think
they are the correct type if you need to be 32/64 indepentent).
Otherwise, a numeric type doesn't fix the problem. It hides it. It is a
short term that doesn't scale properly.

Use int hints correctly. There are still new, if we start using the
incorrectly, things will only get worse.


Good night.


-- 
The greatest dangers to liberty lurk in insidious encroachment by men of
zeal, well-meaning but without understanding.   -- Justice Louis D. Brandeis

Reply via email to