« first day (1768 days earlier)      last day (3196 days later) » 

@marcio you should add that you need Zend karma
 
Do people normally get given Zend karma straight away?
 
what's zend karma exactly?
 
I did… AFAIK, people do, when they need it.
@marcio being allowed to push any commit targeting files in Zend/ directory
 
oh, I think @Trowski did it too recently.
 
12:11 AM
yep
 
user895378
12:31 AM
oh snap, The Ashley Madison dump just happened.
 
Any idea if I could make a crawler with PHP?
 
> “We’re so used to seeing cleartext and MD5 hashes,” Graham says. “It’s refreshing to see bcrypt actually being used.”
3
 
DNC
I am recruiting 1 more web developer, interested ones?
 
 
1 hour later…
2:00 AM
 
2:46 AM
good morning
@James111 sure you can...
 
user895378
3:00 AM
@Orangepill o/
 
@rdlowrey ello
so anyone famous in the ashley madison dump?
 
user895378
Dunno. I'm going to let twitter act as my own personal crowd-sourced data mining tool on that front.
 
user895378
While I don't necessarily condone actively trying to cheat on your spouse it really sucks for a lot of mostly innocent people who don't deserve to have their privacy violated.
 
user895378
In those kinds of situations I always try to ask myself, "is this something that could ever possibly happen to me?" And if the answer is yes I try to err on the side of empathy.
 
user895378
I think the real lesson here is you ought to go into everything online with the expectation of zero privacy.
 
3:09 AM
You can always be empathetic about loss of privacy because everyone has ghost in there closets
 
user895378
Exactly. And in this case it's likely to seriously screw up a lot of folks' very real-world relationships.
 
user895378
Every girl I've ever been romantically involved with would check that list in a heartbeat. Who wouldn't? Curiosity gets the best of you. Forget googling someone before a date ... better check the ashley madison dump.
 
Even if the girl was trusting what do you want to bet her sisters/friends wouldn't check it out just to look out for her.
needless to say you would be outted one way or another.
 
user895378
I think in a world where google never forgets we -- as a society -- are going to have to become more understanding and recognize that everyone screws up at one time or another. We've got to stop pretending that people can be perfect.
 
The numbers they where throwing around where insane as well.
I'm glad the technology wasn't at that point when I was high school / college age...
I was looking at this and was thinking that it might be a good little side project to work on.
I having a little problem though figuring out how to do something like reoccurring events that reoccur forever.
that in itself doesn't seem to hard until you add on that you want to be able to adjust a single instance of a reoccurring event.
 
3:37 AM
*grep "popcorn"
 
Abe
3:58 AM
moarning
 
@NikiC By the way, Top 10 Worst C# Features has this as a special mention:
> The void type has no values and cannot be used in any context that requires a type, other than a return type or a pointer type. It seems bizarre that we think of it as a type at all.
:)
/cc @bwoebi @Andrea @Danack @Abe @Trowski
 
Abe
sounds reasonable, no?
much like how void works in java
 
morning.
 
Abe
hey
iirc in java you can instantiate it by using reflection, though :D
useful votedown gif, bookmark it:
 
4:22 AM
@Danack i would venture to say that most any phper worth their salt is using the amazing password_hash() and password_verify() methods, or their own implementation of bcrypt
 
4:34 AM
@LeviMorrison I agree. null makes more sense than void if union types are added: ClassName|null vs. ClassName|void. Additionally, functions return null by default, lets not pretend it's anything else.
 
4:52 AM
So I guess no throwing from random_bytes() and random_int() ...
 
@Trowski did you manage to get a reproducing script for that bug ?
also, morning
 
good mornings
 
@JoeWatkins Morning o/
No, I didn't have time to look at it again, and pthreads on PHP 7 just segfaults immediately on the script.
 
user895378
@JoeWatkins o/
 
@Trowski yeah I read that, was hoping you were able to reproduce ... did you valgrind/gdb ?
yo @rdlowrey
 
5:08 AM
good mornin
 
user895378
been trying to finish up real work for the last few hours. Can't go to bed until that's done and will likely be at least another hour.
 
RC1 was tagged today, was hoping to tag a release of pthreads for php7, but wanted to sort the bug you had first ...
 
user895378
And I still haven't had a chance to play with new pthreads yet :/
 
