« first day (2784 days earlier)      last day (2179 days later) » 

3:01 PM
I actually remember behaving like that myself ... it's ten minutes before the end of the day, can't figure out what's going on, turn error reporting up and YOLO, until tomorrow ... then spend the day writing scripts to analyse logs, because there's so much of it ...
 
@JoeWatkins E_ALL sounds reasonable but displaying them doesn't :P
 
@JoeWatkins ...that's one crappy ass application in that case
:-P
I always have E_ALL | E_STRICT enabled, I get maybe 3 or 4 errors logged a day
on a bad day
 
I've worked on some real piles of crap ...
 
tbf my apps are mostly also piles of crap, but at least they are error-free piles of crap
 
3:13 PM
posted on May 31, 2018 by CommitStrip

 
@DaveRandom what is that?
 
it's a bit of JS that will watch the DOM for changes under the root node defined at the top, and execute the callbacks defined at the top against all added or updated text nodes
so for what Dan was talking about earlier, it replaces /!+/ with a single exclamation mark everywhere in the document, both from the initial state of the document when you run the script, and dynamically as the document tree is modified in future
 
@DaveRandom Yes, and I can see that it works too.
I am gonna add it in my tampermonkey for chat SO. :P
 
It will work fine in Chrome and Moz, it will not play nice with Opera, unless they have fixed their MutationObserver impl recently, it was ridiculously resource hungry last time I tried
 
@DaveRandom You should add check for if the exclamations mark are for @Jeeves calls, I think.
 
3:22 PM
well it won't make a different to the functionality of jeeves, that's all done server-side, this is just changing what your browser displays
and I only did it because I saw @Danack's bitching and I'm familiar enough with those APIs that it only took me a few mins to throw together
 
Yes, I know, but still @Jeeves commands with just 1 exclamation mark, will look stupid.
 
@DaveRandom When did you check opera last?
 
feel free to modify the operations however you want :-P
 
Yeah, Opera is Chromium based now.
 
@PeeHaa about 6mths ago maybe, someone wanted to use it at work, I ended up telling them to just use chrome or FF like a normal person
@mega6382 oh, then maybe there was just a buggy release at the time]
idgaf tbh, the "oh noes Google will have all my data" ship sailed for me a long time ago, so I may as well just keep using chrome
 
3:26 PM
I hope google has all my data, I've relied on it to remember everything for me for a long time
 
@DaveRandom I used opera and chrome simultaneously, there is very minimal x-browser issue in them, so, I get almost the same behavior on both. But with chrome I have a shared history & bookmarks amongst my mobile and pc. And with Opera I get other cool things like built-in: vpn, adblock, screenshot, and a shit ton of other things.
 
@PaulCrovella we are borg
 
I really never ever touch FF, IE, Edge, brave, UC or whatever.
 
sP_
Hello people, I'm just starting out with django but I believe this is a general back end question.
So I'm creating an API on the server side for my application. I will be returning a not-so-huge JSON object. I was wondering if I can return a JSON object normally, or should I be creating a REST API using some REST framework? TIA!
 
@mega6382 You are one of the people using the vague and shady chinese vpn?
 
3:29 PM
I'm using array map and array chunk to get the average value of every successive 4 values in an array which is basically the average of every hours in an array of 96 values which will result into a 24 value array. however, i am losing the keys in the process and the keys hold the hour values.
$delta_live_ante_24 = array_map( function ( array $chunk ): float {
// average of all 4 deltas within an hour
return array_sum( $chunk ) / count( $chunk );
}, array_chunk( $delta_live_ante_array, 4, true ) );
 
@PeeHaa Yes, but I mostly only use it in private mode and to access urbandictionary or something(sites that are blocked by my ISP)
 
I am using true to preserve keys but I still get new keys starting from 0 to 23
and the starting hour in the old i.e. the starting key index is 08:00:00
 
@mega6382 So... porn?
 
Wordpress is cancer
 
Is there a value I can keep hold of the keys?
value = way*
 
