« first day (2440 days earlier)      last day (2508 days later) » 

6:00 PM
@PeeHaa The ultimate goal should be storing tables of types, yes?
 
@Ocramius Cheers, was trying to find the simplest example of it working. There's nothing on StackOverflow ;)
 
I don't know what types mean
 
For once, it's in the docs :D
 
No way
Crazy stuff
 
you have an array with all posts in a specific order now you want to display some of those posts so you lets say you wanna display 0-20 so you loop through that and display all of them but now lets add filtering and that filtering will filter out all but 3 of the 20 posts so now you're only displaying 3 posts instead of 20.
 
6:02 PM
using proper database queries instead of going the eloquent route
 
how should i handle that so im always displaying 20 posts
 
@PeeHaa Let's say you have a piece of data that has some weird rules for being valid. Like a phone number. It is a string or integer, but it has to meet a specific format in order to be a phone number. As far as I can tell you have 2 options...

1) Have a validation service that you have to run all over the place.
2) Consider the phone number a type which is its own domain object.
 
@user7594714 How do you do it without filtering?
 
I'm not using Eloquent.
 
That was not for you
 
6:04 PM
I'm just using a query builder and making my own repos.
@PeeHaa Oh.
 
@Allenph Both work fine depending on the use case
 
@user7594714 Your clarification made less sense than the original question.
 
damn
 
Are you trying to order objects or filter them?
There's a difference.
@PeeHaa 1 seems super icky.
 
Why?
 
6:06 PM
2 seems good but lends itself to being its own table.
 
Why2?
 
@Allenph validate the input, then have a value object to represent the phone number
so combine both options
 
@Patrick Well, the domain object would HAVE a service.
 
new Employee(PhoneNumber $phoneNUmber)
 
Just like all domain objects.
 
6:08 PM
What @Patrick said
 
@PeeHaa Exactly.
 
Has nothing to do with storage at all
 
@Allenph what?
you should only use domain services sparingly
unless you are talking about application services
 
@Patrick Actually, just kidding.
 
And has reeeally nothing to with storing it in the same table because it has the same label
 
6:09 PM
That would be in the constructor, probably.
 
riiiite ;)
 
@Patrick What are you talking about? Service, domain object, repository, aggregate.
 
lets say i have a an array with numbers all in order 1,2,3,4,5,6,7,8,9,10,11,12 and currently im displaying 2 numbers per page so to get the start point per page I take the page number then multiply it with 2 and to get the end range I add 2 to the number so for example page 5 the startpoint would be 10 and end range be 12
 
@PeeHaa Yeah, it doesn't this was a sidetrack a bit. I'm talking about two objects which should be flat, but have a lot of similar columns.
 
@Allenph your question. validate input in the application layer. use value objects in the domain layer for the phone number. If you want to be really defensive, validate in the constructor again and throw an exception if it's invalid
 
6:11 PM
Not just one.
 
@user7594714 look up pagination
 
now lets say i add filtering and now only 1,5,7,9,10 would be valid numbers so on page 1 i get 1 number instead of 2 because page 1 got the range between 0-2
 
If the things are different things they are...
drumroll
different things
 
wat =p
 
My billy cabinet also has a height just like an employee
And a weight
And a name
 
6:13 PM
better solve that with inheritance @PeeHaa
 
@user7594714 Manipulate the indexes rather than the numbers.
That will solve the problem.
 
@RonniSkansing :P
 
I actually lolled on that one
Good thing nobody is here :D
 
6:14 PM
@PeeHaa What would warrant a flat domain object spanning multiple tables then?
 
tables?
 
@Allenph don't couple your domain to your storage
you can store your domain object in one table, 100 tables or in a text file
 
@Allenph what you mean?
 
@Patrick Let's say I'm coding a repository. I get handed a flat domain object.
And the repository is interfacing with a relational DB.
 
/me is packing bag
 
6:16 PM
By flat, do you mean hydrated?
 
