« first day (1648 days earlier)      last day (3303 days later) » 

user895378
2:01 PM
PSR lost me forever when they mandated the use of Interface suffixes.
 
They did what now?
 
user895378
I think the very first chapter of Clean Code talks about not adding gratuitous context.
 
@rdlowrey which psr did that?
 
@rdlowrey they lost me on the cache PSR
lerdorf.com/d8.html#/drupalbench <-- stolen from the irc channel
 
gOOD MORNING
 
2:03 PM
Ah. I've read "The Clean Coder", but not "Clean Code"
 
user895378
@PaulCrovella not sure. It's in style guidelines or something. All PSR interfaces have to be suffixed with Interface
 
@PaulCrovella 2 - the coding standards one.
IMO, it's the only part of the coding standards that actually makes a difference (bracket placement, tabs/spaces don't really) and they choose......poorly.
 
@Danack where? I see a FooInterface used in an example, but no rule about it
 
posted on April 21, 2015 by kbironneau

/* by nidecondor */

 
hi guys
 
2:06 PM
hmm.
 
user895378
It may not be mandated for user code, I don't know. But any interface in a PSR has to have it. If you mandate the use of bad naming practices in your standards I immediately don't trust you as being an authority on anything.
 
please help me with this query .. sqlfiddle.com/#!9/646bf/2
 
> Closures MUST be declared with a space after the function keyword
dafuq
 
@PaulCrovella ah - a byelaw rather than a full on PSR.
 
if there is 10k records for user2 then it slow down the result
 
2:07 PM
> There are many elements of style and practice intentionally omitted by this guide. These include but are not limited to: ... Class name prefixes and suffixes
 
user895378
@PaulCrovella class != interface
 
> The term "class" refers to all classes, interfaces, and traits.
 
oh-snap.gif
 
yup
 
user895378
@PaulCrovella lol we're looking at different documents then.
 
user895378
2:08 PM
> Interfaces MUST be suffixed by Interface: e.g. Psr\Foo\BarInterface.
 
@rdlowrey you're looking at a bylaw, i.e. for things released by Psr
 
user895378
@PaulCrovella right. It's not a user code requirement. It's a FIG code requirement.
 
@rdlowrey yeah, you probably are looking at the bye-law, not the full psr, which also confused me.
 
user895378
Either way, it demonstrates that they don't know what they're doing. Yet they set themselves up as authorities. Which is annoying.
 
2:09 PM
phew
 
I have to admit - I'm thinking about changing from:
function foo() {
}
to
function foo()
{
}
 
and tabs.
 
@Danack +1 :D
 
user895378
I used to do the latter because I found it more readable but everyone yelled at me.
 
@Danack Do, +1. But no tabs, @FlorianMargaine Is just a troll :P
Also Florian where has your face gone?
 
2:11 PM
@Jimbo my 5-years-old face is too old
and since I don't have a recent presentable selfie...
 
That was 5 years ago... you've been lying to us!
 
I guess I should use this, but I look fat
 
@rdlowrey there are better things to harp on than a naming convention they chose to use internally - that's just petty
 
user895378
@PaulCrovella I'm not harping. I don't care. They make bad decisions. Simple as that.
 
@rdlowrey Xcode does the inline brace for generated code, it's really irritating ... after so many months you would think that they know what you prefer ;-)
 
user895378
2:13 PM
@PaulCrovella But if I want to implement any PSR I'm subjected to that naming. It's not internal.
 
user895378
And it makes my code ugly.
 
@Ja͢ck oh right, you're an iOS dev...
 
No, I'm a developer.
 
user895378
class MyImplementation implements StupidFigInterfaceInterface {}
 
user895378
^ not internal.
 
2:13 PM
@FlorianMargaine just change the width to 50%
 
@Ja͢ck Not since you left PHP you aren't!
 
@Patrick lol
 
@Jimbo Didn't you know that PHP is like the Hotel California?
 
