« first day (1822 days earlier)      last day (3129 days later) » 

2:03 PM
posted on October 12, 2015 by nlecointre

/* by lufutu */

 
@NikiC could you please stop adding line breaks inside the function decl lines? It's awkward to read…
 
Yo
 
@Feeds ... wat
That's... not really funny
 
Abe
2:18 PM
that's... not funny at all
 
We need our own coding love. Funny and without a gazillion tracking pixels
 
All in favor of removing The coding love from the feeds because it's not fucking funny anymore, star
12
 
Wow, tough crowd today
 
the load time on the gifs is painful
 
2:22 PM
@MadaraUchiha We need a proper poll, because it's hard to find out who doesn't agree now
 
@MadaraUchiha yes .. it has become annoying
 
@PeeHaa The problem with these sites is that they start well intentioned to be funny and nice, and then the owners get greedy and add a crapton of junk and ads, and when the original contributors leave because it became crap, they have to lower quality to maintain content output
 
There's just a bunch of bell-ends adding stuff now
 
@PeeHaa if someone disagrees they can put up their own star thing
 
@Danack hello
 
2:25 PM
and then we can lynch them
 
Anonymous
What is a good place to store your .sql files, in the classical MCV directory structure?
 
.sql files don't belong in classical mvc structure
so don't store them in mvc directories ;)
 
Anonymous
I know but, if you have an app that requires database, where do you store the database?
 
in a migration :)
 
Anonymous
Hm, good point.
 
Anonymous
2:30 PM
I guess migration goes in the src folder.
 
@bwoebi No. Could you please stop removing newlines anywhere if doing so makes the line longer than 100 chars again?
 
@MadaraUchiha Huh? I didn't ask for the reason? :P
 
@samayo github.com/robmorgan/phinx is good stuff
 
@PeeHaa And yet I answered nonetheless. You're welcome.
 
:D
 
2:31 PM
flies away
 
Anonymous
@shadowhand :/
 
All in favour of keeping The coding love in the feeds because... it's fine, just leave it... star
 
@salathe Ladies and Gentlemen, I give you Room 11 Star Wars
 
Anonymous
All in favour of getting rid (yum yum) of the coding love in the feeds .. star
 
All in favour of getting rid of Laravel, star
36
 
2:34 PM
Haha
 
Honk if you like cookies.
 
All in favor of a moderator unstarring all "All in favor of…" starred messages… star.
 
(leave Laravel one though) ;)
 