3:31 PM
@PeeHaa Some discretion, please. :P <3
 
@sP_ what do you mean by "normally"? What it comes down to is: all web development is just manipulating strings in various ways. The question is how much you want to abstract that fact away... people build "frameworks" in order to make code easier to write and easier to maintain (although in practice the effect is often the opposite), so you need to weigh up whether it's worth making a load of "generic" stuff for your specific use case
 
@sP_ No, I don't think a specific rest api framework is required.
 
@mega6382 Sorry.
p0rn
 
@R1ddler just write a loop
that ^ applies in 99% of cases where you need to do any sort of array iteration in PHP, imho
array_map() and array_walk() are almost always more trouble than they are worth
 
@Tiffany Preach on, sister!
:P <3
 
sP_
3:38 PM
@DaveRandom by normally I meant returning the json object without any additional tools or modification. Like when you open the link it displays the json object like this - api.myjson.com/bins/hfxxy . It works for the purpose and looks exactly like how it would if sent as a REST API return object. But I'm wondering if people use rest framework just for the ease, or is it more secure and highly scalable etc.
 
o/
 
@sP_ Its usually not that scalable. Because what truly scalable is the code that you wrote according to your requirements and with keeping the future growth of codebase in mind. Thats my opinion.
@Allenph \o
 
sP_
@mega6382 I see. From what I have been reading I've learned the same thing. Thanks. But though what I am doing works people say REST Framework is an industry standard and should be preferred over other methods, if I understood correctly.
 
@sP_ by "REST framework" do you mean some sort of specific data format?
 
OH: "If you blindly trust your framework/library [to handle security for you], security vulnerabilities are almost guaranteed (from experience)." Obviously a hyperbolic statement, but definitely fits within my experience as well.
6
 
3:47 PM
@DaveRandom not sure how to go about that, cos I need to take the avg of every four values.. how do I accomplish that with loop?
 
sP_
@DaveRandom No, I think REST API is used only to handle requests and responses. Data format is still going to be the same, json object.
Rest framework*
 
yes but what do you actually mean by "rest framework"?
like, do you have a concrete example of something?
 
@DaveRandom django-rest-framework.org I think...
 
sP_
I'm using django, django-rest-framework.org this framework is widely used.
@mega6382 yes
 
@R1ddler $result = []; foreach (array_chunk($delta_live_ante_array, 4, true) as $chunk) { $key = key($chunk); $result[$key] = array_sum($chunk) / count($chunk); }
 
3:51 PM
I'll try that
thanks
 
@Patrick Wow... and his comment has 3 upvotes.
 
Use my framework. It comes with one free security and the most advanced active record ORM ever.
 
lol
 