@Ja͢ck Caliphpornia
 
lol
 
2:14 PM
^ according to ircmaxell
 
hehe
 
That puts 'porn' in the name though
 
And rightfully so
 
I guess, PHP is getting pretty explicit
 
user895378
Suffixing with Interface is lazy. It means you didn't think through your problem enough to know how to solve it and couldn't come up with a meaningful name. If you can't meaningfully name your interface without that gratuitous context you've created a bad abstraction.
 
2:15 PM
Explicit and gratuitous
 
@rdlowrey you should put this on a PSR
oh, wait.
 
lol
I think we should fork PSRs
 
@rdlowrey yes, how dare someone release code without running it by you first to make sure your code is not offended. what monsters.
 
Room11-voted
 
user895378
@PaulCrovella Now you're being petty. No one said that.
 
2:17 PM
15 mins ago, by rdlowrey
PSR lost me forever when they mandated the use of Interface suffixes.
 
user895378
1 min ago, by Paul Crovella
@rdlowrey yes, how dare someone release code without running it by you first to make sure your code is not offended. what monsters.
 
user895378
those aren't remotely the same thing
 
That's why I hate general rules made by whoever. It only causes pain and disgrace without real benefits - and these styling rules are rarely necessary.
 
@rdlowrey yeah, mine was hyperbole to mock you blowing small things out of the water
 
@Jimbo Now that the internals drama is gone, let's create some community drama instead ;P
 
2:19 PM
@marcio There's another downside, even if the choices made now are the correct ones. It makes it harder to evolve to new standards in the future when they become not as correct.
 
@Patrick Agreed. We could even start putting messages in the C++ room like "C++ sucks!!111", because it does.
 
user895378
Have a nice day, @PaulCrovella :)
 
That's not the only small thing @PaulCrovella blows.... ? Nobody?
It was right there!
 
Not everything revolves around your small thing ;-)
 
@Jimbo they are very protective when it comes to their language
 
2:22 PM
@tereško When something's dying you have to protect it :-)
 
lol
 
@rdlowrey my point is that yes, mandating Interface suffixes is stupid - it's just more stupid to look down your nose at someone for doing it
 
hell, outside JS and PHP communities, it is not all that common for developers to openly state that their language-of-choice is pile of ducktape and shit
 
@PaulCrovella did you follow the whole conversation? ... we were talking about why the Interface suffix has become so common in the php community
 
yes, I did
 
2:25 PM
@tereško that's why I like these communities, they admit things are wrong and evolve what's possible - I'm sad about JS though, these people trying to stuff class in a prototype language are mad!
 
user895378
@PaulCrovella The problem is that FIG sets itself up as the authority. If they didn't do that I wouldn't care. But once you establish yourself as the be-all end-all of good PHP coding practices you open yourself up to criticism when you do stupid things.
 
Being 6ft5 I look down my nose at most people.
Peasants
 
user895378
Hmm ... is there an easy way on bugs.php.net to see bugs assigned to me that I've closed?
 
@rdlowrey I wonder, why people who insist on Interface suffix start to look at you funny when you agree and suggest also to use Class suffix for additional clarity
6
 
@rdlowrey they are only authorities among frameworks that participate on FIG, I don't see people following their rules like sheep outside the framework/package world
 
2:27 PM
@rdlowrey Funny thing is, if you ask the FIG, they'll deny wanting/trying/being the authority. I think in part it's "the community" latching on to something they shouldn't.
 
user895378
@marcio I do.
 
@salathe it's also them denying the truth
 
user895378
@salathe Until they want to put their reccommendations in core
 
@marcio I guess you haven't seen the "OMG this isn't PSR-x compliant" issues on GitHub :P
 
@marcio yeah what @salathe just said
 
2:28 PM
@ircmaxell You think they're the authority?
 
Try to have sane tickets on OSS projects on github
 
@rdlowrey Heh, SplClassLoader :D
 
@salathe nope, lucky here
 