In what case should I spread the flat object over multiple tables?
 
@PeeHaa where you going?
 
@Allenph whats a flat domain object?
 
@RonniSkansing Kuşadası
 
@Jimbo unless it's by beer, hydrated doesn't mean anything.
;P
 
6:17 PM
It's an object with one dimension of properties.
 
@PeeHaa bless you
 
:P
 
@Allenph the repository is responsible for saving and retrieving. it does all the mapping between domain and storage
(or a datamapper)
the domain object doesn't care how or where it's stored
 
Yes.
 
@PeeHaa thats looks chill
 
6:18 PM
Exactly.
 
> assignment of the contents of an array into properties on an object through a "hydration strategy" (assigning to public properties, calling setters, etc). The inverse, extraction, is creating a key=>value array from the properties of an object.
^ Hydration. Although this should be a wikipedia article actually
 
I don't like the hydration term. Is anyone using that apart from doctrine?
 
BTW @NikiC @Andrea @bwoebi @phpeople that doxygen thing sounds like maintenance and instant lack of maintenance waiting to happen. Am I seeing it right?
 
@Patrick Hybernate does
 
@Patrick java
 
6:19 PM
78
A: Clarifying terminology : "Hydrating" an entity : Fetching properties from the DB

ocodoHydrate began as a term for populating an instantiated (but empty) value-object/model from a db, (specifically in Hibernate.) Various other ORM's and tools like BizTalk use Hydrate and other related terminology these days, (e.g. BizTalk uses the term Dehydrated to mean an instance is available b...

 
That being said, I also don't like public properties and setters
 
Now I'm really packing
@RonniSkansing It will be :)
 
> Hydrated and its related collection of redundant metaphors are just pure marketing fluff; they really have no place as technical terms.
So, actually, we mean populated.
It is marketing speak, tbh
 
pastebin.com/aW7piwJs - it looks for example like that
 
$flat = (object) [
  "foo" => "bar",
  "bar" => "foo"
];

$notFlat = (object) [
  "foo" => "bar",
  "bar" => (object) [
    "foo" => "bar"
  ]
];
 
6:20 PM
@PeeHaa maybe. I voted against on gut feeling but might take it back
 
^ That's what I mean.
 
So you mean scalar? Flat = scalar?
 
@Jimbo yeah sorry, I was trolling :)
 
@FélixGagnon-Grenier Interesting though, I learned something ;)
 
shit. now I want a beer.
 
6:21 PM
@Jimbo Sure.
 
Because the trolling failed? :D
 
^ That kind of stuff is what I missed out on when I didn't go to school.
 
@Allenph Okay - not being pedantic, we all need to be on the same page to chat :)
 
I completely understand.
 
Does this explain it better
 
6:22 PM
@Trowski When do you have time?
 
@Allenph did you get an answer to your question?
 
@Patrick No.
I know about data mappers. The question is much lower than the paradigm involved.
 
all i need to be able to do is calculate the end point
 
@Allenph can you state it again now that we are all on the same page?
 
and when i do that everything else falls in place
 
6:24 PM
@PeeHaa I don't know.
 
@Patrick Say I have a scalar domain object. In what case, if there are any, will that object be represented in a relational database by multiple tables?
 
@Allenph legacy db for example
 
In what case, if there are any will I decide to do it while constructing a brand new app, then.
 
@Allenph keep it simple
 
any ideas?
 
6:26 PM
Maybe in CQRS + ES your projections are duplicate data but much more refined - so you would have the data stored in multiple places (multiple tables, persistences etc)
 
@user7594714 What is your question?
You have an array there and you have a subset.
 
@bwoebi Should we change DNS to use option objects instead of arrays, too?
 
@PeeHaa at least at some level, (apart from the public API maybe) documentation doesn't really make it easier. You need to know what's going on in order to still write performant code. You need to understand the underlying manipulations and side-effects. Documentation is a waste of time there…
@kelunik I don't object.
 