user895378
Forget Ashley Madison. Nothing could be more embarrassing than pandora/spotify/etc leaking my music stations and playlists. Let's hope that never happens.
 
user895378
^ The above thought was brought to you with Boyz 2 Men on backing vocals.
 
5:13 AM
it should be more stable, there is probably a bug or two left in the code that copies op arrays because it's new and I don't really have a reference other than opcache (but it does things so strangely) ...
 
Abe
@Trowski consider that's a type just for convenience, in languages such as c# and java trying to use the result of a void method results in a compile error (cc @LeviMorrison)
 
there should also be less overhead associated with calling threaded object methods, less cognitive overhead using Worker (because refcount rules are no longer applicable), statics won't give us gyp anymore, some memory improvements when starting new contexts because better copying code ... and some other stuff ...
 
@JoeWatkins I'm trying to reproduce the error in a small script, but it seems to work fine there, so something odd must be interacting.
 
user895378
^ Do you guys have an open issue report for that?
 
user5236938
i WILL catch the 10 millionth question on stackoverflow
 
5:19 AM
@rdlowrey this week auryn based project's gonna go live, any tips on improving performance?
 
user895378
@SergeyTelshevsky that's a pretty vague question :)
 
@rdlowrey that's why I'm asking here and not on github :D
 
@JoeWatkins So this is a bit of a mess due to the package bing a WIP, but even declaring another closure anywhere in the closure passed to ThreadContext will cause the Thread to crash immediately at the closure declaration: github.com/icicleio/concurrent/blob/master/examples/thread.php
 
user895378
@SergeyTelshevsky use string-based definitions (e.g. "MyFactory::create" where possible ... even for delegate factories. That way you aren't instantiating closures or factory objects that you'll never need.
 
I will have a look at it today ... minimum reproducing code is nice, but if it's just not doable then looking at a whole app is okay ... sometimes ... thnx
 
5:22 AM
@JoeWatkins I'm trying to make a minimum repo script, but I'll have to head to bed soon.
I can look at it again tomorrow.
 
okay no probs, I'll try with this, see how far I get ...
/me goes to walk dogs
 
/me takes a cup of coffee
 
@rdlowrey that's a great tip, thanks! I was also looking for a way to make object creation lazy, in case class doesn't actually use it's dependency for some reason, I've noticed it may happen sometimes despite I was trying to avoid this
 
Abe
/me takes mexican champagne
 
user895378
@Abe I KNOW THIS REFERENCE!
 
Abe
5:26 AM
@rdlowrey i learned it from this very room :P
is someone here that participated/knows the details of the php6 project?
 
user895378
You could ping Sara when she's around
 
@Abe what kind of details are you looking for?
 
user895378
@SergeyTelshevsky Object creation should always be lazy unless you manually instantiate it to share or use in a definition
 
user5236938
am I allowed to ask legal questions regarding php? basically IF something is legal or illegal?
 
Abe
was wondering how unicode strings would have worked:
$foo1 = u'unicode string';
$foo2 = b'generic binary data';
$foo3 = 'which of the two?';
 
5:29 AM
$foo3 is binary string, like it is today. same for $foo2.
$foo1 never made it, but I guess you know :)
 
Abe
so b is kinda redundant, right?
 
well, it's the default.
defaults normally are redundant, right, but it's less problem I'd say.
 
user5236938
Okay, I looked up the TOS for stackoverflow. says I can't DO anything illegal. I'm wondering (in a non destructive way) is it legal/okay to POST data and grab the information from the page it posts to?
 
Abe
ignore
 
@JoeWatkins Realized what I was missing, PTHREADS_INHERIT_INI on Thread::start(): gist.github.com/trowski/1ce961de5b9642dd068d
 
5:33 AM
@Wicked that depends on the TOS of the page you send HTTP requests to. Technically that's a service you interface via HTTP with.
@Abe ???
 
Abe
not you @hakre :P
 
@Wicked Legally these things normally don't play a role until you're a) sued b) you want to sue the service to deliver - :)
 
Abe
@hakre that looks like a decision picked for backwards compatibility, am i right? because defaulting to 'u' would cover the nearly totality of strings in common php apps. but it would break those few cases that are generic binary data instead, unless they add the magic 'b' before the string literal
defaulting to 'b' doesn't break anything, but it kind of sux, php style :D
 