@salathe That's exactly what I was thinking. They'll deny doing it, and as a result, naive people will be like "ooh, they don't want to force us, that's what I like about them"
 
@rdlowrey Is it just my cache or do you really have your old image as avatar again?
 
user895378
2:29 PM
I misspell recommendations every single time I type it.
 
user895378
@bwoebi I've been rotating my gravatar a lot lately for no reason.
 
@salathe no, but I think they are positioning themselves as it (or one), yet denying that fact.
 
@ircmaxell Oh very much so. They'll say they're not trying to steer the whole PHP developer community, but they are... that much is plain to see.
 
yeah but a few years ago I think
 
2:30 PM
yup
@salathe which isn't a horrible thing, as long as they recognize and accept the responsibility they are assuming
 
good read? I'm ordering new books
 
I can't remember anything from it now that I think about it :(
 
@iroegbu Yes, it was awesome and scary when I read it, as half the things in it I agree with, the other half I don't agree with yet, but suspect I will one day.
 
@ircmaxell which they won't do (or more correctly, haven't historically done)
 
@ircmaxell I sometimes wonder why they try to standardize things which don't need a common standard…
 
2:31 PM
@bwoebi such as?
 
@ircmaxell PSR 7 is my first thought
or also PSR 3
 
see, I see that as one that's important to standardize upon
psr3 is a bit overkill, but 7 is really needed if you want to do anything non-trivial
and considering each framework has had their own for the past 5-10 years...
 
Oh. I don't mean a great common standard would be bad for PSR-7, but I don't see a way how we could satisfy even 50% at all
 
the problem is not with standards, it's the scope - you can't make standards to cover all the use cases and they often try to (and fail)
 
it's more about the doors that such a standard would open up
 
2:37 PM
Is there a function that copies all data from one file handle to another file handle?
 
@marcio Yes. The whole scope doesn't need a standard. But it'd make sense to standardize some subsystems here.
 
@Danack stream_copy_to_stream
 
ta.
 
Any idea on how I use SSL in an Android Application? I'm working on implementing 0Auth2 now. — MiKenning 20 mins ago
 
@ircmaxell I'm not sure about the doors it'd open up. Well, surely, you now could just pass your request/reponse object into another library… But you shouldn't do that. You should give the library the data you need and feed it back into the objects at the calling level.
 
2:41 PM
why shouldn't you do that?
also: think bigger
 
Separate systems. Retain control.
@ircmaxell Not sure what you mean with think bigger?
 
if they can communicate using messages both understand, there's no loss of control or separation loss by using the same request/response objects between libraries
@bwoebi think SAPI
 
But who decides on the format of that message they can both understand?
A few people in the community who use basically the same frameworks / components
 
you can participate in it too you know
 
Honestly - I'd need to get to a position where my opinion carries weight within the community for it to be even considered
That's years away
(if at all)
 
2:46 PM
no you don't
 
user895378
The HTTP part of the standardization is trivial. I think the problems come from missing PHP functionality.
 
user895378
To have a useful http standard you need a good stream abstraction of some kind and PHP doesn't have that.
 
@ircmaxell I mean, for there to be any yield from my input.
 
@Jimbo again, incorrect
if you give useful input, people will pick it up.
 
user895378
But beyond that, creating the right stream abstraction is more difficult than it seems.
 
user895378
2:47 PM
You can't represent HTTP entity bodies without a standardized stream abstraction.
 
user895378
But even then it's very difficult to model streams in a way that satisfies the majority of use-cases you might encounter for an HTTP entity body.
 
@ircmaxell The problem is at the level where APIs are mutable. [I see what they did with immutable API there.] But immutable APIs have their own issues... Like that each time an external API wants to modify a passed object it has to create a copy.
 
@bwoebi so what?
who cares if it has to make a copy
that's a good thing
 
user895378
Yeah ... immutability is great ... until performance matters.
 
even then
 
2:49 PM
even then?
 