boo hisss Ψ (that's a pitchfork)
 
2:38 PM
:D
 
heh
 
@LeviMorrison room owners can do that
(so, you)
 
boo
 
Who cheated by pinning it?
 
@NikiC ...
 
2:40 PM
P.S. E_TOO_MANY_STARS
 
(I meant room owners, not moderators, sorry!)
 
Please, can we have the decls in one line… I don't care about long ifs… but single exprs (like decls) should be one-liners in any case
 
For enums, do you prefer splenum or custom implementation ( abstraction of the class etc..) ?
 
@MenelaosKotsollaris I prefer wiki.php.net/rfc/enum.
 
@bwoebi Nope. I'm open to discuss exact formatting though
@bwoebi E.g. some programming languages prefer to align parameters to the opening (. I'm not a personal fan of that, but if that's preferred...
 
2:44 PM
Gah, I hate not being able to delete my own messages. :'(
 
@LeviMorrison
> enum RenewalAction {
Deny,
Approve
}
Should that be "Deny", and "Approve"
Same things that constants can be?
 
No, they are not strings.
 
Why not? Can enforce type there too
 
Strings don't strongly type-check, which is one of the valuable points of enums.
 
Well, they don't yet, right?
 
2:47 PM
But what's the point of using this implementation, since you still have to declare a class, right?
 
"Approve" instanceof RenewalAction // false
 
You have to declare final class RenewalAction
 
@MenelaosKotsollaris No, you don't.
 
what about bool $approved = null
 
@shadowhand In weak mode 1 would pass a boolean check.
 
2:48 PM
fair enough
 
Excuse my low level, but (atleast) in PHPStorm the `enum RenewalAction {Approve, Deny}`
will result to error
 
@MenelaosKotsollaris enum isn't a part of PHP, yet.
 
@MenelaosKotsollaris of course, enum is still on discussion phase
 
Good morning
 
Anonymous
\o
 
2:51 PM
@MenelaosKotsollaris It hasn't passed yet :D
 
So how can you use it? :P
 
Run unverified and nonstandard PHP build :D
 
@MenelaosKotsollaris Levi is working on adding it in php
 
@NikiC Well, what's the point of the line break when they're aligned back?
 
Oh that's some nasty things you do guys.. I will stick with the super ugly abstraction until Levi implements this much needed feature
 
2:54 PM
def do_something_with(param, and_another_param,
                      and_more_params, and_even_more):
@bwoebi ^-- Typical Python or Rust style declaration split
 
I'm a fan of single-line function decls myself.
 
Imho it gets very awkward if the function name is long and every parameter ends up on a separate style
 
@LeviMorrison are you going to try getting enum in to 7.1?
 
@Orangepill Possibly, yes.
 
sweet
union types?
 
2:55 PM
@NikiC ^-- eww, why so many params
 
Anonymous
enum as in python enum? @LeviMorrison
 
@samayo Not really, no.
 
@nikita2206 I mean in the aligned style
If people go for a completely separate parameter line they generally don't put parameters on individual lines
 
@nikita2206 $a, $b, $c, $d make it look really silly, use some types and longer var names
 
2:58 PM
Can I somehow vote for the enum addition ? Coming from Java so it's pretty hard for me to not have enums
 
@NikiC well no, a lot of people actually write like that and this annoys me
@marcio I could use some AbstractFactoryManagerBeanSingleton but I'm too lazy for it :/
 
@nikita2206 this 'issue' will certainly come up on callable types
@MenelaosKotsollaris you need a php.net account and karma to vote. It's much easier to bug somebody with voting rights and express yourself on the mailing list.
 
i don't see how enums can be met with much friction... its a sorely needed addition to the language.... but you never know with internals.I guess the actual implementation of enums would be the only thing up for debate.
 
for the love of god, give them something inconsequential to bikeshed over so everyone can feel involved.. then trim it off at the end as "future scope"
 
3:04 PM
@PaulCrovella like serialization...
 
I can't believe I just declared a class abstract class DaysOfWeekEnum LMAO
 
@NikiC well, it looks better, but I'd honestly prefer them to be proper one-liners
No problem with splitting ifs (well even I do on particularly long lines)
 
3:19 PM
I'm probably the only one here enthusiastic with Red, anyway red-lang.org/2015/06/054-new-datatypes-exceptions-and-set.html
 
first i've heard of it
 
Life's too short for a new programming language
3
 
@marcio damn commie
 
Anonymous
these days, everyone and their mother is making a new programming language
 
@PeeHaa lol
 
3:27 PM
@NikiC by the way… the worst is when coder added line breaks and then in presentation it looks like this
somecode on a loooooong line(foo ||
bar ||
          biz baz,
        fezz fuzz)
 
I propose the language "cpp"... It follows the C++ standard exactly, except that its name is search engine friendly.
 
Can't we just stick with 1 programming language and finally get a life? People in 200 years will laugh at programmers so bad
 
(note the auto-inserted line break between foo and bar @NikiC)
 
Circle of Death http://t.co/zH31t6JaBm
 
@MenelaosKotsollaris was that 1 programming language invented already? They won't laugh in 200 years if the problem is not solved now ;)
 
3:30 PM
@MenelaosKotsollaris why reinvent the perfect language when Haskell already exists?
 
@Andrea so, why's Haskell perfect?
 
@bwoebi so many reasons
 
because perfect is arbitrary, so may as well just pick one and go with it
 
And this is why we have INTERCAL.
 
referential transparency, laziness, functional, expressive type system, type inference, a massive library of useful higher-order functions, typeclasses...
 
3:33 PM
... and an awful syntax that looks backwards.
 
ADTs and currying
@marcio it's not awful, it's a very expressive syntax. It's not like C's syntax, but I don't think that'd be the best choice for Haskell
I mean you could ALGOLize it but I don't think programming in the resulting syntax would be much fun
 
@Andrea well, IMMO if a language is not homoiconic it's not perfect enough to be The language.
 
@marcio homoiconicity isn't all it's trumped up to be
it is primarily useful for macros and in some languages there's much less need for those
 
user895378
I've started to care a lot less about ideas like theoretical language perfection since I realized VCs literally give zero fucks about the technologies in use. You can get millions of dollars in funding on the back of terrible outdated php web frameworks and the like.
 
user895378
The only real question is: does it work?
 
user895378
3:42 PM
Okay great. Here, take money.
 
IDK, I still think red is a better candidate than haskell. But who cares, in 2213 everything will be javascript.
 
@rdlowrey "I.. I didn't answer you yet."
 
@rdlowrey But then there's your moral compass fighting against that - where it's not all about the money
 
user895378
@Jimbo wait. what? It's not?
 
:-)
O/T I'm reading the Amp docs right now, liking what I see so far
 
user895378
3:44 PM
oh cool. I'm sure there are tons of holes, but thanks
 
@rdlowrey it works but doesn't really translate in any groundbreaking evolution others will build upon later, that's the point of the endless discussion.
 
@rdlowrey What's VC standing for? "version control" makes no sense in here…?
 
@rdlowrey A better question: does it work better than alternatives? Does it let you get things done more effectively? Can it help you write better code?
 
@rdlowrey (ps can you grant me access to the aerys - I literally want to download it right this sec and have a play with that and amp)
 
@bwoebi don't know what I need to do with my money money
 
3:48 PM
@bwoebi Venture Capitalist
 
ah
@rdlowrey well, right. But your clients may care… at least depending on your product.
 
I'd read the AMP docs but they might change in a few weeks time :P
 
Don't know… but try to sell a PHP 4 based project today…
 
@bwoebi You don't sell a php anything
 
@Andrea btw, I'm doing some little research on how to have macros on languages very far from homoiconicity. It seems I'm failing... but I added you to the repository in case you'd like to take a look and give some opinion.
 
3:51 PM
@Fabor Amp hasn't changed for a while actually. and as it's now v1.0.x, you should be safe^^
 
@bwoebi Way to jinx yourself. Now you've just ensured a major spec change.
 
@PeeHaa right, you sell it so that your customers will discourage everyone from buying it because they can't use it
@Ghedipunk mhm?
 
You said "you should be safe." You've just cursed the entire project.
4
 
@bwoebi Said customers don't buy the application.
 
@PeeHaa confused what you mean?
And @rdlowrey I'm waiting for the list of remaining things to do on Aerys
 
3:54 PM
Think any "customers" of FB would have cared what it runs on?
 
@rdlowrey If anything VCs should want people to avoid using new exciting technologies. Stuff that's been used for years is way less likely to be abandoned by it's maintainers, or to have horrible surprises when you try to use it at scale.
 
@Danack Yet they realise it's that exact sort of thinking that leads to legacy
 
@PeeHaa eih… I'm talking about your customers, not the customers of your customers…
 
"Let's use Symfony 1, it's been around 100 years, not maintained" - obviously you don't want to use brand new, but you want to use something that's got the new current uptake
 
@bwoebi VC are not really customers in the traditional sense ;)
 