@sP_ OK well in that case "industry standard" = "loads of people use this" (there's no such thing as "industry standard" most of the time in sw dev), "loads of people use this" does have advantages (easier for new devs to understand your code, typically a decent community support), but it also means that if the framework makes some mistakes, you will also make those mistakes
 
@StatikStasis Only 3? I expected better from reddit :P
 
sP_
3:55 PM
@DaveRandom Yes, it actually means a lot of people use it. I think as a beginner it'll help me to find solutions for common problems. Thanks for the help. I'll think about whether or not to use this.
 
Yes
 
Don't know whether that looks better than PHP World. None of these talks really call out to me.
 
@Tiffany I wasn't aware of that vulnerability- I use utf8mb4 but it is still good to be aware.
 
-n month is not sequential – #76397
 
4:05 PM
@DaveRandom I'm the same way to an extent. I'm all for privacy but most of the time I'm just like meh... I guess until it bites me I enjoy the convenience that a lot of this data collecting provides me than the concern of privacy; I'm probably willfully naive at times because I enjoy the convenience so much. Same reason I have an Amazon Echo... if they're listening all the time, they're going to be bored.
 
Wes
@Tiffany how do you not hate being a programmer?
 
Do you hate being a programmer Wes?
 
Wes
should ask that on stackoverflow
just look at that shit
 
I am sure we are responsible for 50% of @Tiffany's depression, and her company is responsible for the other 50%. :P <3
 
Not sure what we're talking about - what's wrong with that post?
 
4:10 PM
Well, you specifically are responsible for 100% of mine Mega, so...how bou' dat'?
 
@Allenph Why? What did I do? <3
Is it because I said, that you still look like a 12 year old?
 
@StatikStasis the issue for me specifically with Google is that they already have enough data to ruin me, and if I stop using their services I am pretty confident they won't get rid of it. If I had it to do over again I might do it differently, but it's a moot point so I may as well just take advantage of the platform.
 
Mostly @mega6382.
 
I'm much more conservative with literally everything else on the internet
 
4:15 PM
@DaveRandom I agree. Does Google not have to comply with the GDPR if you want your data erased... I almost laughed writing this thinking there would be absolute 100% compliance.
 
that's the thing, I can't see them deleting the data and I can't see it being practical to enforce that they do
 
but but... the law...
 
This new law will fundamentally change how I get around the law.
 
They have become too big.
 
@StatikStasis pfft, law. I'm off to import potatoes to the UK from Poland without formal written notification.
 
4:19 PM
I'm going to alert the proper authorities. @DaveRandom
 
Got some bad news for you there, we haven't had any authorities that could be described as "proper" for some considerable time now.
 
Speaking of which I got a letter from the FAA today telling me they knew about my drone purchase somehow and insisted that I send back money to register it.
I took the time to actually send a physical letter back that said "lick my balls."
 
no kidding?
 
Seriously. That's ridiculous.
 
4:21 PM
ftr I personally think you should register it
 
I registered for one of the "numbers" when that law first came out. I was in the process of building a racing drone at the time. I have the number but I still haven't finished building it yet.
 
those things are potentially pretty dangerous, they should be registered for the same reasons that firearms should be registered
 
We're never going to agree. I don't believe in government at all.
 
@DaveRandom ...oh that's right, you're not from the US. Never mind.
I'm on the side of the 2nd amendment but I won't open up that can of worms here.
 
the 2nd amendment is not in and of itself problematic in principle, it's just not specific enough with respect to a number of significant developments from last ~200 years
 
4:26 PM
Good morning
 
I'm not for crazies having weapons either... but defining someone as crazy is subjective and the government has been known to abuse their power. It's a tough line to walk.
 
notably, it's probably not a good idea to let any old idiot buy a high-powered rifle, and "well regulated" has become significantly harder to manage
@StatikStasis it's not even about "the crazies", it's more that there is (afaik) no requirement to demonstrate any kind of technical proficiency, nor is there any requirement to show that you can actually keep it secure
 
We should open another chat. Rofl.
 
@DaveRandom It differs by State.
@Allenph Yeah probably best to leave it be. =)
 
IMO the Venn diagram for legal gun ownership and responsible gun ownership should be a circle. Any special interest group that blocks legislation intended to move in that direction is evil and should be abolished.
 
4:30 PM
So... how is the weather in Europe today?
 
hahaha, nice try.
 
I guess I'm evil.
 
yeh this is probably not a good line of conversation for #11, and nor is it one I can particularly be bothered with tbh, because having lived in a country where people just don't have guns I don't have any vague grasp of chasm of cultural differences
@StatikStasis historic
 
It's Friday Eve! Yay!
=D
 
@Allenph ftr I do think there are ways that the system could be tightened up without damaging the property of "balance for govt", e.g. if the manufacturer was made responsible (and liable) for vetting the end user, and their trading license was reviewed, say, annually, by a committee drawn at random from the population by lottery
like I say, I'm not in the "it's all evil and everyone should get rid of their guns" camp, I don't have a problem with the principle of the 2nd amendment
 
4:38 PM
There is no such thing as a system which is not either an oligarchy or mob rule. There's no system where moral legitimacy has been handed to a third party that can be fair and remain uncorrupted.
 
