« first day (1287 days earlier)      last day (3887 days later) » 

10:02
For CI RFC, I'm deciding between "revert asap" and "revert after a week" - the other two seem more work for RM than necessary ...
revert after a week just seems so .... long
grates on me when I hear programmers talking about using “constructor injection” or “setter injection”. Sorry, but what you’re talking about is “passing parameters”, or if you prefer “passing arguments”.
And you're a retard - DI is not passing scalar values about...
It smells like a rant, just like how someone gets annoyed if they hear "in case of" and "if" being used interchangeably :)
Just think about it for a moment, what exactly does “injection” mean? It’s a finely-controlled way to force a substance into some other material.
Well yeah. So what's the rant about :|
I don't think I can muster enough give-a-fuck for this ...
The term DI definitely has a place; otherwise you can call anything "programming 101"
10:14
Can I prepare two statement simultaneously?
Exactly... if it was "programming 101" then all the indians newbies would be using it
With the same PDO instance?
lol
@SecondRikudo You can prepare two statements separately, yes.
I wouldn't say simultaneous though.
how do you to strikes again?
dash dash dash
10:15
Noice
I feel like writing a blog post "Why Dependency Injection is not programming 101"... when working with medium to lage codebases unless your bootstrap is just a complete mess it's not simple to inject everything in the right place
Please people if I ever become like this http://chrisoldwood.blogspot.co.uk/2014/04/terminology-overdose.html put me to rest. Now git off my lawn
LOL, I can't retweet that... :D
@Jimbo so if your bootstrap looks good, it's hard to inject everything in the right place?
My mind doesn't handle double negatives very well ;-)
It wouldn't be inaccurate to assume that I couldn't exactly not say that it is or isn't almost partially incorrect -- Pinocchio.
@Jack If you have a medium to large codebase, it isn't simple to just inject everything in the right place. You'll need a DiC for that, so it's not programming 101
It's not just the concept right? It's how to employ it and use it properly
I would argue that's not that simple
@PeeHaa lol, he has a point though
10:22
can only have self @DaveRandom
@Jimbo What does inject in the right place mean?
that's it , I am starting to use twitter again
@SecondRikudo imma twat that!
@PeeHaa Go ahead
10:24
@JoeWatkins I figured that might be the case, being that static is not supported for args. Why is that exactly? I made a mental wild stab in the dark that the class entry to check against is stored at compile time and cannot be altered at run time for some reason, but I couldn't come up with a good reason why it couldn't be fetched dynamically during run time checks
@tereško Don't do it.
compiler error , unsupported at parser... but we don't want to work around it ... look at this ...
public static function bar() : static {
ARGHHH
32 mins ago, by Jack
Hmm, public static function foo(): static { } =D
and parent requires adding keyword
10:25
yup, thing of beauty.
28 mins ago, by DaveRandom
@Jack Well, if you will write shit code...
hehe
@DaveRandom I need to curb my productivity somehow , SO chat doesn't cut it anymore
nah, not happening, there's no point encouraging people to write shit code
@tereško I'll have what you're having, then :)
10:26
COnsider it done @SecondRikudo
http://t.co/NkkAkKF5Qw
plus it makes limited sense to say I expect to return an object of class of the calling scope ...
that's no kind of contract is it ...
@JoeWatkins Dunno, .... some getInstance() thingy?
@JoeWatkins Does it? Why? I mean there must be somewhere that it gets resolved if I'm stupid enough to write class Parent {}
BTW am I the only one who still tries to ping @SecondRikudo with @mada... ?
@PeeHaa Hihi, I'm probably about to change my name again
(To my real name this time)
10:27
Let's start pinging him with @Truth, that'll teach him to change his name
@Jack If you have getInstance in php app you don't deserve any features. :)
I think untidy so I'm gonna do without parent/static ...
@DaveRandom :D
@DaveRandom I was @RikudoSennin before @Truth.
@JoeWatkins oh god no, don't add that
morning
10:29
@JoeWatkins Yeh fair enough. The lack of static seems to be very slightly, in a way, at odds with the covariant behaviour of explicit classes, but I can totally see your point
I just typed "wiki.hhvm.com" instead of "wiki.php.net" into my browser. That makes me a sad panda. :(
@salathe because the php and hhvm keys are so close on the keyboard?
I use service locator and I am proud of it. /me hides looking @Jimbo
@Leri If I were a mod, you'd be suspended for 30 minutes right about now
10:32
@SecondRikudo Because of service locator? :'(
Because of proud of it.
inb4 Someone from the JavaScript/C++ room comes and yells at us for flagging nonsense.
@SecondRikudo lol. DI would be overengineering and slow (because I'd need to parse annotations and then use reflection to assign value), so I am proud of my fast service locator and flexibility. Now ban me if you want/can. :p
@SecondRikudo Tell that to him/her.
BTW, that ruined my beautiful life. ^
WTF is that supposed to be?
10:38
@SecondRikudo LOL, gotta tweet that
12 mins ago, by PeeHaa
http://t.co/NkkAkKF5Qw
@Jimbo You were 12 minutes too late.
@Leri Dirty dirty. Honestly as soon as you get a good DiC set up it's BAM, no more bad practices when it comes to DI, just like that.
riiiiight
I'm able to find store having lowest & highest price of a particular item but cant retrive what store has that item at that rate. pastebin.com/mPQ8KSNB any suggestion to fix the bug?
@tereško I mean, it becomes pretty obvious (to me anyway)
10:41
@Jack yeah, but I will keep dreaming. Currently I have the choice of being the only person to merge to master
check back with us when you have used it for a week or so in a larger project
Anyone willing to try that LCD glasses thingy? -_-
@Leri No but... use one that caches those reflections for you. I literally place the DiC where the controller instantiation happens, read aliases for concrete -> interface from a config file so you can do your runtime polymorphism and that's it for the whole project
@Jimbo Yeah, but android is pretty f*cked up there because it preference inheritance over composition when it comes to Activity/Fragment (think of controller in terms of MVC). That forces you to create unnecessary hierarchies. IMHO, that's dirtier that SL.
Here's good example what I mean.
Code duplication in action. ^
@Leri I feel you bro. There is alternatives to Google's Activity/Fragment right. Sane people who wrap Activity/Fragment into a more (real) developer friendly components.
10:46
@DaveRandom functionally the same thing
public static function getInstance() : self {
return new static();
}
valid
public static function getInstance() : self {
return new self();
}
valid
so no point supporting static I don't think ... plus it's horrible ... I can see the use in supporting self, but since it's meaningless to distinguish between the two because of the nature of the check being performed why complicate things I think ...
@andho Could you link any? BTW, I have no idea, why I fucked English in that message...
@JoeWatkins Yeh but hinting for static could imply a lot more functionality (I'm think in terms of IDEs here)
class A
{
    public function super(): static { return $this; }
}

class B extends A
{
    public function a() {}
    public function b() {}
    public function c() {}
}
Don't worry I'm not trying to persuade you to do it, just sayin' is all
what are ::a ::b and ::c doing ?
why wouldn't that code work with self ?
it's the same thing ...
the result of the check is the same anyway
(and always would be)
@JoeWatkins not really relevant, consider that if I hint for self and I do $b = new B; $b->super()->a(); then the IDE will probably go "nope, super returns an A, you don't have the method a() available"
seems like something the ide should have to work around tho right ?
10:51
@DaveRandom As a handy-man/house renovator extraordinaire ... seen EVH's House Build Thread on Overclockers.co.uk?
@JoeWatkins Indeed, it's basically for the sake of self-documenting code. Like I say, I'm not trying to persuade you to do it if it will anger the bison.
also, not that I like the idea but I have heard it mentioned, static blocks in class entries... that syntax might disbar us from doing that .. or at least make it messier and have to expect++
@JoeWatkins I've read that 3 times now and I still have literally no idea what you are suggesting there, sorry
brb smoke
@JoeWatkins Static constructors from the C# world.
10:57
@JoeWatkins When I mentioned static ctor idea some time back I was laughed at. :)
@Leri Well, they are kinda negated, despite not being formally supported, by the fact that you can just run something in-file, which'd be like a static constructor.
what's not formally supported ?
@JoeWatkins Static constructors.
@JoeWatkins What's the use case? Notably, where is that used in Java where simply putting that in main() or a constructor wouldn't accomplish the exact same thing?
@DaveRandom I can speak from C#. Since it's compiled, unless you dynamically load assemblies, all static constructors should fire on initialization of the application assembly.
11:02
@DanLugg If you mean this, NO! Improved message
think they are, think their proper name is static initializers because nothing is being constructed is it ... I don't remember a version without it ...
not really advocating it, but don't like to put anything in the way of another feature ...
@Leri it's sad cox I didn't take note when I found it. Will do a search again on my next research bout
@Leri Yea, basically that's what I mean.
@DanLugg Yeh, I get that, but what's the use case for not just doing it (whether directly or indirectly via calling public static methods) in main() ?
@DaveRandom Visibility, locality awareness.
If you packed everything into main you couldn't access private static members, and everything would be in main.
11:05
@DaveRandom third party libs
Opencart: I'm able to run the loop and get the values out of the conditional assignments. But am not able to get whose value it is. the loop also runs hypothetically, echo'ing shows it doesnt have logic but output is perfect http://pastebin.com/mPQ8KSNB
@DanLugg Yeh but you'd do somemodule.someclass.init() from main(). You can see from main() what's be initialized. In a way I guess this is a stylistic preference, but I'd rather do it that way - I don't want black boxes magically doing shit unless I asked them to
@DaveRandom It's magic. What you're suggesting should work equally well. I forget when static constructors are called with respect to main; might be before. But yes, explicitly calling them should have the same effect in most cases.
Oh wait; okay. In C# its only before the first static member being referenced, or the first instance being created.
Just how many things can one keyword be used for...
There's no static number
11:09
*ba-dum-tss*
@DanLugg In C# when any static member is accessed.
@DanLugg That I can sort of get behind I suppose because the consumer triggered it, but I see no reason why it couldn't just be defined as a regular magic method (public static function __init() or sth)
@Leri Yea, the first time a static member is referenced from a class, that classes static constructor will be calle.d
java is not justified in the same way as php, there doesn't need to be super good reasons to add something to java ...
@DaveRandom Actually yea. Given those rules, it'd basically be like dropping top-level code into a class file. Because both circumstances would both be covered with autoloading in PHP.
11:13
@JoeWatkins Because java community (i.e. people working on it professionally) are not as dumb as php community. :)
Look at OS projects and compare code quality, if you disagree with that. ^
@DanLugg Oh that's very true, there's really no point in it in PHP. That also neatly illustrates just how wrong it is IMO, if I ever see class Foo {} Foo::doStuff(); I generally close the file and pretend I didn't see it.
java is an enterprise language, and code that is never looked at is horrible ... they have to exist in a world where nearly all code is horrible, nearly all libraries are incomprehensible and huge, nearly everything is a mess, the justification could simply be the more options you have, even if they would appear hacky and promote bad practice, the easier it is to make enterprise from all the shitty code and practices ...
what we wouldn't show to our friends the enterprise are happy to sell to their customers ... for damn sure ...
@DaveRandom And stop using that file. And the package from which it hails. And anything by the author of said package. Or his children, or friends, or previous dog's owners sister-in-laws.
@DanLugg Yeh. Especially the last one. I hate her, always showing up at my house and asking to borrow a cup of sugar or some eggs or one of my children.
lol
I've used C# "professionally" for awhile now; I don't think I've every deployed anything into production that uses static constructors.
11:17
you know, there's no psr, there's no standards almost, there's only that which the language allows or enforces for java ... bear that in mind when I say, I've used it before ... php is just getting used to the idea of packages, composer and what not, fast forward twenty years .... imagine the huge range of things that will be out in the wild, that people will build upon, that's where java is, I've had to use it just because of the strange way in which some library is designed
That's not to say I think "GOLLY GEE THESE ARE TERRIBLE LIKE THAT SISTER-IN-LAW", but I've just never found a practical use for which there wasn't a more sensible (given whatever circumstances) workaround.
it's easier for me to write static {} and ignore what I am doing than cost the project I'm working on another week ... always ... in enterprise programming that's what we think about ... not "what will reddit users think" ...
@JoeWatkins Hopefully, by that point, it'll either be on par with hack, or have been consumed and defecated.
;-)
programming will be unrecognizable in twenty years ...
It's speculative, but I disagree.
11:22
maybe 20 is too optimistic ... I hope it's different ... I hope in my lifetime, I'm wowed again ... I hope something comes along that is completely different or we're not moving forward ...
The Singularity Is Near: When Humans Transcend Biology is a 2005 non-fiction book about artificial intelligence and the future of humanity by inventor and futurist Ray Kurzweil. This is his first book to embrace the Singularity as a term, but the ideas contained within are derived from his previous books, the The Age of Spiritual Machines (1999) and The Age of Intelligent Machines (1990). Kurzweil describes his law of accelerating returns which predicts an exponential increase in technologies like computers, genetics, nanotechnology, robotics and artificial intelligence. He says this wil...
I'll be lucky to live that long ...
2045? I'll be 60.
@JoeWatkins You're not that old :P
61 ... but I'm smoking, like right now ... and an hour ago ate sausages ... for 60% of the day, this is true ...
11:27
Raymond "Ray" Kurzweil (/ˈkɜrzwaɪl/ kurz-wyl; born February 12, 1948) is an American author, scientist, inventor, futurist, and is a director of engineering at Google.
@JoeWatkins I'm a smoker too. I never said I'd be in good health at 60 ;-)
But I'll be here. Iron lung and all.
I'll probably have coffee filters balled up in plastic wrap for kidneys too
@JoeWatkins Sausage will kill you faster than cigarette.
I don't smoke but I'm too fat.
I don't smoke cigarettes ...
@JoeWatkins I C WAT U DID THAR BONG
11:29
I don't smoke sausage.
And when I say drugs, I don't mean conventional drugs; I mean I smoke feline ear medicine. People say I'm crazy. I think I'm an innovator.
4
@DanLugg hehehehe
leaves you feline fine.
11:37
you should be in marketing ...
:D
@DanLugg dude, that's not cool.
Why the heck would you smoke feline ear medicine.
And not invite us to smoke with you?
@DanLugg and I think you're on drugs :D
Puff puff pass. You' fucking up the rotation man.
^ highly trained professionals, working hard ...
wait ... one of them is me ...
For all potential google-able reasons I hereby would like to state that I have never taken any illegal drugs.
11:41
@JoeWatkins :D
Marijuana is not illegal, in our eyes.
The definition of illegal doesn't have much to do with perception :P
looking to the discussion above it's not hard to guess what day of week is it even if you don't have access to any calendar
@Fabien For all intents and purposes I've done everything ;)
My username is TOOTSKI.
11:42
I'm neither against nor for it.
@PeeHaa we're opposites then :P. I got some opiates when I was hospitalised. That's about it.
It was looooovely though.
user image
4
Has that been posted yet? At least 20 hours old so probably 3 times so far.
woops
New to me. FWd to designers.
11:43
@Fabien that better be heroine morphine
@Danack Nope, cool :D
I'm starring this as a personal bookmark.
@DaveRandom LSP violation, it shouldn't be available in that case, because you're calling a method on A, that can't know about additional information in child classes. Hence, you're violating LSP, and therefore it's ok to not support that case
@JoeWatkins ^^
@PeeHaa lol yes. Morphine, some other stuff and a nerve blocker in my neck. I had a nice button to press for more too.
@ircmaxell It's kinda like using inheritance-driven generics to create extension based self-type restrictions.
11:46
Barbiturates, yay!
Well, "inheritance driven generics" don't exist as far as I know, so ;-)
unless you have class Foo<t> {} and class Bar extends Foo<Bar> {}
but that's not "magic", it's explicit what the generic gets resolved to
abstract class Foo<T> where T : Foo<T>
{
	abstract public Bar(T o);
}