3:55 PM
@Jimbo I was thinking more any of the new graph based data stores....they're all awesome, until the guy writing it gets bored and then stops fixing bugs.
 
Ah, infrastructure stuff, not just libs then
 
Everybody knows that you should all be using java for anything serious...
 
@Jimbo is your and andrea's talks going up anywhere?
 
Circle of Death http://t.co/zH31t6JaBm
 
@Orangepill Slides are up, but they're not doing the videos for a month at least
 
3:56 PM
@Danack morning
 
oh okay.
 
what did you want to talk about?
 
@marcio isn't the general approach to treat things as AST nodes and not text?
that seems to be the "hygienic" way
or you can just say fuck it and use cpp
 
@shadowhand So I noticed you've been writing about Auryn a bit. But unless I've missed it, in none of your articles yet, you haven't mentioned using delegates. Is that because you don't like them, or just because you haven't discovered how awesome they are?
 
@Andrea but how can you have AST for something you don't know yet? :/
 
3:58 PM
@marcio ?
 
@Danack i use them in my projects just haven't found a strong value in them in the things i am posting about
 
In particular - all of the stuff in this article were the config for PDO is setup is done by hand, and has to be invoked each time the application is run. Using a delegate would allow for that initialisation only to be done when the PDO object is requested.
 
@Andrea I mean, you end up cutting off a lot of freedom. Macros should have an entry point like this and can only match stuff like that.
(like cpp does)
 
@Danack i don't follow... calling define only sets default parameters, it doesn't actually create an instance
 
posted on October 12, 2015 by nlecointre

/* by Dallon */

 
4:01 PM
generally speaking, if was loading some values from a configuration store, i would probably be using a delegate
but i don't see value in creating delegate classes just for the sake of creating them
 