ok, but that's true of the current system as well, it's not like there is no system. Athenian democracy is about as close as you can get to uncorruptable by virtue of the element of randomness
 
Hey everyone, need advise as of how can i generate JSON data from a website so that i can use it for my application
any guidance would be really appreciated
 
@Smple_V It sounds like what you're talking about is scraping. You want to request a website and steal their data basically; right?
 
@Wes not sure if you're referring to my wordpress comment
@mega6382 actually, this chat relieves stress for me
but only when I can get away with laughing when I'm at work
 
Wes
4:45 PM
@Tiffany i am referring to the prepared statements that are not enough to prevent sql injection
 
@Allenph no sir i have my own website written in php where it parses data from a text file(which changes) and shows up there(in the website) i was looking if I could accomplish the same thing to be done to the app side as well
 
Function php_strip_whitespace with multiline array. – #76398
 
Wes
that's because nobody does their job like they are supposed to
 
@Smple_V I don't understand what you're asking for.
 
Wes
there is always one that ruins it for everybody
 
4:47 PM
@Wes I see it as something to keep in mind while working with prepared statements. Mind you, I haven't written any code that utilizes @ircmaxell's answer, but the next time I write prepared statements, I will be referring to that answer to make sure I do it right.
 
Pretty sure the default MySQL charset is safe.
 
now to fix my dev server...
gotta love it when PR is making changes that directly affect the production web server's content ......
 
Wes
you need to know about that answer. it is irresponsible endorsing "prepared statements prevent sql injection" but in reality they don't, not unless you dig in the settings and all the shits
there is no salvation for us
 
@Tiffany Wut?
 
Wes
we are doomed to this shit forever
 
4:49 PM
but partially my fault too
 
@Allenph Like I just want to update a single text file, using PHP i am able to read the text file and show it on the website. I want to accomplish the same task on the application side as far as i have done my research On the android/Ios app side it can parse JSON format , so i was wondering if theres any way that ****i could send the data from textFile as a JSON format**** to the app
 
@Allenph went live with a Wordpress "splash" page. on the dev server, I used some random folder name other than "wordpress" and installed Wordpress in that folder, but when I installed it on production, I used a different name. granted, the stuff in the one folder was copied into the other folder so it should mostly be 1:1, but there are some deviations....
and PR's doing most of this on the production server because I haven't updated the dev server yet to replicate what has been done on the production server
I R Bad Webmaster
 
What are you doing? That text file sounds like it's acting as a database which is no bueno @Smple_V.
And sure. You can send a string in a JSON object or array. Have you even Googled JSON yet?
@Tiffany Shivers
 
@Allenph depends on the server's default setting
@Wes in 99.995% of cases where we encounter it in the west, it won't be an issue
 
@Wes It depends on the charset you use- I guess if you're having to use those charsets then you need to be aware.\
I've never used them for what I do- everything is either utf8 or utf8mb4
 
4:56 PM
@Allenph the text file has lines of content that changes weekly.
 
Yeah. What you're doing is bad @Smple_V.
Regardless, yes you can send that string in a JSON object.
 
5:11 PM
@DaveRandom what kind of stuff is in a project's .idea?
I assume appearance stuff is not right?
nvm found the docs
 
6:11 PM
@PeeHaa I highly doubt it, since the gui is rendered before the project is opened. Stuff like remembering the files you had open and maybe tab layouts might be in workspace.xml, but you definitely don't want to commit that (which I assume is where this is going)
 
Aye
 
@PeeHaa IntelliJ?
 
And yep noticed the open files is only in there
 
AYYYEEEEEEEE!!!! o/
 
Thanks
 
6:14 PM
@Allenph maybe maybe not, e.g. it might be sane to have an rss/atom feed as a static file which is generated like that if updates are infrequent, and I would call "weekly" infrequent. Also we use json-in-file as a storage mechanism for jeeves - it's far from ideal but it works well enough in practice, since writes are rare
 
@2dsharp yes. phpstorm
 
uuh, are */30 17 * * * and 30 17 * * * same?
 