user895378
If you enforce immutability on a PHP HTTP server your PHP HTTP server will be useless a joke.
 
uh huh
 
It's a good thing at a theoretical level… I'm not so sure about real world ;-)
 
user895378
The PHP web SAPI is an environment where performance never matters (relatively speaking).
 
2:51 PM
(I wonder how many desks @ircmaxell has broken with his head until today…)
 
@rdlowrey my assertion would be if you're making so many changes to the request that immutability costs you non-trivial amount of perf, the changes are what's wrong, not the immutability.
 
user895378
Immutability in the http standard is great for 99% of people so it makes sense to me in that psr case.
 
Are there any Symfony programmers here that know to use font files in css? My routes always result in a 404
 
user895378
@ircmaxell I can agree with that. I'm talking more in blanket statements like "everything in the applications is immutable" than in specifics like "this one thing is immutable" ... I think the immutability thing is the right choice for what the http psr is trying to do.
 
@ScubaKay Symfony (or even better - any php framework) shouldn't intercept requests for static files
 
2:54 PM
I don't use @throws because it ruins the element of surprise.
 
user895378
@DanLugg php-roulette
 
^^
 
@rdlowrey oh, I'm not saying everything should be immutable. Not by a long shot. But I think the request being immutable is worth it (messages)
 
Fatal error: Uncaught exception 'BetYouDidntSeeThatComingException'
4
 
@rdlowrey Agree. It's the right thing to do. I just wonder whether it'll satisfy devs…
 
2:55 PM
@nikita2206 The font files are in the web folder, but the browser can't find them. It seems that it's looking for a route, which is weird, i think
 
@bwoebi when they see what's coming down the pike with it...
 
user895378
@ircmaxell Totally agree. The only place a request should be modified that I can think of is "URI rewriting" ...
 
@ircmaxell coming down the pike with it? I don't understand the English, may you rephrase?
 
@SergeyTelshevsky This cake tastes like spaghetti.
2
 
2:57 PM
@ScubaKay yes it is. that shouldn't happen, probably your webserver configured wrongly (it sends requests for static files to the front controller)
 
@bwoebi "coming down the pike" = "When they see what is about to happen"
 
@DanLugg This cactus tastes like...
 
@Machavity Ah, thanks
 
@DanLugg spaghetti-flavored cake... so lasagna
 
lol, ICWUTUDIDTHERE
 
2:59 PM
@nikita2206 That makes sense
 
/me made many evil plans over the weekend
 
@nikita2206 Maybe something's wrong in the .htaccess
but that wouldn't explain that my css files are being served in the right way
they just work
 
@ircmaxell (He plans to install himself as dictator in PHP…)
 
@ircmaxell Strict Type Hints with blackjack and hookers?
 
@bwoebi nope
@Machavity less STH
 
3:01 PM
@ircmaxell That wasn't serious… but what did you mean?
 
I meant that 7.1 and 8.0 have direction now ;-)
 
Already 8.0? And which direction?
 
foo
 
user895378
@ircmaxell do share
 
user895378
Because I haven't talked to anyone really about plans for 7.1/8
 
3:03 PM
... :-X
 
forwards ofcourse
 
user895378
Or are these secret yet-to-be-blogged-about plans to take over the world ... ?
 
@rdlowrey that
 
@NikiC bar is also nice
 
except plans implies too high level. These are in motion. It's already begun
 
user895378
3:04 PM
okay fine :)
 
@nikita2206 I have a question on SO about the matter: stackoverflow.com/questions/29771557/… Would you take a look at it for me?
Anyway, thanks in advance
 
http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_builtin_functions.c#2456

[tag:head-desk] yeah, no wonder that backtraces in phpdbg are weird…
 
I will be going home now
 
@ScubaKay show your htaccess
 
@nikita2206 You show me yours and I'll show you mine.
isDefaultValueAvailable Y U NO hasDefaultValue -- serious question, what was the rationale in this naming choice?
 