@marcio you have a macro that looks like a function call. The macro definition specifies how each parameter should be parsed (expression, statement, block etc.) and then the macro substitutes placeholders for those AST nodes
like CPP but more sophisticated because it's not as error-prone as text
 
except if you need to do something like setting the errmode on a PDO object.... since you can't do that in the constructor
 
@shadowhand Except that it means that all of the code that configures anything has to be run, even if that object is not going to be used. e.g. from that article, PDO, Oauth and Fractal all have their parameters defined even though they might not be used. With delegates all you only have to set up the callable to call, which is an incredibly cheap operation as the function name is just a string. And the other nice benefit is that you can make all of your config be serializable.
 
@Andrea that's what I'm talking: "you have a macro that looks like a function call" can be very limiting.
 
@Danack that's a good point, but i'm not entirely sure that performance is a strong argument, since setting 30 array values is trivial
i do understand your point here though, and i'll definitely consider writing about delegates in the future
 
4:09 PM
yeah....it's the function call overhead that starts to get annoying. Anyway - this is how I configure Auryn. It's completely serializable and has no function call overhead.
5
Which is nice.
It also make it easy for code to be able to add stuff to the DIC config, without actually having to pass the injector around.
 
cool thanks for sharing!
 
np - I would write this myself in a blog, but I'm too lazy.
(Actually too busy doing other things, but lazy is easier to explain.)
 
too busy convincing others to write it for you
 
\o/
After re-reading some of my old 'blog' posts, doing it one on one in a chat room is probably more persuading anyway....
 
user895378
@bwoebi sorry: venture capitalists
 
4:19 PM
@rdlowrey no, that has a FCKR acronym
 
@marcio yes, but I don't think it's a good idea to go beyond that, generally speaking
it should be obvious what's a macro and what's not
otherwise things get... scary
I mean yes you can do super-cool stuff with arbitrary macros but it's also terrifying
so!
on a different topic, I was just thinking I should add immediate property initialisers (tentative title) to PHP
think the literal syntax for structs in C
thus:
 
@Andrea oh, there you have a point then. I was thinking more on languages capable to be extended in any dramatic way needed, and that's scary indeed.
(sorry, combo breaker)
 
json_encode(new StdClass {
    ->type = "msg",
    ->msg = "Hello, chatroom!",
});
@marcio it's a pretty cool idea and some languages have done it
very powerful
 
looks funny though
 
but it's one of those features that requires faith in programmers, so it's not a good choice for languages where you don't want to do that
 
4:26 PM
@Andrea can you point any language where it was done nicely in your opinion?
 
@marcio you mean without arbitrary syntax, or you mean with?
 
yes, arbitrary syntax
 
@Andrea how would you expand this?
Like, this? :D (function () { $o = new stdClass; $o->type = "msg; ... return $o; })();
 
@nikita2206 it'd be like $obj = new StdClass; $obj->type = "msg"; $obj->msg = "Hello, chatroom!"; json_encode($obj);
also would work for indexing with [1] instead of ->one
 
4:28 PM
anyway gtg ttyal
 
json_encode((object) [
    'type' => "msg",
    'msg' => "Hello, chatroom!",
]);
 
user2209033
Hi, Just got an answer on the post,
with the following code, but I think there is errors.

Can anyone see them?

function getContent() {
var a = document.getElementsByClassName('your-class');
var b = "";
for (var i = 0; i < a.length; i++) {
b+=a[i].innerHTML;
}
return b;
}
 
@Andrea why would it be much better than chat.stackoverflow.com/transcript/message/26236559#26236559 ?
 
or an anonymous class
 
@marcio the question was: if you have statements in your macro and this macro is used inside of expression - how would that work
 
4:32 PM
@nikita2206 I don't really get your question.
 
@marcio look at how Andrea expanded json_encode(new StdClass {...});
It adds new statements before json_encode call
 
> Apparmor also provides functionality for applications to change to a different hat.
 
@nikita2206 she didn't mean to literally expand it, she was just illustrating how it would work underneath.
 
Ah ok
 
Still, you don't get a lot more than anon classes or (object) casting :P
 
4:37 PM
@rdlowrey I'd seriously appreciate some todo on Aerys… I'm a bit bored here and would like to work on it…
Also, I need you some time to discuss APIs around server push
 
@bwoebi I would love a full blown queueing system example :-)
 
says the guy who just made a queue in postgres
 
Hence I would love it :D
 
@PeeHaa I think @rdlowrey is anyway doing a rabbitmq protocol implementation in PHP based on Amp…
 
Ah that would be tits
 
4:40 PM
if you could be bothered to set up rabbit to begin with
 
@PaulCrovella It's a pain?
 
Or is this a snide reamrk :P
 
all snark, all the time
 
:)
 