user5236938
@hakre okay, makes sense. thanks. and in no way did I mean I was going to do it against stackoverflow or anyone else. i know it sounded as if I had bad intentions
 
well you talk that much about you don't have bad intentions, it's most likely you're not so sure :)
 
5:36 AM
@Abe I believe the intention in PHP 6 was to default to 'u'.
 
@Abe don't think so. you might be looking for this: web.archive.org/web/20051201034015/http://www.php.net/~derick/…
 
Abe
@Trowski was that accepted? or caused an internals civil war?
 
> The Unicode semantics switch will control what type the string literals are by default, of course
 
I would make sense if it defaulted to the value in default_charset
 
@Abe I didn't follow internals then. But PHP 6 doesn't exist, so that's probably a good indication. :-D
 
5:39 AM
so it was as intended as backward and forward compatibility.
 
@hakre So it was an ini setting?
 
@Trowski it wasn't, it never made it. it was planned thought-out to have a switch for that.
 
Ugh... sounds like mbstring.func_overload.
 
bad idea (tm)
 
@rdlowrey when I create a controller, for example, it does create all it's dependencies and if they're not abstracted by factories it will create all their dependencies, some operations do not require all of them, what's the right way to not create all of them? or is it a bad architecture consequence?
 
5:42 AM
Is there anyone here with a bit of Doctrine experience?
 
user895378
@SergeyTelshevsky If an object can operate without a dependency I would say it's not a real dependency and probably doesn't belong in the constructor. The exception to this is something like a logger where you might pass in a NullLogger. The behavior you're describing wasn't always the case -- it was changed in github.com/rdlowrey/auryn/pull/101
 
user895378
@SergeyTelshevsky that said, you can always explicitly define a null value for a parameter in a given class
 
user895378
But the better solution is to only specify constructor parameters that truly are dependencies.
 
user895378
If the object can operate without ever receiving one of those dependencies it's a sign that the object may be doing too much.
 
Abe
@hakre and @Trowski hmmm, but anyway, would you prefer the string literal to default to u or b? actually: which default do you think it would be accepted in an hypothetical php8? defaulting to binary just for BC is madness imho, but again, it is backward compatible
 
5:47 AM
@rdlowrey would creating a lazy loading proxy and pass that in as dependency be a good work around?
 
user895378
@Orangepill what's the point, really? It's a workaround, sure, but it doesn't change the status that the object doesn't really need it to function (and thus it may not be a real dependency)
 
@Abe strings are binary in PHP. makes sense to me, is not only backwards compatible, but the minimum you need.
 
user895378
IMO the only reason to specify an optional constructor dependency is to do lazy-injection to ease testing while creating the default dependency inside the ctor when it's unavailable
 
@rdlowrey sorry, I didn't describe the problem too well. let's say I have a standard controller class as an example again. it has two public methods used in routing, one should show a user list, the second an article list (in this example it's really true that this controller does too much, but nevertheless, it's an example). the user list method requires the user repository and article list method requires article repository, so on some requests we instantiate excess classes
@Orangepill that's what I thought of too
 
user895378
I would argue that the controller shouldn't know anything about routing, but anyway, you can always do this:
 
5:50 AM
@rdlowrey it does not know, but think of it as a bad example..
 
Abe
yeah but imagine having to write u'' for every string. and just for some rare binary strings to exist @hakre
 
there are some places where it's hard to determine what will be used and what not
 
user895378
$injector->define("MyClass", $definition = [":optionalArg" => null]);
 
user895378
If you specify an explicit value for the parameter in a definition auryn will always use that
 
@Abe as strings are normally input data, you don't have to write u in front of every string. you probably theorize a little here.
 
5:52 AM
@rdlowrey how should I know what dependencies will be required beforehand?
 
as the encoding of any (binary) string is meta information, that meta information should be left somewhere (near) to the binary data - if at all.
 
@Abe Honestly I don't see the need for it. At the language level there really should only be binary strings.
Let me determine how to interpret those bytes.
 
@rdlowrey in this example, should the router set definitions for the controller?
 
user895378
@SergeyTelshevsky I don't personally think so.
 
I guess my challenge would be getting a hold of the dependency at call time
 