3:12 PM
hehe
 
^^ ReflectionParameter for clarity
 
@DanLugg ummm... have you looked at the standard library in the past 15 years?
 
@DanLugg I knew you'd like it
 
@ircmaxell Sure, but even still. get*, has*, set*... I mean, someone had to think about making this decision, no?
 
have you looked at SPL?
 
3:16 PM
The questions you're answering my questions with are causing me grief
 
:-P
 
I've been out of the loop, so prolly discussed to death; but is there any chance of aliasing for 7?
I mean, it'll fubar the API for a minor, but still.
 
@DanLugg you know, in case it has a default value that isn't available
maybe the default value has a date that night, or is dying her hair or something
 
Fatal error: Call to function 'foo' could not be resolved; default value for argument '$baz' is in the shower.
3
 
E_DEFAULT_VALUE_DOESNT_FEEL_LIKE_TALKING_TO_YOU_TAKE_A_HINT
 
lol
 
awesome
does he have a dmv.js too?
 
Anyone feel like creating a function which groups an array of numbers in to a multidimensional array of based on the range between them with a sensitivity setting? Nope? Oh okay.
 
@Fabor Man, I wanna help you but I, uhm, just signed up for a colonoscopy. So sorry.
2
 
lol
 
3:38 PM
1 message moved to Orphan GIFs
 
I'm sure this'd be more fun if I was any good at math.
 
@samaYo Where is it?
 
3:54 PM
Given file scoped use A as B; would it be insane to support file scoped use A::x as A::y;, in the same vein as trait member collision resolution?
 
yes, it would be insane
 
use Named_Stupid as BetterName;
use BetterName::evenStupider_naming as muchBetterName;

(new BetterName())->muchBetterName();
^^ Yea? Insane?
 
@DanLugg Just fucking give your stuff the correct name to begin with :P
 
or wrap it in a Facade to hide the dirty one
 
@PeeHaa Did you address that message to the universe? Or just me? Because I'm pretty sure I'm doing okay.
 
3:57 PM
Both :)
 
@ircmaxell Fair, but it seems a problem better solved with aliasing, rather than introducing facades.
 
lol
 
hey
 
@DanLugg no, it's a problem better solved with design, not weird renaming stuff
 
yo
 
3:59 PM
@ircmaxell is abusing his mod powers
 
yeah :-)
 
@NikiC ?
 
lol @ kickban :-P
 
1 message moved to bin
@DaveRandom :-P
 
hehe
 
4:00 PM
@ircmaxell Arguably it's a problem better solved with not naming shit stupid to begin with, but I guess I just disagree that I should introduce whole definitions to accommodate for someone mashing the underscore key.
 
Did you ever get to the bottom of who created that twitter account btw @ircmaxell?
 
@DanLugg Isn't it likely that name of the thing isn't the only problem?
 
@PeeHaa Certainly, but we all know the internet is held together with bubblegum and string
 
@DanLugg At best
 
I find it easier to work with if the string is at least a fitting color
 
4:02 PM
@DanLugg Grey and frayed, as if it was found outside in a puddle?
 
Is there any sane way to encrypt data in mysql and still have it sortable and full text searchable?
 
@DaveRandom which twitter account?
 
@PeeHaa I just read Is there any sane way to do <arbitrary task> in MySQL?, and the answer is always no.
@ircmaxell The one with the w
 
@DaveRandom Useless as always :P
 
@DaveRandom I do :-P
 
4:05 PM
@DaveRandom The answer is always PostgreSQL ;)
 
Fine, I'll ask... So is there any sane way to encrypt data in postgresql and still have it sortable and full text searchable?
 
Although to be fair, I can't envisage any mechanism to make that work regardless of the software, if you are going to encrypt the data it's going to be slow to search because you have to either decrypt it for comparisons or cache a decrypted version in memory for fast lookups, which mostly defeats the object of the exercise of encrypting it in the first place
 
posted on April 21, 2015 by kbironneau