4:50 PM
@rdlowrey I'm reminded of a quote from Space Balls. Perhaps you know the one?
 
@marcio useful in a wider variety of cases
okay, you can use (array) to make a stdClass
but not to make some other kind of object
 
so your real example should have been:
new Event { ->type = 'message', ->context = ['content' => 'Hello, chat room!'] }
 
yeah
the great thing is you can nest this
 
new class extends Event { public $type = 'message'; public $context = ['content' => 'Hello, chat room!'; }
 
@PaulCrovella you could do this with anonymous classes, but it's verbose, and doesn't produce quite the same thing
also can't do this:
 
5:02 PM
yeah, not quite, but pretty close
 
new Event {
    ->type = 'message',
    ->context = new EventContext {
        ->content = 'Hello, chat room!';
    }
}
 
@PaulCrovella it looks fine except that you are using extends for something that shouldn't be extends.
 
new List {
    [0] = 1,
    [1] = 2,
    [2] = 3,
    [3] = 4
}
 
wut, drop the [ ]
 
(perhaps a bit contrived, but demonstrates that indexing would also work)
 
5:05 PM
@Andrea something about those arrows makes me uneasy like an unmatched brace]
 
@PaulCrovella it's nicer than the alternatives
it works just like C and C++ struct initialisers do
@marcio I like that it makes it obvious what it's doing
 
I have a simple class and then I have a simple get method like this one: public function getMeanCost(){return meanCost;}.. I get an Undefined Constant warning.. Is this due to PHP interpretation? Can we somehow avoid it?
 
it also means variable properties and such work
 
not saying I'm favorable to this, but why not drop the -> and [] and use { thing : expression } consistently with index and properties?
 
new ContrivedExample {
    ->{$foo} = $bar
}
@marcio they're not the same, and indexes can be strings or even objects
also, what if you want to use a constant index?
or a variable property like above?
 
5:09 PM
huu
 
it's pretty neat because it's completely familiar and would support everything you could do with normal property and index assignment
 
just realized it can also be { ->{expression} = expression } the same way [ 1+1 => x ]
 
yeah
or even { [1 + 1] = $x } if it has indexing
 
@MenelaosKotsollaris return $this->meanCost;
 
Thanks Paul. I had eradicated the this habit on getters but I will rejuvenate it.
 
5:16 PM
IDK, the real benefits only start to show with nested composition, because the current new Event('message', ['content'=>'Hello...']); is not that bad.
 
boo
 
oh yeah, in most cases you can just use the constructor if it has one, or a fluent interface
still, there's some value to it
with SplObjectStorage, for example!
 
this could end up being interpreted as a glorified way to bypass setters upon initialization :P
 
ah, no, not at all
use anonymous classes for that cackles
 
it could make more sense if we had decent property accessors first.
 
5:22 PM
$apple = new Fruit('apple');
$pear = new Fruit('pear');
$grape = new Fruit('grape');
$fruitImages = new SplObjectStorage {
    [$apple] = 'images/apple.jpeg',
    [$pear] = 'images/pear.jpeg',
    [$grape] = 'images/grape.jpeg',
};
 
@marcio it's been long enough since the last one failed... maybe time to twist internals up again
 
this is something you can't do currently
SplObjectStorage doesn't have a handy way to initialise it
 
almost every time I go to use SplObjectStorage I end up using an array keyed on the object hash instead...
 
@PaulCrovella why?
 
@Andrea Would be actually enough to be able to cast arrays to a class (not only stdclass)
 
5:28 PM
@bwoebi that sounds messy
 
typically end up with one thing or another that using the array makes easier without making anything else worse
 
@PaulCrovella sounds like me trying to use the SplDoublyLinkedList every time
(in the sense that I end up using some other non SPL implementation)
 
I've not once tried that one.
 
Spl could be better than it is
 
@bwoebi can it be made with internal classes too?
 
5:31 PM
would be nice if we aliased it to use namespaces
make Spl\DoublyLinkedList an alias of SplDoublyLinkedList
 
@marcio well, those with properties, sure
It'd just try to set them with private scope after init
 
silly question, should these casting operations allow you to init protected properties?
 