5:54 AM
@rdlowrey you think personally? :D
 
user895378
@SergeyTelshevsky you could also use Injector::prepare() for this
 
user895378
$injector->prepare("MyClass", function ($obj) {
    // call setter methods on $obj here
});
 
user895378
^ Any instance of MyClass instantiated by the injector will be passed to the prepare
 
user895378
You can specify strings as your prepare callables as well and auryn will provision them like other callables
 
@rdlowrey exactly after instantiation, so after __construct(), right?
 
user895378
5:57 AM
@SergeyTelshevsky right
 
that's more interesting
 
user895378
But this entire question is why I think it is better to inject the default parameter instead of instantiate in the absence of a definition ... though I was overruled on that front and didn't care enough to belabor the point.
 
@rdlowrey: is there a flag to skip the constructor (just curious)?
 
Abe
@hakre nope, just telling you about the pain of python developers. ask them if they would have preferred strings defaulting to unicode :P
 
user895378
@hakre no ... when would you consider that useful?
 
user895378
5:59 AM
@SergeyTelshevsky note that the name you pass to Injector::prepare() can also be an interface (not only a class)
 
user895378
That way you can use setter injection for things that may not be hard constructor dependencies (or do whatever else you want)
 
@rdlowrey let's put it the other way, class B has 300 dependencies it does really need and constantly uses, class A has a dependency of class B, but it really uses class B only 50% of the time and it is determined on runtime, if it will actually use it. which way would you go to not instantiate these 300 dependencies which will not be used 50% of the time?
 
@rdlowrey when the injector prepares a de-serialized object instance probably, so far I'm just curious and I didn't say it is useful.
 
@Trowski so that fixed the crash ?
so with default PTHREADS_INHERIT_ALL it crashes and with PTHREADS_INHERIT_INI it doesn't ?
 
user895378
@SergeyTelshevsky Then I would use a prepare for class A and use setter injection to give it an instance of B.
 
6:03 AM
oh I see, with INHERIT_INI it crashes
 
user895378
I just don't think it's a good idea to have constructor dependencies that never get used.
 
@Abe let's wait for the next version of perl at the end of the year and see how they progressed on the issue. for PHP, you don't have to ask that question yet.
 
@JoeWatkins Right.
 
Abe
@hakre lol :P
 
Which is what I'm trying to use since I would like to keep the threads as light as possible.
 
6:03 AM
@rdlowrey and is there a way to solve this problem using only constructor injection besides making a factory/proxy for class B
 
Abe
wait, are you not being ironic? next version of perl this year? WAT
 
PTHREADS_INHERIT_ALL seems to come with it's own demons.
 
user895378
@SergeyTelshevsky use different classes -- extend A with C to add the additional functionality
 
@Trowski php -i | grep Sig
 
6:05 AM
enabled
 
@Trowski it's problematic to use closures without INHERIT_CLASSES because the base lamda is not copied, there is no place to intercept the call to initialize or call a closure in the new context at runtime, only on initialization do you have a chance to copy the class
 
For dependencies that are only used in a single method I prefer passing them as a method argument.... $orderManager->processPayment($paymentGateway, $paymentInformation); as opposed to instantiating orderManager with a paymentGateway
 
user895378
@Orangepill yup
 
@rdlowrey that does require me to know beforehand if I will need B
 
user895378
auryn helps with this too because you can use Injector::execute("MyClass::myMethod")
 
