FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » error message I don understand
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Nasty language semantics [message #174935 is a reply to message #174934] Mon, 18 July 2011 19:29 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
August Karlstrom wrote:

> On 2011-07-18 17:55, Thomas 'PointedEars' Lahn wrote:
>> August Karlstrom wrote:
>>> Don't be silly. There are several programming languages in which `='
>>> denote (surprise) equality.
>> And I have found all programs written in any of those programming
>> languages to be more difficult to maintain than the rest. One such
>> language is VBScript (which is particularly bad designed in other
>> respects as well).
>
> That's because they have been badly designed in other respects as you
> mention.

NAK.

>> I would always consider it a result of bad language design for a
>> (built-in) operator to have such very different meanings.
>
> Agreed. The assignment symbol should ideally be a left arrow

NAK. As was said before, this is programming, not math.

> but as we all know it is not available on a standard keyboard or in the
> ASCII character set. I think `:=' is a reasonable alternative.

So are `=', `==' and `===', if only for keeping the well-established C
tradition (which makes it easier to learn yet another programming language,
mind you).

But there is another option: a compiler could disallow or warn about
assignment in conditional expressions if it was not obvious that this was
intended (as indicated by another pair of parentheses around the
assignment). AFAIK, the Java compiler (javac) and the Mozilla JavaScript
Validator include a switch to generate a warning. PHP's JIT-compiler SHOULD
also do this with the E_WARNING or E_COMPILE_WARNING bits set (but PHP
5.3.3-7+squeeze3 with Suhosin-Patch (cli) does not.)


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ouion Movement, Roun Time (Floating Point Time)
Next Topic: [MEMCACHED] Is there a way to get the expiration of a key?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 20:26:02 GMT 2024

Total time taken to generate the page: 0.05043 seconds