@marcio I sure hope not
 
then we should really have property accessors in place before discussing these other things.
 
@marcio after all, we're not calling a ctor, so yeah, they should.
 
5:36 PM
why shouldn't it call a ctor?
this sounds like an awful feature if it lets you bypass that
 
well… hmm
yea, you're right
then public scope is fine
 
what I would like is something like:
 
well, there it is, __construct is a total show stopper
 
class List
{
    ...
    public static function __castFrom($value) {
        $this->items = $value;
    }
}

$list = (List)[1, 2, 3];
 
@PaulCrovella maybe that's a good idea, but not the exact same RFC, it has to be simpler than what @NikiC proposed.
 
5:38 PM
though that begs the question of why you're not just using the constructor, and that's a good question
 
@Andrea right.
 
it would've been useful for autoboxing, but that's kinda moot since we have scalar type hints now
@marcio we don't need property accessors for {} syntax, use a fluent interface
new Event->setType('message')->setContext(new EventContext('Hello, chat room!'))
 
@Andrea i don't like that because it implies mutability
it also implies you can do this: $list = new List; $list([1, 2, 3]); but we already have __invoke.
 
@shadowhand does it?
 
it does to me...
 
5:43 PM
I don't see why it would
you can't do int(1)
 
i guess i really don't understand the syntax
what benefit does (List)[1, 2, 3] have over new List([1,2,3]) other than eliminating new?
 
(which is probably why we won't have that feature)
 
to me __castFrom is weird because: a) it's static but you're using $this, and b) it feels a lot like __invoke
 
@marcio any initial thoughts on what you'd cut out or change? I'm flipping through it again right now and not much jumps out
 
@shadowhand Nothing as far as I can tell.
 
5:46 PM
it gives the impression of 'casting', like $foo = (int)"1";
 
To me casting to an object type offers no benefits over a static constructor, like List::fromArray([1, 2, 3])
 
okay then it would make sense for that syntax shortcut to be expanded to new X(value)
but having a new magic method __castFrom makes no sense to me
 
@Trowski I agree with that.
 
@shadowhand none that I can see, as I said
 
The only thing I need is to have custom casting behavior the other way around like: (array) $list;
 
5:49 PM
@marcio now that i agree with
 
@marcio that might be a good idea but seems dangerous
 
i'm sick of writing toArray methods.
 
@marcio So basically expanding upon __toString() to have methods like __toArray(), etc.
 
if only because you can't tell, at-a-glance, what the array will be (default behaviour or overridden)
 
@Trowski yes, just that.
 
5:50 PM
using an explicit ->toArray() can already be done
 
@Andrea you can't with strings either...
 
That gets asked for a lot... but usually I fail to see the need for that magic to be built-in.
 
@shadowhand there's no default implementation of __toString()
 
i assume there wouldn't be for __toArray either :)
 
@shadowhand There already is one...
 
5:50 PM
no, (array) already exists
 
@Andrea but you cant pass $list into a function that has func(array $a) signature
 
@marcio indeed you can't, but I'm not sure if allowing an implicit conversion there is necessarily a good thing
 
IMO, (array) $object doesn't really have much benefit over $object->toArray().
 
that's a fair point
 
@Andrea it always bothered me that we can have (string) $obj but not have automatic casting on a function(string $str).
 
5:52 PM
@marcio we do have automatic casting
but not in strict mode (thank god)
try it!
$ php -r 'function foo(string $bar) { echo "I got $bar!", PHP_EOL; } foo(new class { public function __toString() { return self::class; } });'
I got class@anonymousCommand line code0x10ac75098!
 
yeah, that's annoying
It leads to exception checking in the weirdest places…
 
@Andrea I use strict mode almost everywhere. Why can't we have it on strict mode?
 
@marcio it's not a lossless conversion
 
How is automatic casting on a function call worse than automatic casting on concatenation?
 
@Andrea even if you subscribe to __toString?
 
5:57 PM
@marcio __toString is rarely lossless
a string and an object are not equivalent
we allow int->float because they're both numeric types and you lose (almost, >2^53 is an issue) no information, there's no change in meaning
 
the point of __toString is not to be lossless, the point is to say "I don't care if it's lossless, take this string it's good enough"
 
it's still better to be explicit in your intent
if you want it to cast, say so
 
IMMO, that's too conservative, you already said so when you implemented __toString.
 

« first day (1822 days earlier)      last day (3129 days later) »