class Qux : Foo<Qux>
{
	public Bar(Qux o) { }
}
^^ Similar.
And if we support generics, that's how I'd solve it :-)
@ircmaxell yeah, that's totally what I thought ... plus it was harder :D
one of these days I'm going to rewrite PHPPHP...
11:48
Curiously recurring template pattern.
@DanLugg dude, there is SQL in your codez ...
that's unreadable..
so ... pretty funny right ?? I mean it's pretty funny that hhvm is the software that solves all our problems yet here we are, a few months in, reading a page in the manual that is a direct result of a ... flawed type system ...
11:55
not a flawed type system, a flawed implementation of it.
as they can absolutely do those sorts of checks they claim to not be able to
either 1) At compile time, spend another pass looking at possible inheritance and doing the checks there, or 2) at runtime when running the instantiator...
yeah that's what I mean .... in short, they fucked up ... that would not be allowed to pass, internals might have their problems, but not in a million years would that get passed ... crazy decision ....
yeah... definitely
Most of the I've seen in hack tends to be that sort though. The whole async stuff that's not actually async... lord...
there is only async and sync ... so it's a lie ?
It's a warning btw, and I think it's pretty much justified :D
saw many folks doing reeeeeally stupid things at __construct()
can you point to another language, in use today, that does that ? I can't think of one, wouldn't be surprised if there isn't one, because it's a horrible decision to let limitations of your software bubble to the surface when they are avoidable, provably, by every other team I can think or know of that tackled the same problem ...
12:00
Same as warning for if ($foo = 'bar') {
@JoeWatkins it's not a limitation, it's a warning
it's a warning?
you can just put it to rest
looks like it's documented as an error
The Hack type checker will throw an error when trying to call non-private methods during the initialization of an object. Here is an example:
Aha, reporting then :)
12:01
and yes, it's very much a limitation
as I showed above, there are 2 ways of avoiding needing that sort of error. It's possible, therefore it's a limitation to choose not to
make it show the warning, lets have a look at the code around it and see why it's generated
you could argue if it's good practice or not, but for it to error out, is most definitely a limitation (a warning may be appropriate, but an error is not)
is the text in the manual correct ?
@ircmaxell I personally like this idea of checking eagerly. I don't see why a constructor would, for example, need to call a metod that can be overridden
final or private would solve this
this is a FAR bigger WTF: docs.hhvm.com/manual/en/…
12:04
@ircmaxell Exactly. Therefore, generics. ;-)
Off to work, check y'all in a bit.
@Ocramius famous last words, I be with a little looking, we could find a ton of examples of that happening in the real world today
yeah saw that one too ...
@ircmaxell Oh, good point
It is not necessarily an issue, but we forced it into existence.
12:06
"It is very important for Hack to be able to check the codebase quickly.....Here is an example of the first fix: doOtherInit()" - that sounds like something I'd fuck up.
do I get right ?! Are the referring to subclassing as "union types" ?
Well, this stuff makes me happy with my stance: en.reddit.com/r/PHP/comments/23vakv/…
@tereško subclass with an implementation of an interface. Where the subclass becomes a union of two distinct types
what if i have two interfaces ?
exactly
that's why this thing is fubar
@tereško Or even more.....
@ircmaxell Presumably they've got no plan to fix these issues in the near future?
12:10
The more I look at it, the more it looks like the type system was just thrown together to "work" rather than really thought through
Java solved that particular problem with class casting. Which I think is a better approach than just blatant "let's add magic language constructs which do nothing but tell the compiler how to interprate things"
/me needs to step away. This is like a minefield of weirdness
Their only responsibility is to make it work for Facebook, who cares about others. That's not the case with PHP project.
for various definitions of make it work
They couldn't put together sensible PHP SDK or API with all those developers and power, what can you expect? :)
Is there an implementation reason why the return type hint is preceded by a colon? (Just wondering)
A handful of people here is pwning entire company.
12:18
@salathe I don't think so. As far as parsing, it shouldn't be required as the () should be enough to deliniate. But I could be wrong...
Better keep it if something else is aded after () later :)
I'm preparing pull request that supports return type hinting for fabpot/php-cs-fixer, hopefully he'll vote Yes :D
@ircmaxell At least, from looking at Joe's patch I don't see why a colon is there. Is it just copying a syntax from somewhere else (Hack)? /cc @JoeWatkins
@salathe It's possibly to make it easier for nullable return typehints in the future with "?:" instead of ":" ?
Meanwhile on the internetz.
@Danack o.O I really hope not... why would you declare nullable like that?!
Ahh... anonymous functions! (unrelated to current topic of conversation, just a general exclamation)
12:26
@ircmaxell do you have aperture lock in video mode on your dSLR?
Like, lock it to f1.8
@TOOTSKI I can switch it to manual and lock everything
or I can put it in aperature priority, and lock it that way (leaving shutter speed variable)
off to the office, laterz
I hate when developers don't trust their own constraints and have if (foo != null) { code } for [almost] every variable in code.
@Leri it's a symtom from things like Java, where you have to do that
which is one reason I argue so heavily against nullable-by-default types
compatibility only, I never tried it another way I don't see a good reason to do so ...
@ircmaxell No, you don't have to. There's a reason why NullPointerException, NullReferenceException and similar(s) exist. :)
My point is: Trust your architecture. And if your architecture requires from you to check every single variable on null, you are doing something wrong
12:39
@Leri you have to do if ($foo != null)... or catch NullPointerException which is a royal pain
@ircmaxell From my experience in C# it leads to: if (foo != default(<Insert type of Foo here>)) { code }
@andho You have to do neither. You should know when your method may return null. It's insane to check for null when variable was just created by factory (unless you explicitly define that factory may not create object).
@Leri all this syntax inside code statements make it so hard to read code (referring to the Insert type of Foo here thingy there). Method and Class declarations I could tolerate
@andho It was just my pseudo code. In real world it's just type. :)
@Leri I do agree with you about the architecture thing. Usually inheriting code base from someone doesn't give you a correct architecture.
@Leri I found it hard to read, being someone who didn't know the syntax. Talking about when I was going through a code base we outsourced.
@andho That's why documentation exists, is not it? One should not reference lib, that is not well documented, imho.
12:45
@Leri I prefer code as documentation.
@andho In fact, that is [mostly] for generics in C#: public void Foo<T>(T bar) { if (bar == default(T) { } // because T might be value type }
@andho Documented [for me] means that I know what to expect from lib. Source of information does not matter.
@Leri Too often generics are constrained anyway; and the types are nullable.
I absolutely can't understand that code. I guess that's why PHP gives me a warm fuzzy feeling.
@DanLugg Yeah, but that's not always true. Also by design that sample is perfectly sane and, honestly, I find it perfectly readable..
@Leri Oh likewise, I don't find anything unreadable about it. I'm just saying IME that quite often types'll be constrained to an interface. Even structs implementing the interface are boxed/nullable (IIRC)
Therefore == null can/will suffice.
</pedant>
12:56
@DanLugg Yeah, when you have where T : ISomeInterface default(T) == null. Anyway, I rarely use that kind of constraints. Mostly I have where T : class. Because if I know interface, I don't need generic [in most cases].
@Leri Well, when you return T it's nice to have access to the constrained type members.

« first day (1287 days earlier)      last day (3887 days later) »