Oh, I didn't know phpstorm generates a .idea too. Thought it was an IDEA thing.
 
Hello, room, been a while. Can hardly wait for spring term to be over and summer term to begin so I can start working on covariant return types.
 
@2dsharp I assume it's all based on the same thing
 
6:16 PM
@DaveRandom Meh. Sure...
It's possible, but if it's coming from someone who doesn't know what JSON is...
 
@PeeHaa A nice and cool Swing app. :D
 
@Ekin the former would act each 0 and 30, whereas the latter only at 30?
 
@2dsharp :)
 
yeah right?
 
that's what I understand too
 
6:18 PM
kk thanks
 
6:34 PM
evenin
@Tiffany Well then I guess that this really is "Support group for those afflicted with PHP." :P
 
!!wednesday
 
Why would a website give a 403 error but still load?
 
@Alesana stupid developer? server configuration error? oversight?
 
6:52 PM
Yeah it's weird, I traced it back to a plugin, or 3 actually
It's on WP :P
If any 1 of the three plugins are disabled, it works, but if 3 out of 3 are enabled it doesn't
 
So, "stupid developer" it is. :P
 
Yup, the WP devs you mean, right?
 
Ofcourse
 
I work with wordpress way too much in my new job
Then they ask me "Why is this website slow?"
 
@Alesana someone forgot an exit.
 
7:06 PM
As in it should be responding with 403 then exiting, but instead it responds with 403 and continues to output the page?
 
I work at an outsourcing firm. So, whenever I get free from a project, I am paired up with a new project manager on a new project. I always try to avoid getting to know or be seen by those project managers that have wordpress projects. Makes my life easy, and keeps me happy. :P
 
I can't blame you haha. I work at a web development firm, I'm trying to get them to move away from Wordpress seeing as it's the source of 75% of their problems
 
@Alesana would be my guess.
 
It's weird though because it's the homepage, shouldn't be a reason for a 403 in the first place
 
7:35 PM
Is it ok to learn PHP with a book that works with PHP5.6? And after that take an overview on what's new with PHP7.
Or are there some fundamental things that changed and should be adapted from the beginning.
 
I would say you're good to learn with 5.6 but wait until someone else gives an answer as well
 
ugh... there was still mysql_* extension back then. It would be terrible to learn that today only to realize it was a waste of time
 
@Strict read from the book, but make sure you're using PHP 7.1 or above.
 
@Alesana part of my morning was spent with wordpress -_-
 
some small stupid mistakes got removed, and you'll be able to pickup using types for parameters and return values, which is the biggest improvement for 7+.
 
7:46 PM
@Tiffany Oh no. Finally I got the go-ahead to redo this one without wordpress
 
\o/
 
\o/
 
8:08 PM
@Strict depends. There are good books that were made for 5.3, that did not have shit content and there are books for php 7.1, that could be used are a good argument for bringing back the tradition of book burning
 
@tereško is it just me or does that sentence makes no sense?
 
It made sense to me o.o
 
it makes sense, but the punctuation is shit (I have an headache)
 
> that could be used are a good argument for bringing back the tradition of book burning
Rofl.
Coworkers are storing 5 different base64 encoded images in 3 different formats in session.
You have got to be fucking kidding me.
 
"could be used are a" > "could be used as a" ... that should fix it, @mega6382
 
8:16 PM
> "There are good books that were made for 5.3 that did not have shit content, and there are books for php 7.1 that could be used as a good argument for bringing back the tradition of book burning"
 
tnx
 
Yeah, I was getting a headache just by looking at it. :)
 
Hey guys, can i know what type of files can be opened using the "fopen" and "fgets" option in PHP
 
all kinds
 
^ that
 
8:20 PM
am using $myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!");
echo fgets($myfile);
fclose($myfile);
 
@Smple_V based on your question, I am guessing that you are about to do something really stupid
 
that was self fulfilling
 