6:06 AM
there is some kinda problem with zend signals crashing on HANDLE_BLOCK_INTERRUPTIONS
without zend signals enabled you'll get
Thread started...
php: /usr/src/php-src/Zend/zend_vm_execute.h:8110: ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER: Assertion `zfunc != ((void *)0) && (*(zfunc)).value.func->type == 2' failed.
Aborted (core dumped)
 
@rdlowrey I tend to not pass auryn to anything but factories :(
 
user895378
@SergeyTelshevsky Same here.
 
user895378
IMO the best way to use it is to use FastRoute to map methods/URIs to strings that you can then execute with Injector::execute()
 
when you use inherit all you'll get the expected output
 
user895378
Then you never have to think about anything.
 
6:08 AM
krakjoe@fiji:/usr/src/php-src$ php ext/test.php
Thread started...
Thread ended...
 
so how do you handle it if the which paymentGateway is determined deeper in your code, where it wouldn't have access to the injector
 
@rdlowrey I use a custom router built on top of fastroute, and it works flawlessly with auryn
 
user895378
@Orangepill pass in a factory
 
user895378
(basically the proxy object you talked about)
 
but the problem is not with controllers, etc., it's more about business code
 
6:09 AM
try it, see what happens ... you should aim to write code that is compatible (and I should aim for it to execute without crashing :)), if you do that, there is no reason to use special start flags, it's only if you're using a codebase that was not aware of threads, it has static or global state ...
 
would it be bad practice if the factory passed was constructed with the injector as a dependency?
 
user895378
@Orangepill not at all
 
user895378
Think about why a factory exists -- specifically to make whatever object it returns
 
@rdlowrey that just opened a whole new the world to me....
 
Does anyone know how to force clear Doctrine's cache?
 
6:10 AM
PTHREADS_INHERIT_INI|PTHREADS_INHERIT_FUNCTIONS
will also work
this new ZEND_ASSERT thing ... there is nothing I can do to stop it crashing, it is intended to make it crash
 
@Orangepill yeah, this is some tricky part about DIC/SL difference..
 
take care here: if the factory is a static of the application, it's sometimes worth to not hide that within the injector configuration.
 
I had assumed that that was architecturally unsound to use the injector in a factory that got passed in as a dependency.
 
@JoeWatkins Either PTHREADS_INHERIT_INI | PTHREADS_INHERIT_FUNCTIONS | PTHREADS_INHERIT_CLASSES or PTHREADS_INHERIT_INI | PTHREADS_INHERIT_CLASSES causes a segfault.
Not in that test script, but in the package I'm working on.
 
leave out inherit classes
 
6:12 AM
Sorry, meant PTHREADS_INHERIT_INI | PTHREADS_INHERIT_FUNCTIONS
Actually that doesn't segfault, but the thread crashes like before.
 
@Orangepill would that be the case in the example here? I understood it the way, that the injector injects a Factory object.
 
user895378
The injector does inject a factory, but it's valid for the factory itself to use the injector as a dependency because its sole purpose in existing is to create what it's asked for.
 
user895378
That said, you could also just ask for everything the factory needs to create objects inside the factory constructor and let the injector provide it but IMO this is splitting hairs.
 
^ thats how I understood it... that has been a big mental hurdle for me.
 
@Trowski show me ?
 
6:17 AM
I tend to think of a factory as a sub-application which lives in it's own isolated world. Or like an API, you request something from it, it returns it. It won't hurt tests too
 
did you disable zend signals ?
 
@JoeWatkins It might have something to do with the event loop. It's stored in a static variable of a function.
 
as you should develop a factory and it's children independently of everything else
 
No. Suppose I'll have to recompile PHP for that. I really should be heading to bed.
 
go to bed, we'll look tomorrow ;)
 
user895378
6:18 AM
@SergeyTelshevsky yes, this is my view as well. A factory is its own thing. If the factory itself needs the injector to make what it's asked for then the injector is a real dependency of the factory.
 
Sounds good, night.
 
user895378
The important thing is to keep the injector out of your application logic.
 
That makes sense... the factory has a very narrow responsibility so you know the injector is insulated from being misused
 
user895378
Factories are glue code ... they're essentially part of the bootstrap process but due to various reason they cannot be executed until later in the script's execution.
 
6:20 AM
@rdlowrey but this is where you should be careful and not make a SL from a factory
 
user895378
@SergeyTelshevsky yes, it's a slippery slope
 
user895378
You shouldn't pass in a factory and use it to get lots of different things ... then it's just a SL
 
keep the factories specific as you can I would say...
 
OK, now back to the example, could we make some proxy class that's sole purpose is to not create an object if it's not used?
like a factory that does create only one type of object
 
user895378
@SergeyTelshevsky sure, but that would only make sense if the construction of the dependency you're trying to avoid is very heavy
 
user895378
6:24 AM
But the general rule is this: if the factory is only ever needed once it should probably use a real dependency and not a factory. I still think you should know at construction time whether or not you're going to need that dependency to create the object.
 
I feel like I did in high school when I woke up one morning and understood what a cosine was and trigonometry finally made sense.
 
user895378
hehe that's a good analogy :)
 
user895378
But for domain entity type things where e.g. database connections may be involved it can make sense to avoid that if you might not need it
 
user895378
I should've left it injecting the default value if no definition existed ... then this wouldn't be an issue.
 
user895378
^ /cc @Danack
 
user895378
6:27 AM
If a dependency isn't optional you shouldn't have a default value ...
 
unless the constructor can create the default dependency.
 
@rdlowrey so what you say is that the injector should also inject itself in case this is asked for it?
but doesn't that mix the injector with the application then?
 
user895378
@hakre no, I'm not suggesting that
 
@rdlowrey something like this comes to my mind, but after running at least one of the magics, substitute the proxyobject with the real one which was created in the class it has used, but this requires some dirty hacks..
 
@rdlowrey okay, gotta jump on the bike, will be in the office in ~30 mins.
 
user895378
6:31 AM
@hakre I gotta go to sleep but we can continue the conversation another time :)
 
@hakre you mean like this :) github.com/Danack/Tier/blob/…
 
@rdlowrey thanks for the tips :)
 
sorry forgot the link
@rdlowrey Thank you
 
7:02 AM
@kelunik Very very slow. Mad busy with actual paid work atm
 
re
 
posted on August 19, 2015 by kbironneau

/* by Frankie */

 
hey
any good tutorials on session start and how to use it for real scenarios?
 
@Demorus real scenarios?
 
7:15 AM
such as login and so on
I did see a few examples on w3schools but it wasnt very useful
or thenewboston video tutorials
 
What information are you looking for that isn't explained in the documentation?
 
Well the problem I have is kind of implementing the information in the documentation. I have no prior experience
 
You are wondering about the "implementation" of a single line of php?
 
session start?
 
@kelunik what script / browser?
 
morning!
 
morning!
 
7:38 AM
moin
 
moin.
 
user1804599
@PeeHaa maybe they want to implement the session machinery themselves.
 
Public announcement: I hate ORMs.
Honestly, problem is not in their implementations. Problem is with how different is relational database structure from object oriented world. Willing to upgrade to graph databases.
Has anyone here worked with neo4j with php around? I am starting new (quite large) project and want to give it a try
 
user1804599
No, don't upgrade to graph DBs. Upgrade to the lack of object-oriention.
 
Would you mind elaborating on that?
 
user1804599
7:43 AM
Well, it doesn't matter, really.
 
user1804599
You can use any design for either given you decouple them.
 
@Leri use postgresql, it's a relational object database
;-)
 
@elyse It does. In graph database you won't get orphan relationship while you're trying to delete note. Well, I perfectly understand why ORMs can't delete note and instead trying to make it orphan and you have to do it manually, but that's annoying. :)
 
user1804599
ON DELETE CASCADE
 
@FlorianMargaine Actually, I have never tried one. Thanks for suggestion.
 
user1804599
7:46 AM
Well, if your job is to store graphs, you likely want a graph DB, since it's good at graph manipulation.
 
@elyse Nope, when you have entity that has 1:n relation with 2 or more entities and you do: $parent->relatedEntities->remove($relatedEntity); it won't actually delete $relatedEntity, but try make it orphan by setting foreign key to null, because if it deletes other relations will be lost and that's the least thing ORM authors would want.
 
user1804599
ORMs are stupid, but that doesn't make RDBMSes bad or unsuitable.
 
@elyse Who said that? I'd say they are not suited to my programming model I use for apps and it seems, graph databases are. Basically, I have two choices: adapt my architecture to RDBMS or adapt DBMS to my architecture.
If I can do the latter, it'd take less effort from me.
 
user1804599
No, don't adapt either. Instead, decouple your architecture from your storage mechanism.
 
@elyse That means that I have to add DTO layer underneath Domain, which means another layer for mapping and that's a lot of performance loss.
And it still does not free me from writing unnecessary code.
 
user1804599
7:53 AM
lol
 
@PeeHaa I just didnt understand how to integrate it on to my own project or in OOP
Also many tutorials seem to be out of date : /
 
Oh, and by unnecessary code I mean the code that you would not write logically. :-)
 
@Demorus Are you asking about session or as you stated session_start?
 
$SESSIONS
 
user1804599
I don't get this OOP fetish.
 
7:57 AM
I know how to set a session name and so on but how to perfectly integrate the idea of sessions is new to me
$elyse I thought OOP makes you a professional?
8
 
lol
 
@Demorus LOL
 
seriously, everyone keeps saying sessions is the "beast"
 
Professional means you get paid for something. Nothing more nothing less
 
@elyse I write C# atm, so I don't really have any other choice.
 
7:59 AM
cant you write modular with procedural too?
I mean using functions etc
 
user1804599
In French, OOP is written POO.
 
a class can contain procedural code ...
 
user1804599
@Demorus Of course. C and Haskell programmers do it all the time.
 
Then why all this OOP hype?
I understand how OOP works, at least the basics, constructors, methods etc but
 
@Demorus Yes, extension methods, however, not really good choice for working with DAL
 
8:01 AM
some languages don't support functions as first class citizens, only as members of a class, C# is one of them, Java is another ...
 
a function works fine in most cases as well
 
@JoeWatkins Both of them fake. First via extension methods, the second one with utility classes. :-) Oh,and lambdas.
 
Interesting
 
@Demorus there is a difference, an important one, between code that uses objects and code that is object orientated ...
 
By the way, many tutorials are very outdated and it took me two weeks to find the right path to best practices
 
8:07 AM
what you have described is the use of objects, not oo ...
 
$Joe Watkins interesting, didnt know there was a difference
 
@Demorus it took me several years ... count yourself lucky that people bother to write this stuff down somewhere you can find it ... other than bible-like books ...
 
$Joe Watkins it took me a while to understand mysql is obsolete. So many still write in mysql and not in mysqli style. Then I learned about prepared statements after two weeks!
I have no idea what im still missing
 
here's a good starting place ... phptherightway.com
 
nice.
I sanitize with mysql_real_escape_string
 
8:10 AM
what the fuck has been going on here?
 
put that in a function and pass in a parameter.
 
that's very far from best practice ...
 
@Demorus learn to use prepared statements either with MySQLi or PDO
 
$teresko I use prepared statements since yesterday. Still new but im getting the hang on it
 
I'm switching into screencast mode ... find answers to anything ... @tereško
 
8:12 AM
@JoeWatkins I am off to the bank
I just steped in here for a moment and saw some fucktards from c++ room bashing OOP
 
#if PHP_HAVE_BUILTIN_EXPECT
# define EXPECTED(condition) __builtin_expect(!!(condition), 1)
# define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
#else
# define EXPECTED(condition) (condition)
# define UNEXPECTED(condition) (condition)
#endif
Guys, I think this must be run!
wrong
# define EXPECTED(condition) (condition)
# define UNEXPECTED(condition) (condition)
They are same!
 
there is a lot of "context" missing here
 
they are meant to be the same
 
Joe
 
Anonymous
@tereško +1 for MySQL workbench
 
8:16 AM
if (UNEXPECTED(something)) {

}

if (EXPECTED(something)) {

}
 
Do you think it is justified that I learn best practices etc before starting to code?
 
@samaYo you're welcome
 
Anonymous
made my life easier ^
 
I mean unlearning "bad practices" then learning "best practices" is harder
 
@JoeWatkins UNEXCEPTED are opsite from EXCEPTED right?
 
8:17 AM
Have a look at thesaurus
 
the builtins allow gcc to optimize branches likely to be executed, if they are not available (because no gcc) then you still want the code path to be travelled, you are testing the condition and providing a hint to the compiler, but you need the branch travelled whatever ...
 
Anonymous
Good morning
 
@Demorus learning never stops, the sooner you learn the right stuff the better ;)
 
@JoeWatkins , So that is a optimization during compile?
 
yes
 
8:22 AM
 
moin @Jimbo
 
8:38 AM
@Sjon Chromium, but got it, it only happens when there's a horizontal scrollbar: 3v4l.org/31505
 
8:50 AM
will deprecated functions like split be removed?
I mean, realistically
I doubt it
 
@MarcelBurkhard split has been removed in PHP 7: 3v4l.org/0AUcm
 
@kelunik wow.. ok ^^
thanks
 
@MarcelBurkhard we also removed mysql_* functions... yes, pigs are flying!
 
Is there any configuration I need to enable in order to create sockets?
 

« first day (1768 days earlier)      last day (3196 days later) »