So, I should not be translating the requirement of the code to have a phone number object to the DB.
I should just store it in a column and give it meaning in the app.
 
@bwoebi Do you have time to discuss a refactoring?
 
6:29 PM
If that is the case, I don't see much use for a join.
 
@kelunik Of amphp/dns?
 
Yes.
 
I'd like Chris to be here too then
 
@DaveRandom ^
 
@Allenph yes. value objects are usually just one or more fields on a table
 
6:30 PM
Even if he's not here right now, we can start discussing. He said he'll have time tomorrow.
 
@Allenph did the pastebin clarify it?
 
@kelunik Do you have something concrete? I haven't yet dived into his ongoing refactor …
 
mornin
 
tnx @Andrea @bwoebi
 
morning
 
6:35 PM
@bwoebi I see what you did there
 
@PeeHaa … no pun intended, lol
 
@bwoebi Didn't either. I think we should have a TcpTransport and UdpTransport assigning request IDs and sending the requests, automatically using new sockets once the request IDs overflow. The actual resolver doesn't have to care about that then.
 
:D
 
@user7594714 No.
You simply showed me that you have a set of data and a subset.
What's the issue?
 
@kelunik possibly, but that's why I'd really like to have Chris here, he knows best about the requirements and restrictions…
 
6:36 PM
@Patrick Anything that spans multiple columns and is common should probably be a domain object then, huh?
Like an address.
 
@Allenph depends. are you doing DDD?
 
Yes.
@user7594714 No.
 
then I would say that's probably a value object
at least on the write side
I prefer a thin read layer
 
@Allenph did you check the latter part
 
6:41 PM
@Patrick Good article. I just skimmed. I'll take a look after work.
 
it only returns 3 values but id like it to continue till it get 3 more
 
@user7594714 Then what's the point of the filter?
 
it filters out to get more specific stuff
 
You are explaining the data well, but explaining the problem domain extremely poorly.
 
@Allenph verraes.net has some more good stuff on DDD
 
6:42 PM
lets say the numbers are posts id
and the filter checks if the posts is from x author
Now id like it to continue till it get 6 but i always need to be able to calculate the end point so I can get the next page start point
 
Question about Commands Handlers and Aggregates: is it common and good practice to put command handler method inside aggregate root class? My collegue was asking this to E.Evans and they've discussed this as optional practice but I cannot find any examples in the internet as a proof
 
@Patrick Bookmarked.
Thanks.
 
WTF is going on in the world today
I will honestly never understand why someone would use `private` in an open source library.
 
@user7594714 You're still making no sense.
 
Not even just today
 
6:50 PM
damn
what did you not understand with the above comment
 
This entire month has been wtf programming month
 
Try this.
 
So, either the trolling is strong on twitter, or the PHP ecosystem is actively moving to reckless cowboy programming.
this, basically
 
Was just venting on your timeline about to post :P
 
@PeeHaa why am I not surprised to seee... Taylor Otwell liking that shit
 
6:52 PM
@Ocramius Maybe it's the heat? The retardedness is worse than normally
 
@PeeHaa it reminds me of the "security" issue the other day
 
Moving too cowboy programming ... thought that was always the norm for php
 
:-)
 
offtopic anyone used anything like paypal prepaid card?
 
@FélixGagnon-Grenier i thought you were joking
 
6:54 PM
sadly, I was not.
Muh, remove visual debt, public all teh things
 
@user7594714

Suppose a couple things...
- Your posts-per-page is 10.
- Author ID 1 has only 5 posts.
- Author ID 2 has 25 posts.

1) Use SQL to get only the posts from that author. Don't load them all then filter them. Use LIMIT so that you either get 10 posts or less.
2) Use COUNT so that you know how many posts the author has total.
3) Use that information to paginate.
@RonniSkansing I have for various deal making schemes when I was poor. Why?
 
I cant do that because I have to work with the data i have
 