I guess :(
i am trying to read a file and display in the webpage
 
@Smple_V why do you need to know the list of file, that can be opened with fopen?
 
Is there any other way i could do it
 
8:21 PM
what file?
 
txt, I am guessing.
 
@mega6382 are you willing to bet on it with your own money?
 
was doing on the .pages and tried on .rtf still getting the erro
 
I am.
Because he told me so earlier.
 
@tereško nah, fam. :P
 
8:23 PM
all i need to parse the text from a file and display it on the webpage how hard can it be
 
@Smple_V I have never head about *.pages files before
 
With C i can do it in few min, am sorry just am not a pro with the frontend dev
 
@Smple_V You should probably be using a DB.
 
@Smple_V what file?
 
@Smple_V php is not frontend.
 
8:26 PM
@tereško I'm guessing Apple Pages app for Mac. It's more of a desktop publishing software than word processing, but they may have changed it in the past eight years.
 
its a comments.pages or comments.rtf file
@Tiffany yes thats right !!
 
jesus hairy balls
@Tiffany it's basically MS Word's "save as website" option
 
I remember writing a paper for a high school course in Adobe Pagemaker 7... that was mildly painful
 
@Smple_V *.pages files are actually zip archives
as for *.rtf files, there are libraries for that: github.com/jstewmc/rtf
 
@tereško thanks i guess there would not be any easy way to read that, how about .rtf that should be fine i guess
 
8:33 PM
but really, should should have asked for more money
it sounds like one of those "can you migrate our shitty home-made Apple fuckery to a real website" tasks
 
@tereško sounds like something my dad would ask me to do
 
@tereško, yes i believe so. So the best version i came up with is to dump the entire file into .txt version using sublime
 
sounds like a reasonable approach
 
@tereško What did I say? "txt" files. :P
 
@mega6382 don't worry. In 5 years or so you will acquire sense for XYproblem questions :D
 
8:39 PM
well, lets hope so.
 
I loathe PayPal...
 
being on summer hours is weird
 
So, do I, but probably for different reasons.
 
I leave in 15 minutes instead of 45 minutes... the day feels so short, but that's a good thing
 
@mega6382 Screwing up our two accounts for two separate funding sources, and an abomination they call a report.
 
8:49 PM
:D :D :D :D :D :D :D
 
Oh man... I can feel this guy's grief... i.imgur.com/Mfwt44u.gifv?x
 
SiteLock emailed me back
 
someone emailed me aaall their EC2 private keys, ssh creds, login creds for a single server that holds all their xml files... to introduce a prospective project. it is the very first time I am hearing about this project ... isn't that like throwing all at me and pointing me saying, here, makeithappen!11 :p
 
...they actually emailed me May 14th... and I didn't see the email... ...I'm a dumbass
 
@Tiffany for the job?
@Ekin and hoping that you won't do anything sinister with it.
 
8:53 PM
@Ekin sounds like that, a lot. It also smells like run as far as you can, in the very opposite direction
 
@mega6382 yup
 
@Tiffany so, what did they say?
 
@mega6382 just the initial "hey, we're interested, let's schedule an interview"
 
Great, btw did you ever hear back from digitalocean, for that technical writer job?
 
@mega6382 well, it's someone I've completed a few projects with before
 
8:56 PM
@mega6382 yeah, rejected
I kind of expected it
¯\_(ツ)_/¯
 
@Ekin Oh, I guess then that makes a bit more sense :D
 
@FélixGagnon-Grenier yeah, feels that way. I also seem to have new relic and a bunch of other tools ready etc
 
@Tiffany Did they give a reason? Because I too got rejected and the reason was that "I was not in one of the countries where they were hiring"
 
but no proper brief at all, just all whatever login they have ...
 
they might be utterly confused as well
 
8:58 PM
> Thank you for your interest in working at DigitalOcean. We reviewed everything you shared with us and while we were impressed by your skills and enthusiasm, we will not be moving forward with your application for the Technical Editor: Linux or Development role at this time.
 
lol
 
!!should I discover it myself or just email back
 
You should just email back.
 
fine
 
9:27 PM
...
!!should I hate PayPal or just love PayPal
 
You should just love PayPal.
 
@Tiffany is that an american thing to not tell the candidate the reason for rejection?
 
@PeeHaa Jeeves is broken!
Yeah, they don't have to tell you anything other than you're rejected.
 
@tereško here, they don't even tell you that you are rejected. If you don't hear back from them, it just means that you were rejected.
 
9:31 PM
They do that here as well. In fact that is the norm.
 
Ugh
Oh lol
...
:p
 
Wes
@DaveRandom did the logo work?
i'm not actually interested, just pissing off @PeeHaa as i haven't finished his yet :B
sorry :B
 
9:54 PM
@tereško companies have started doing that in the UK. At least in part it's due to psycho people going psycho after being rejected.
 
10:11 PM
@Wes yeh it's great, thanks :-)
 
Wes
:B
 
which logo?
 
Wes
nothing interesting
 
still
 
I really wish there was a "catch everything except <types>" construct
 
10:21 PM
@DaveRandom Just write your exceptions so that they implement some interface.
 
I often seem to have code along the lines of try {} catch (Some | Exception | Types $e) { throw $e; } catch (\Throwable $e) { throw new \Error('unexpected error'); }
it would be nice to have try {} passthru (Some | Exception | Types) { /* this is only executed for types that don't match */ } or something
@Allenph I just use unions, I only write for 7.2 unless I have a very good reason not to
 
Seems like that would be hard to maintain?
I mean some cases where two separate interfaces don't belong together, sure...but.
 
I think this is a problem I encounter exclusively at public API boundaries
i.e. public API method will generally be wrapped in a try/catch, which passes exceptions throw by the public method (i.e. things that are part of the public API) and has a catch-all \Exception block at the end, to convert other exception types to a type that is part of the public API
unhandled \Errors are allowed to bubble, because they indicate a bug
@Allenph so in short, no it's not hard to maintain because it just needs to match the public API
 
That makes sense.
 
@DaveRandom when I can be arsed to do that properly, I just catch everything and convert it into my own exception type for that library. It doesn't make that much difference if the library knew it was going to throw that type of error, or if it's a coding bug.
 
10:37 PM
@Danack sometimes yes, but sometimes I want to throw more granular types than that, typically because it's good as a lib consumer to be able to quickly identify "I did something dumb" vs "something went wrong which is not necessarily my fault"
essentially the RuntimeException vs LogicException thing, where spl had the right idea but implemented it very badly
as a concrete example, I would definitely not want to wrap a TimeoutException because a consumer might reasonably have a catch block for that specific case that will retry
 
Wes
catch( ~(Some | Exception | Types) $e)
 
@Wes yes I thought about that, but it looks like an expression, which is sort of weird
 
@DaveRandom … it is meant to be a type expression
 
I guess
 
@DaveRandom someone introduce union types in PHP, everywhere........
 
Wes
10:51 PM
i am unsure about not though
 
@Wes not as part of the typedef, no
 
Wes
anything but x seems quite a strange use case
 
Why do I get the feeling that the use of unions could quickly get out of hand?
 
Wes
wanted to link a site from my own but apparently i cannot link anything on that site because it has csrf protection everywhere
i thought well, i'll link the page where you can find the link i wanted to link - also that is csrf protected
but you can link the homepage :B
 
@Allenph yes I am also on the fence about whether it adds enough value to be worth the horrific things people would do with it
I want callable signature decls much more than I want type unions
 
10:56 PM
I feel like I would use unions from a desire to do good. But through me, they would wield a power too great and terrible to imagine.
 
Wes
maybe there's a good reason for that
 
I think in most cases what people actually want when they think "union" is "method overloading"
 
Wes
i knew a guy that did the most acrobatic class hierarchies. like dozens of classes just to have the type hints working correctly
i'd say that unions are a 100 times less terrible than that :B
that guy was me tho.
 

« first day (2784 days earlier)      last day (2179 days later) »