« first day (3316 days earlier)      last day (1632 days later) » 
00:00 - 23:0023:00 - 00:00

11:00 PM
We use other functions for more elaborate examples in several places
Why would that be wrong?
 
@Dharman I'm pretty sure there is another page about mysqli_connect_error
 
So usort is not allowed to use strcmp in an example
Because strcmp already has its own page
usort should only be usort
 
When noobies look at mysqli_connect they do not understand why they need to die with connect_error. and the truth is they dont need to use it.
 
That's what you are using as an argument
@Dharman Again. I agree with that statement
As it said before
 
but srtcmp is actually useful in the usort example. mysqli_connect_error is not
 
11:02 PM
It is
 
ThW
@PeeHaa I just (some weeks ago) refactored my database connection classes that I implemented in PHP 4.0 originally.
 
@Dharman but they will look up the page about die if they don't understand it in the first place. Or it's just not the manual that works for them, which don't make it look into it in the first place.
 
@Dharman It may not be useful for you
 
Why die in the first place?
 
But the manual is not written just for you
 
11:02 PM
who is it useful to?
 
People who read it?
@ThW holy upgrade path batman :P
 
@Dharman It's just an example. Fail early is not that wrong. die is in that purpose I guess (even I don't use it in test and production code).
 
Which is the whole point of my question. When should I manually check for those errors? When would it ever be useful to me?
 
Whenever you want to use it
 
Don't ever die!
 
11:04 PM
@Dharman Only if. If you don't need to, no-one says you should copy & paste manual example code somewhere else.
 
There are better ways to debug script
 
exit(1)
 
Why provide a manual if I should not look into manual?
 
For cli script can something be what you want
 
exit is just a synonym
 
11:05 PM
The other way around, but yes
 
@Dharman Who said you should not look into the manual?
The manual is there for everybody.
 
But exitng with a status code is a nice feature
 
>Only if. If you don't need to, no-one says you should copy & paste manual example code somewhere else.
PHP is mostly used for WEB not CLI
 
ThW
@Dharman they are examples, not a snippet library
 
So we should just remove all cli related things?
 
11:06 PM
@Dharman Only if was for the error checking. Only if you need to do error checking, the manual also have an example w/ pointers on how to do that.
 
You just love arguing don't you?
 
Not really
 
Is this a mirror effect?
 
Arguing with a brick wall is not arguing
 
Give me a good example when to use mysqli_connect_error
 
11:07 PM
Read up
 
@ThW what did you refactor?
 
Where?
 
What you keep missing. Is that they are examples of how to use functions
 
Proper examples
not with @ or error silenced
 
@Dharman I don't know what could possibly convince you
 
11:09 PM
What do you want to convince me to?
 
Different people prefer different styles
 
we are not talking about styles
 
And again for the nth time. I do agree with you
 
And I love style.
 
@Dharman We are
 
11:09 PM
is silencing errors a style?
 
We are talking about not printing it
 
@Dharman Your mileage may vary, an example is an example, don't put too much overthinking into it. Especially small examples can't take much, they fall apart then.
 
I never said use the STFU operator
 
The manual suggests this
 
11:10 PM
@Dharman It does not suggest that. You read too much out of the verbatim example.
 
ThW
@PeeHaa well, "shut up I do my own error handling" is valid imho
 
^^ that
@ThW In most cases there are better ways to handle it though :-)
But I am also known to use the STFU operator in certain specific cases
 
ThW
Best way is if you can catch it as an exception
 
This is especially the case when dealing with I/O resources (filesys, database on remote, network) as these things actually tend to fail.
 
It mostly comes from the fact that certain functions in PHP have horrible failure modes yeah :P
 
11:13 PM
@ThW But if it's just a common failure there is no need for an exception. Exceptions I try to keep for the parts that are exceptional (don't know how good I am with that in the end)
 
ThW
or promises
 
oh no. no no. I did not promise. That is close to esoteric programming. Maybe religions. Shrug.
 
ThW
:-)
 
@Dharman You need to see the manual more as a way we use to tell people what things can do, not what they should do
 
I love PHP, but I really hate this room
5
 
11:14 PM
lol
 
Yeah, what happened to programming? I mean once upon a time this was just honestly called call-back. And even those little call-backs betrayed us from time to time.
So we felt cheated and we demanded for promises. Did it help?
 
@hakre lol this just got weird :P
 
@Dharman: Now fully in conflict of the argument, what would you suggest or say would solve it. You have three wishes.
 
ThW
@hakre ever implemented your own threats?
 
@ThW These are part of aggressive programming, right?
 
ThW
11:16 PM
non blocking i/o and promises are nice after that
 
@hakre If the code doesn't do what you want it to do threaten it
/me likes
@ThW you are also on the amp bandwagon right?
 
@ThW I would say maybe using threads wrong, but I'm leaning myself far out of the windows here, as I actually have only very very remotely contact to programming with threads.
@PeeHaa Threaten the code. Threaten the system. And most importantly: Threaten the user.
 
ThW
@PeeHaa I joined this room AFTER implementing the Arduino lib :-)
 
@hakre :D
@ThW hehe
 
I never did amp yet.
This is driving me nuts sometimes.
 
11:21 PM
Come join the dark side of I/O
 
I know that non blocking I/O is more comfortable. But it can also fail as in I/O still, right?
 
I/O is gonna be I/O so failure is to be expected
But at least it fails in a glorious non blocking way :D
 
@hakre Come… join us…
 
\o/
@Trowski I heard you say that in such a terribly dark and ominous voice :D
 
11:25 PM
hehe, that was the idea :-D
 
execution 9.5 points
Are there any reports currently about new amp stuff on windows where stuff just gets stuck by any chance @Trowski?
windows+native driver
 
ThW
@hakre With Non-Blocking-IO you hide the asynchronous part inside the loop events. The main loop is still synchronous. Basically with an event loop all the people line up to talk with your after each other while with threads directly they shout at you at the same time.
 
I still need to start debugging, but I have a lot of moving parts and after n seconds everything just gets stuck for me :(
 
@ThW so you've got the main routine and the subroutines work async?
 
ThW
Yeah, and the main routine asks the subroutines "do you have something new" in a very efficient way
 
11:40 PM
@PeeHaa Has that always happened or is this a new development?
 
@Trowski Newish project
 
@PeeHaa Mostly I was wondering if it happened with prior amp versions or if we recently screwed something up.
 
I might be doing something stupid myself honestly, but I know I don't do blocking things on purpose so it's kinda weird
@Trowski If it's the first time you hear it I will just start debugging sometime next week
 
I'm not sure how many people actually try using it on windows.
Probably a lot develop on it… so I would think bugs would come up.
 
@ThW okay that makes sense. However, how to deal w/ underlying I/O errors?
Folks, just released: github.com/hakre/pcre.php
I know the README.md is missing, I need to type something there.
 
11:46 PM
@hakre As in Amp, or what context exactly?
 
@Trowski Yeah in Amp, but also with the underlying principles. ThW just explained how high level this works to me.
 
@hakre Use our byte-stream, socket, and file libraries for I/O. It abstracts most of the annoyances and edge cases and just gives you easy-to-use objects.
I/O failures generally result in throws from read()/write().
Depending on what you're doing, we probably have a library for that. :-P
For the most part you'll only touch the event loop for timers.
 
00:00 - 23:0023:00 - 00:00

« first day (3316 days earlier)      last day (1632 days later) »