/* by Baba */

 
@DaveRandom @PeeHee didn't say it needed to be fast :)
 
@DaveRandom Yeah thought so. I thought perhaps there was some smart way
 
4:08 PM
It's not exactly an area I'm well versed in though...
 
brb hunting for food
 
Hi.
Anyone knows woocommerce plugin of wordpress?
 
user895378
@PaulCrovella oh my.
 
user895378
4:18 PM
wow.
 
I want to get only subscriptions of User,..
 
user895378
I love that the article is titled "How to Search Encrypted Text"
 
yeah, the entire idea is somewhat counter-productive
 
0
Q: A Router I coded

Hassan AlthafThis is router I created for use, however, I wish to refactor this code and make this more robust. I would really appreciate anyone who can: Point out how to make this code more robust, clean and flexible. Point out where code can be refactored and possibly how. Point out how the code could be ...

@PaulCrovella Wish good luck to the author from me.
 
user895378
Recommended read ... saw this on HN yesterday. It made me feel like I need to seriously overhaul my digital life: begriffs.com/posts/2015-04-20-going-write-only.html
 
4:29 PM
@PaulCrovella o_O
 
Any one got any ideas why my mock is not being created? stackoverflow.com/q/29777553/1582238
not really sure how to link a stack question properly, sorry about that
 
["Be careful about using the following code - I've only proven that it
works, I haven't tested it." - Donald Knuth](https://i.imgur.com/Ipm3ody.gifv)
 
@PaulCrovella UHHHHH
 
@PaulCrovella That looks scary as F ....
 
how the crap did i screw up that link
 
4:37 PM
new line
 
sonofa...
 
So I have no ideas what I am doing >.>\
 
-4
Q: How do I use password hashing with PDO to make my code more secure?

starkMy code is actually working but it's not at all secure, I don't want to use MD5 as it's not all that secure. I've been looking up password hashing but i'm not sure how I would incorporate it into my code. Login: require_once __DIR__.'/config.php'; session_start(); $dbh = new PDO('mysql:host=' ...

 
@rdlowrey Interesting perspective. First comment on HN also relevant: <<The author should be careful not to confuse a desire for focus and on the lasting rather than the ephemeral with a fetishisation of the past, of the "authentic", and of the "natural". It is all too tempting to step from use of survivorship bias as a tool, as a filter, into a false belief in the superiority of things past.>>
 
4:53 PM
@rdlowrey Bookmarked. Skimmed it just now; looks interesting.
I already follow some of that advice (being write-only on twitter, for example) so it probably aligns somewhat with my world-view.
 
<?php
namespace Users;

interface UserRepository
{
    public function updateField($field);
    public function getField();
}
Guys, I have that interface.
But, I want to allow some more parameters if they are required.
How would I achieve that?
 
Smalltip: if your namespace is "Users" then why prefix "Repository" with "User"?
 
For clearness' sake? :P
 
I think Users\Repository is every bit as clear as Users\UserRepository but is shorter.
I like brevity.
I'm not sure what a "field" is, and why do some fields have more required parameters?
 
A'ight, I'll do it.
Urm, stuff like if they require a condition
class Username implements UserRepository {
    private $database;

    public function __construct(PDO $database)
    {
        $this->database = $database;
    }

    public function updateField($username)
    {
        $statement = $this->database->prepare("UPDATE users SET username=:username WHERE id=:id");
        $statement->bindParam('id', $id);
        $statement->bindParam('username', $username);
        $statement->execute();
    }

    public function getField($id)
    {
        $statement = $this->database->prepare("SELECT username FROM users WHERE id=:id");
You see that, getField may require an id, and may not.
 
4:58 PM
how can a field not require id?
 
yeah, and if you're using it in a context where that is lost, then apply the context via a use alias there
 
@FlorianMargaine it may require more than one parameter though.
@ircmaxell what do you mean?
 

« first day (1648 days earlier)      last day (3303 days later) »