It's become so bad that I see myself agreeing with @Ocramius a lot lately
Send help
 
its the cache
 
@user7594714 You need to give me more information than that.
You're making ZERO sense. Explain. Your. Problem. Fully.
 
6:57 PM
damn ive really tried my best to explain it clearly
 
@PeeHaa Is this how you feel when I ask you questions?
 
@Allenph just wondering if it actually worked
 
you do understand the data I have
Just not the problem
 
@user7594714 Exactly.
Explain your problem domain. Hahaha.
 
@PeeHaa wtf?
 
6:57 PM
@Allenph No. I only blame people who should know better
 
@PeeHaa Ooooo. Solid burn.
 
Not meant as a burn. Sorry :-)
 
@FélixGagnon-Grenier TIL laravel/laravel doesn't use a single private..
 
@pmmaga :( so I was about to answer to the guy, and I can't even
 
There are just people which have a lot of experience (and probably blind followings) saying stupid shit in public which rubs me the wrong way
Once you reach that level I will also rant about you @Allenph don't worry about it :P
 
6:59 PM
@PeeHaa I got a bong - wanna share?
 
@Ocramius It's a start
 
Woah.
-bash: /usr/bin/rm: Argument list too long
Never seen that before.
 
May 25 '16 at 16:46, by PeeHaa
> -bash: /bin/rm: Argument list too long
read from there
 
@pmmaga damn it. I replied.
 
Not sure what I ended up doing though
 
7:03 PM
@PeeHaa find . -exec rm -rf '{}' ';'
 
Pretty sure that wasn't what I did, but if it works
\o/
 
@PeeHaa Yeah. I can't tell what you did either.
And the suggestions all look very scary indeed.
 
In general @FlorianMargaine knows what he does YMMV IANAL
 
I did an rm -rf / on accident once.
 
@PeeHaa we know our mileage may vary in uranus.
 
7:06 PM
@Allenph So what? Nothing happens when you do that
 
@PeeHaa I don't think that was the exact command.
 
@FélixGagnon-Grenier :P
 
I just remember it immediately began deleting important stuff.
 
The numbers in the array are post id and id like to filter out all posts that are not about news. so I use filter but the problem is that I only get 3 values when I need 6 values so I want "with filter" to continue till it got 6.
 
From the root.
 
7:06 PM
@FélixGagnon-Grenier wat
 
yes. it's like...
I don't know.
 
@user7594714 If you don't have 6 data points that match the filter...you don't have 6 data points that match the filter.
You want me to create news for you?
 
naah check the array
 
are these guys really that confused?
there are PRs and forks.
 
s - start point e - endpoint
and there are values after the end point
 
7:08 PM
they're like mixing two so very different things
 
@FlorianMargaine Can you do me a solid and explain that to me before I run that on a prod server?
find . -exec rm -rf '{}' ';'
@user7594714 You have successfully confused me more than anyone has ever confused me.
Tell you what.
 
haha
 
Give me some data.
Give me a constraint for that data. (A filter)
 
the funny thing is that is the data
 
Give me the EXACT data you want out.
 
7:09 PM
Lets ignore all that
 
Give me the data you're getting.
 
I think i need to redo the function anyways
 
Then I'll do it for you and explain.
Come up with the simplest version of what I just asked for and I'll help you.
Until then I have to work.
 
lets say you have a list with all posts how would you go about filtering while still keeping the same amount displayed
and being able to correctly paginate
 
you need to get that amount from the filtered data
 
7:12 PM
@user7594714 What @pmmaga said. Filter first. Count after.
And don't get all the data from your DB
 
naah the list is from the cache
 
There are ways to avoid doing that in Redis as well.
 
I know it's in a cache.
 
walk away @Ocramius
now
 
7:14 PM
find . -type f -print -delete
@PeeHaa
Pray for me.
 
It's better for your health
praying :P
 
The scary thing is that this is not only a prod server, but it's a clients server which is not hosted through us.
Worked.
 
@PeeHaa man I should have done this (walk away).
now I'm trying to teach that guy what forking actually is.
> No. I think private is an affront to code sharing and developer work in most cases
I...
I think I'll start hating php devs too.
 
@FélixGagnon-Grenier Is he talking about private properties? Private code? What?
 
And you too @room. You made me think that php developpers were actually sensible, intelligent, smart and able to think.
Now, I realize what an oasis this place is.
Fuck twitter.
 
7:23 PM
The barrier to entry for PHP is extremely low.
I don't know of any language that's easier to get into.
 
These guys are not even beginners @Allenph. That's the problem.
 
What does that even mean?
 
That... they're not beginners, so I don't understand why you mention the easy usage of php?
 
Oh. The way you worded that made it sound like they were LESS than beginners.
I see what you mean.
 
meh, lots of bad "oop" code around in other languages too
 
7:26 PM
I don't know. I've written enough bad code to offset the comparison between PHP and other languages heavily.
 
yeah... Chris is a regular conference speaker and author... he's not on the beginner end of the spectrum.
 
Proceeds To Write What Is Likely considered Bad Code
 
@Orangepill that's scary
 
@kelunik Handles should probably auto-close on destruct, yes?
 
Yes, don't see a reason not to do that.
 
7:28 PM
I think he's more of a devops guy though... I know the pain he's going through but the answer isn't to break encapsulation and create a raft of BC issues.
 
Especially if they implement the stream interfaces and might just be passed somewhere and forgotten about.
 
Where is this that you guys are reading?
 
@kelunik Alright. I might have to add a flag to avoid unnecessary ops then.
 
Is someone advocating not using private in case someone wants to be lazy and massacre object state in the future?
 
I think we have a writable flag in most implementations already.
So we'll always ignore close errors then, but still always flag as closed so future operations error?
 
7:31 PM
@kelunik Does writable = false imply it's closed or going to close?
That flag should maybe be set based on mode.
 
@Trowski I think it currently does that, but not sure.
 
@kelunik Yes, looking at it I think it does.
But should we set that flag based on mode, or just let the write op fail if the file wasn't writable?
 
@Orangepill it just seems to me that he is confusing/mixing two very distinct things, oop principles on one side, and code maintenance on the other. I'm happy he seems calm and actually answers tweets, my last interaction with someone (otwell) was nowhere near a discussion.
... not sure why I put these two in the same boat, maybe just the fact that the latter liked the former's tweet.
and as always, if that person likes something, it's almost certainly a bad idea.
maybe I am becoming a bad person.
 
Yeah... I met him IRL... he's a really nice guy, not full of himself like some people.
 
as I get older, my tolerance for people, who are both loud and ignorant, plummets
 
7:37 PM
OMFG we are all turning into @tereško
 
til plummet
@PeeHaa :P
 
@Trowski What do you want to do based on mode? Throw an error there instead of a ClosedException?
 
@kelunik That would make more sense, as it's a programming error in that case.
 
@Trowski For files it's a programming error in any case.
 
Yeah, that's true.
 
7:40 PM
This is actually a good question to ask here. @FélixGagnon-Grenier @Orangepill @PeeHaa @tereško

I've been in the industry for 3 years. I've made a TON of progress knowledge wise. I never went to school, and I don't have problems getting jobs at all. I make a very comfortable pay for no school and at all the places I've ever worked...no one seems to have as much interest in theory and "doing it right" as I do. In fact, a lot of the senior engineers at these places have been completely ignorant of some fundamental organizational paradigms.
 
Well.. except if files can be deleted while open, not sure whether that's possible.
 
I have the money to go back easily...I just don't know if it's even worth the effort.
 
@kelunik Not sure, never tried it.
 
@Allenph Being at work with engineers and thoroughly schooled people, I realize my lacking is not in understanding the principles, but rather technical stuff like common algorithms, advanced notations, machine learning. stuff that you can't really get by working in websites.
 
For now it's probably fine the way it is, we can tag another 0.x in the future.
 
7:43 PM
@Allenph as long as I won't have those, I will cap, both in salary and job opportunities. Learning this, however, while certainly seems faster in school, can probably be achieved with will and dedication.
 
@Allenph maybe. The problem is that most likely about 90% of wht you will have to learn will be UML, Java and Oracle
 
@FélixGagnon-Grenier I do some of that on the side for fun. But when I read DDD by Eric Evans...I feel like I just missed a bunch of it.
 
that too^^
 
@kelunik Let's close on destruct before tagging. Is that something you wanted to do or should I work on it. I won't have time until tonight.
 
@Allenph at least where I live, application architecture is not being taught at universities
maybe at Master's level
 
7:44 PM
If I went back I would go for the full 8 years.
 
@Trowski I don't have time for code right now, so either you do it tonight or maybe I find time tomorrow.
 
Sounds good. Should I tag after that?
 
@Allenph I'm in the same boat but have been at it quite a bit longer, I wish I would have gone to more school for more exposure to the academic theory with development.
 
I've been toying with the idea of aiming for a PhD so I will be allowed to work on the stuff I do as a hobby on the side. quantum computing, model-free-methods, etc.
 
I think you can, further bugs can be fixed as bug fixes I think.
 
7:46 PM
But really, for now...I just want to not struggle through architecture.
 
Ok. I'm planning on doing a 0.x anyway, so we can revisit things if necessary.
 
But you can also just push and ping me that you're finished and I'll tag in the morning after reviewing and running the tests locally.
 
@kelunik Ok, I'll do that.
 
Yes, definitely 0.2.0.
I'll have some time in the morning, not so much in the afternoon, because I'm in the NetSecLab for a WPA2 security workshop, let's see whether they tell me anything I do not already know :D
 
7:47 PM
@Allenph what you will be struggling through will be mandatory attendance requirements
 
@tereško Working a full time job and doing school? Is that what you mean?
 
yes
 
I did it for one semester and it wasn't TOO bad.
But I also was not super deep like I would be in a few years.
 
@Allenph I am the last person to ask about things related to education institutes
 
Why?
You understand the things I want to understand...so you probably have a better idea of the quickest way to do so.
 
7:52 PM
And didn't / don't do well in forced education like that
 
@Allenph because @PeeHaa is your typical school dropout
 
Basically that ^
 
Actually, if we were to meet, we might be friends. We seem to like the same things (drugs, alcohol, php, hookers)
 
Yep we would get along just fine :D
 
I do all the same things except the hookers. Haha.
 
7:54 PM
Might also coop to producing music. Me on ableton you on violin
:)
 
I am worried about college because when I was in school I never had to try.
But I bet somewhere in 8 years I would be forced to try. Haha.
 
I should hope so, that's why I didn't continue down the academic route, I was able to learn independently faster then it was being taught. That coupled with having to learn stuff I had 0 interest in.
 
8:10 PM
@Allenph comp sci is all about algorithms, maths etc. One of my friends is doing it at the moment and they only covered a little OOP (class by Bertrand Meyer, using Eiffel :D)
I think they also do some Java etc, but just superficial stuff. Not much about architecture, clean code or DDD
 
So it's something there really ISN'T an academic avenue to take.
 
Depends on what kind of jobs you want
If you read reddit, hackernews etc you'll see that many graduates never use any of the stuff that they learned. But on the other hand there are some very well paying jobs where you need that knowledge. So it depends
 
8:25 PM
@Allenph well .. it depends. The advanced topics might be covered when you are studying for Master's degree
(but I tried couple times, and it was just the same old bullshit as in Bachelor's)
 
Don't whine that you don't use certain things. You must learn calculus, for example, but almost certainly won't use it "on the job."
 
I've used Calculus "on the job"
It comes in surprisingly handy.
 

« first day (2440 days earlier)      last day (2508 days later) »