« first day (1075 days earlier)      last day (3856 days later) » 

1:00 PM
Upload
 
I meant the static method call.
In any case, that's not what I want.
 
I'm trying to figure out how to handle an implementation, so I'mma rant a question:
 
can I change/configure localStorage size in FF somehow?
 
I have an Action class. It wraps Closure, and you can ->bind() parameters to it. When you ->invoke() the Action, it performs a call-by-name (via reflection) using the associative parameter array. Now, since all of the parameters bound may not be in the function (if it isn't in the Closure param list, it won't be injected) I'm supporting a ->getParameters() method; returns the associative array. Here's the issue:
I have ->invoke() and ->bind(). bind adds params to the internal array, and can be accessed via getParameters(). However, params passed via invoke aren't added to the array, because they should only exist for the lifetime of the invocation. As a result they're not available to getParameters().
This doesn't seem good; it's inconsistent.
 
@DanLugg hrmm...
Do you by chance have any code that we can look at?
 
1:06 PM
I'm reworking it entirely right now. Gimme a few and I'll gist the whole mess.
 
And I also unfortunately have to go to work right now so I wouldn't be able to even glance at it probably until lunch
 
lol... welll fine then.
 
About 3-4 hours from now
@DanLugg Trust me. I would much rather look at your stuff then what I'm gonna be doing at work ;)
 
@DanLugg Why is it not consistent? Parameters added by ->invoke() are transient, makes sense.
 
@Jack Yes, but they seem as though they should still be available from the getParameters() method.
 
1:08 PM
Doesn't Closure already have a bind() method btw?
 
@Jack Only for $this.
 
Hello
I have a question about php please help me
 
@DanLugg Eh?
 
@SaimaMaheen pls see top right text.. (room description) ^_^
 
@Jack This isn't for $this binding. This is for call-by-name parameter binding.
 
1:09 PM
sorry os
@reikyoushin sorry bosssssss
 
Then maybe bind() is the wrong name for what you're doing.
 
@Jack Nope. I don't think so.
 
@SaimaMaheen im not anywhere near a boss here.. im somewhat still a newbie too..
 
@DanLugg The code should make it clearer.
 
$query_pag_data = "SELECT * from ebook LIMIT $start, $per_page";
$result_pag_data = mysql_query($query_pag_data) or die('MySql Error' . mysql_error());
$msg = "";


while ($row = mysql_fetch_array($result_pag_data)) {


$htmlmsg=htmlentities($row['title']); //HTML entries filter
$msg .= "<li><b>" . $row['id'] . "</b> " . $htmlmsg . "</li>";

}


$msg = "<div class='data'><ul>" . $msg . "</ul></div>"; // Content for Data
 
1:11 PM
@SaimaMaheen Don't use mysql_ functions.
 
i want to add more data in loop near$msg .= "<li><b>" . $row['id'] . "</b> " . $htmlmsg . "</li>";
 
Also, you're open to XSS and SQLi.
 
if you saw this
 
@Jack Ok, well the method name is really irrelevant to the problem. I'm assigning values to be carried around with the function. When the function is invoked, the assigned values will be merged with parameters passed at invocation (invocation parameters overriding existing) and the function is run.
 
@DanLugg Seems a bit Monadic :)
 
1:12 PM
@Jack Yes. Yes it is. Kinda.
 
<?php
class Some {
    protected function _protected() {

    }

    public function method($mine) {
        return new class extends $this {
            public function overRide() {
                return $this->_protected();
            }
        };
    }
}
?>
 
i copy this code from website to use ajax pagination but i cannot add sql table column in $htmlmsg=htmlentities($row['title']); //HTML entries filter
$msg .= "<li><b>" . $row['id'] . "</b> " . $htmlmsg . "</li>";
 
do you understand what it does, or what do you expect to happen ?
 
please tell me how to add more column data in this?
@Jack jack
 
@JoeWatkins $some->method()->overRide() calls _protected on $some.
Or.. wait; the extends $this is throwing me.
 
1:14 PM
@SaimaMaheen you need to add a new column to the database tables first..
 
yes i add column but when i insert this column in loop it cannt display
@reikyoushin yes i add column but when i insert this column in loop it cannt display
@reikyoushin can i send you all code?
 
@DanLugg too much ?
 
@JoeWatkins I just don't understand what extends $this does. If you explain, I can probably make sense of it :-)
 
@SaimaMaheen nope.. just open a question on the main site and wait for someone to answer it. it's how this site works anyway
 
the question is, how to solve the problem of accessing the scope of the parent ... I'm not so bothered about procedural code, wouldn't make sense to be ... but if you declare an anonymous class in another scope should there not be some way to access the parent ...
I thought a constructor would be enough but apparently not ... protected members are a problem ...
 
1:17 PM
@SaimaMaheen this might help you if you still dont know how to ask a good question.. stackoverflow.com/help/how-to-ask
 
class Outer {

    protected function protectedMethod() { }

    public function publicMethod() {
        return new class ($this) extends self {
            private $outer;
            public function __construct(Outer $outer) {
                $this->outer = $outer;
            }
            public function forwardToProtectedMethod() {
                $this->outer->protectedMethod();
            }
        }

    }

}
return new class ($this) extends self -- the ($this) is an argument passed to the inner classes' constructor; extends self is contextual, extending Outer.
$outer->publicMethod()->forwardToProtectedMethod() should work then.
 
@reikyoushin ok i am new one sorry
 
@DanLugg
<?php
class Outer {
    private $dice;

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

    protected function protectedMethod() {
        return $this->dice;
    }

    public function publicMethod() {
        return new class extends Outer {
            public function forwardToProtectedMethod() {
                $this->protectedMethod();
            }
        }($this);
    }
}
var_dump((new Outer($_SERVER))->publicMethod());
?>
this works now ...
if you're willing to pass an object in the constructor then you circumvent the problem ...
that's a bit of a headfuck, but it does work ...
 
To be honest, I think the constructor params on the anonymous inner class should follow the class keyword.
Pushing them all the way down there is a syntactic jumparound
Don't get me wrong, I understand, and it is consistent with other cases: (function () {})(42) in JS for instance.
 
I don't want to loose the simplicity angle though ...
this is simpler ... to parse ... and so to maintain ...
it's not so different from just declaring classes ...
 
1:24 PM
Is it? I suppose that trumps any other reasoning.
 
I just think new <type>( <args> ) { <definition> } instead of new <type> { <definition> } ( <args> )
 
I think having it behind makes more sense.
 
user895378
@JoeWatkins FWIW I'm in favor of anonymous classes.
 
It's in line with new Class($args)
 
1:25 PM
@DanLugg yeah look at changes in zend_language_parser.y github.com/php/php-src/pull/470/files
 
user895378
There have definitely been times where I needed anonymous classes and wished for them.
 
@rdlowrey Well I suppose all that fairy dust paid off.
 
I wanna go for nested and then private classes too ... but I'm not gonna push an elephant up a stairs ... if this doesn't get in there's not much point in producing anything like it, it will just elicit the same response ...
 
Yea, true.
 
user895378
@DanLugg I credit the rain dances. I just never stopped believing.
 
user895378
1:27 PM
I'd really like to see private class constants.
 
@rdlowrey yes
I mean YES!
 
@reikyoushin hello i cannt insert my question on main site please help me
 
user895378
I find myself doing things like private static $THIS_IS_A_CONSTANT = 42 to avoid exposing constants publicly.
 
Order of evaluation in PHP, if anyone is interested :)
6
 
@SaimaMaheen Did you insert a coin first?
 
1:28 PM
@NikiC awesome one :)
 
@rdlowrey I was thinking about this and was wondering if it was something I should do or not
 
@PeeHaa what is coin
 
@rdlowrey Also yes
 
@rdlowrey I just expose them. I mean, they're constant (I do get what you're saying though)
 
user895378
1:30 PM
Yeah, I just don't like wondering later if code somewhere outside the class depends on the public constants.
 
@PeeHaa heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
 
Also @SaimaMaheen: have you tried turning it off and on again?
 
@NikiC that looks interesting. One point - I've never understand why do such things (and also ask them on the interview to "check language knowledge"). Normal developer will simply write brackets if he's not sure - and will reduce time of those who will read the code 10 times
 
@SaimaMaheen E_TOO_MANY_EEEEEEEEEEEEEEEE
 
yes
@DanLugg bosssssssss
 
1:31 PM
@DanLugg may be E_TOO_MANY then ? :p
 
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEK the cat.
 
@DanLugg Damn that shit is from my era
 
@PeeHaa Likewise.
 
user895378
No school like the old school.
 
Word bro.
 
1:34 PM
Oew.. i remember Eek
 
@NikiC read to @ case. Wow, it's really interesting
I didn't know that. No - even didn't imagine :p
 
@rdlowrey I think the discussion on $_PUT missed a fundamental point but I just want to run it past you before I list it in case I'm missing something - multipart messages don't belong in PUT request entities unless they are the resource, in which case they don't need to be parsed. If there is meta-data for the entity that needs to be sent along with the replacement entity, it belongs in the headers. Anything you disagree with about that?
If you have a multipart message that needs to be broken down into components and the components handled, that's a POST request, because the URI needs to identify the handler, not the resource
 
FFS my x-ray got pushed back 6 god damn weeks.
 
1:42 PM
@SaimaMaheen Sorry Saima, but this is not the place to come to when you want to learn programming. You are better off learning the language first before asking questions about copy-pasted code..
 
@DaveRandom what's up?
 
user895378
@DaveRandom yeah, well I assume it would work the same way as multipart entities with POST does -- things would show up in the $_FILES array
 
@PeeHaa o.O? XP
 
user895378
Also, if you're doing a PUT you could make the content type form-encoded and then it's just a key-value thing like $_POST
 
@Leigh I was wondering if you had any way to magic up a friday night pass for PHPNW, I got a conf standard ticket but was too late for the hackathon
I would buy you many, many beers
 
1:43 PM
@DaveRandom we're not sponsoring this year
 
:'(
@rdlowrey Yeh but that makes no sense. That implies multiple files, hence multiple resources, hence a handler, hence POST
 
user895378
But honestly, I think adding a $_PUT superglobal is unnecessary and only subsidizes people who don't know anything about HTTP by allowing them to think they're doing "REST" because they use PUT requests to update things.
 
Well ain't nobody got time for more superglobals, that's definitely not the answer
 
@DaveRandom You could email them and see if there are free places.
 
I'm not against exposing a native MIME parser to userland, far from it, but I think the PUT use case is, well, not a use case
 
1:45 PM
I know people did that last year
 
user895378
I think the answer is what you suggested originally: expose a function to parse multipart bodies.
 
user895378
@DaveRandom yeah. People advocating for $_PUT should be PUT out to pasture.
 
Looking at my ticket, I'm not opted in for the hackathon either
 
@Leigh I think the reason I didn't get one is that there aren't any free places
I guess I could drop them an email though, can't do any harm
 
user895378
1:47 PM
@DaveRandom I suspect the multipart confusion probably stems from people not understanding the distinction between multipart and form-encoded content types.
 
@Leigh Oh nice one, thanks, I'll keep my ear to the ground (I hope I don't have to sign up to twitter though...)
 
user895378
I think you're right, though -- multipart by its name (hello, MULTIPART) should tell you it shouldn't be used as a PUT body because you'd be updating multiple things and not one thing
 
@NikiC are you around?
 
@DaveRandom Can try your luck with email then
 
@rdlowrey Well quite. But even so, neither of those belong in PUT unless they are the target entity, PUT is not for post processing (clue's in the name :-P).
 
1:49 PM
@AlmaDoMundo yes
 
user895378
@DaveRandom I disagree there's nothing wrong with form-encoded key-value PUT body.
 
could you please tell where I could read more about such PHP-internal things? (i.e. opcodes, how the're formed and evaluated, that CV e t.c.)
RTFM says nothing :\
 
user895378
Actually, I don't think my previous statement about multipart not being appropriate is accurate now that I think about it a bit more.
 
> The PUT method requests that the enclosed entity be stored under the supplied Request-URI. [...] The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. RFC2616 Section 9.6
@rdlowrey ^ my interpretation of that is that if it needs post-processing, it's a POST
 
@AlmaDoMundo phpinternalsbook.com ?
 
1:52 PM
@AlmaDoMundo uh, nowhere really
 
That's not to say you can't send meta-data (author, for eaxmple) but if you do want to send meta data it belongs in the headers
 
@Ocramius I'm trying to recall a coding standard I think I read from one of your github repos. It defined some pretty lofty goals as far as class structure and organization. I believe it was in the form of a powerpoint presentation
 
@NikiC but you've found that. So I want too, but not sure how
 
@MikeB I hereby guarantee that I never used nor never will use powerpoint.
 
@Danack - I'll check, thank you
 
1:53 PM
@AlmaDoMundo I have a post (nikic.github.io/2012/07/27/…) that explains a tiny bit of the compilation and execution process.
 
@Ocramius I don't think you were the original author. It was something along the lines in one of your README's that anyone contributing to this project should follow these guidelines
 
@Danack Do you keep everything from Composer in the same folder or is there a way to choose the path for a package to install?
 
user895378
@DaveRandom There's nothing wrong with PUTting the exact resource and storing its properties as a key-value string in a form-encoded entity body, though.
 
@AlmaDoMundo It probably only has a fraction of the stuff you're looking for - but it's something.
 
But if you want to learn anything more than that, it usually means reading the code ;)
 
1:53 PM
@NikiC but how did you found that?
you read that somewhere(where?) or...
 
@MikeB I'd gladly include that in my repos :)
but I'm enough of a firewall when something comes in :)
 
@Fabien Keep everything in the default structure - bad things are rumoured to happen when you try to change the structure.
 
@AlmaDoMundo I read it in the code ^^
 
:) got it now
 
@Fabien And if you need stuff in specific folders, you're probably doing something wrong.
 
1:55 PM
@Ocramius Fair enough, must have been someone else's repo. If you happen to think of the name for that standard/presentation/whatever I'd be interested in knowing
 
user895378
@DaveRandom for example this:
 
user895378
PUT /my/resource HTTP/1.1
Content-length: 42
Content-Type: application/x-www-form-urlencoded

MyVariableOne=ValueOne&MyVariableTwo=ValueTwo
 
@MikeB I'd be interested too :)
 
I'm wondering, why hasn't this been introduced into reflection natively:
 
@Danack I was trying to seperate 3rd party from application specific without having two autoloaders (composer and my own). I wanted to use composers for all.
 
1:57 PM
@Fabien Wat.
 
@Fabien You should be able to do that without needing to change where Composer installs dependencies
 
@Fabien In my project's root composer.json I have:
"autoload": {
		"psr-0": {
			"BaseReality": "src/",
		}
	}
 
/application
/library
--/vendor

I've assumed the notion everything in application should be application specific.
 
Which tells composer the source code for the current project is in the src/ directory. Then the composer autoloader merges that with the dependencies paths to provide an autoloader that can load everything.
 
I've moved composer inside application now but what about 3rd party packages that aren't essential to the app
 
2:00 PM
Urgh. Composer.json should be at the top level of your project, and then vendor's is a first-level sub-directory.
 
so
/app
/library
composer.json
 
If you need a custom vendor directory, you can specify it in your ~/composer.json
"config" : {
	"vendor-dir" : "vendor-custom"
}
But it's not recommended. Other devs would be slightly confused by your setup.
 
@Fabien yep. then you can tell composer about the app and library directory to get them to be autoloaded also.
 
@kaiser Yeah. I read something similar too.
 
Just stick with ~/src and ~/vendor.
 
2:02 PM
@Danack I just wanted the autoloader to sit inside of application, but I guess it doesn't have to.
 
@Fabien Yeah it doesn't have to, and the composer one will be in vendor/composer anyway.
 
Ok. Thank you.
Time to start moving stuff again :P
 
@NikiC Y U NO HAVE BLOG?!
 
@Ocramius finally found it. It's called Object Calisthenics on this page github.com/Ocramius/GeneratedHydrator/blob/master/…
 
@MadaraUchiha I thought he did..
 
2:06 PM
@rdlowrey Humm. Not sure about that, maybe.
@MadaraUchiha nikic.github.io
 
@DaveRandom Y HE NO POST TO HIS BLOG?!
 
user895378
@DaveRandom I don't know ... either way I think $_PUT is unnecessary and exposing a multipart parser is helpful.
 
user895378
If you're "being RESTful with PUT" you really don't need anything other than php://input ... but most of these people who want PUT support don't really even understand what's going on with messages and entity bodies anyway.
 
@rdlowrey That's the real crux of the problem. We can argue all day about the semantics/validity of doing it at all, but what it comes down to is that if you want automatic parsing of the entity body of a PUT request then you need to go away and find out what PUT is really for.
 
user895378
2:14 PM
@DaveRandom +1 ... and it's hard to say that without getting in trouble with the "tone police" because the "tone police" don't understand that :)
 
Hi guys!! :-)
Does anyone know how Joomla sends e-mails? I mean technically? Are they using the mail() function provided by PHP or are they using PEAR ? I am asking because e-mails sent from Joomla are delivered but e-mails sent from the mail() function not.
 
user895378
So it ends up with me looking like a jerk vs. a bunch of reddit/PHP framework users who want to be "RESTful" but don't understand that they don't need $_PUT to do that.
 
Nothing a kitten picture wouldn't fix.
 
"Statics are globals in drag" - what does this English sentence mean? (from here: stackoverflow.com/a/19007386/367456)
 
drag = man wearing womans clothes.
 
2:21 PM
@hakre google images: drag queen
 
But stylelishly - like Eddie Izzard
 
I know what what a drag queen is, pfff ;) - I still wonder on that term though.
okay, just using a dictionary. Is this common to say?
 
@hakre It means it's dressed up to be something that it's not.
 
user895378
@Danack "New queue!"
 
user895378
(my personal favorite Izzard-ism)
 
2:24 PM
Fuck PUT, it's all about the PATCH.
 
user895378
PATCH FTW!
 
user895378
Which was my point when I suggested if you added $_PUT then you'd have to add $_PUT $_PATCH too ...
 
Is it accepted?
 
@rdlowrey huh? you mean $_PATCH?
 
> Which was my point when I suggested if you added $_PUT then you'd have to add $_PUT too ...
hehe
 
user895378
2:25 PM
The superglobals are just a leaky abstraction. Glomming more of them on top is a bad idea.
 
any idea about the mail problem?
 
@MikeB that's not really a CS
 
@rdlowrey how would you like to access user input data? (if there weren't superglobals…)
 
user895378
@bwoebi I'm perfectly happy with php://input
 
2:27 PM
you must be kidding.
 
user895378
With functions available to parse url-encoded / multipart
 
user895378
What else do you need?
 
@rdlowrey this is superfluous code we'd always have to execute ourselves at the beginning of any webserver script…
at least the superglobals are actually jit…
 
user895378
You said without superglobals. If you want it to happen automatically change the name of the superglobals to something like $_QUERY for URL params, $_URLENCODED for those body times and $_MULTIPART. Same functionality but the abstraction isn't hopelessly broken.
 
user895378
But that's still a garbage solution.
 
2:30 PM
@rdlowrey that effectively sounds better… :-)
 
user895378
If you had a Request object you could get ALL of that functionality without any of the bad practices (including JIT).
 
user895378
$request->getQueryParameters()
 
user895378
$request->getUrlEncodedBodyParameters()
 
and the $request would be superglobal then?
 
user895378
No, it would be an immutable object.
 
user895378
2:31 PM
And you could then inject it into code so that it's testable and not mutable global state.
 
user895378
Hello, testability.
 
yes, an immutable object; I mean the variable should be superglobal and the object itself immutable?
 
user895378
Well if you want to keep the same SAPI it pretty much has to be available everywhere.
 
@MadaraUchiha that's a good question
 
are you using such a request object in your Ayers?
 
2:34 PM
I foresee the following, provided that a native Request object becomes a real thing: We'll still have $_GET, $_POST, etc., but we'll also have Request::createFromGlobal()
 
user895378
@bwoebi No, I basically provide you with an analog of $_SERVER. I've more or less emulated Python's WSGI and Perl's PSGI.
 
user895378
So every request is handled by an actual callable and it's always passed the same "request environment" array. This makes the code 100% testable.
 
user895378
You don't need superglobals when you have an input (the request environment) that goes in and a response (the response array [$status, $reason, $headers, $body]) that comes out.
 
@rdlowrey Why'd you favor an array over a type for the return?
 
user895378
No side effects, no globals -- just input dumped into a callable and output returned. Simple. Testable.
 
2:38 PM
@DanLugg faster?
 
user895378
@DanLugg Only because my #1 goal is performance. Instantiating a userland type for every request hurts that goal.
 
That's what I figured. I think it's sane, was just wondering.
 
I do like it when I google a question get an SO link and it's someone in here who asked the question :)
 
user895378
So I don't limit the performance and you can always wrap the stuff in userland and do something like return $response->toArray()
 
@Fabien People in here ask questions?!
 
2:39 PM
@salathe Yes, they need the badges.
:)
 
@Fabien I guess I should start asking questions!
 
@Fabien and you didn't know? google is a front-end for SO in terms of IT-questions :p
 
heh
 
user895378
@DanLugg That said, right now everything is done in userland. What I'd like to move to next is implementing a lot of it in C as an extension -- then I could bypass the slowdown associated with objects and create an immutable request object that's passed in that does the kind of JIT parsing on things like request params and whatnot @bwoebi mentioned.
 
@rdlowrey That'd be awesome
You could bypass the slowdown associated with... well anything you've experienced any sort of "slowdown" in now.
 
user895378
2:45 PM
Exactly. That's the main reason I've been working on my C and trying to contribute to php-src, honestly -- so I can use that knowledge to get compiled performance for specific aspects of my server.
 
user895378
It's already really fast, but compiling the slow parts would make it crazy.
 
@rdlowrey So I gathered from your shouting benchmarks ;-)
More lolz:
7 hours ago, by blackbee
right know i need to learn c ... english is good is good, c is better..
i dont understand why i am treated like a outcast everywhere..
 
codeigniter just attract talent: stackoverflow.com/questions/19008220/…
 
@Ocramius You're correct, at the time it's the best I could recall about it
 
@DanLugg will you jump to another universe when you do that?
 
which one is the best framework to use in php: Zend, Codeigniter OR phalcon? What are the pros and cons ?
 
@RonakPatel ask @tereško ^_^
 
you don't want to do that
 
@RonakPatel codeigniter is framework for retards and phalcon is latest hype which is simply not maintainable
 
I want the framework which is best in performance and easier to read code and manage it. I used Zend before. but, it's very tough to understand..
 
@RonakPatel zend 1 or 2?
 
zend 2
 
the best available options are ZendFramework 2 and Symfony 2, but only if you are well versed in OOP practices, principle and methodology
 
@tereško: I read about phalcon.. I like it.. but I don't think so, there will be more community support in that framework as like Zend 2 and CI.
 
3:12 PM
guys, what's the best remote DB manager for big dumps? im using the free sqlyog, but are there any alternatives?
 
I agree with you @tereško .. But, Zend 2 and symphony is not that much fast (on the basis of performance) like phalcon
 
@RonakPatel do you know what LSP is? Can you explain it in your own words?
 
@tereško: I heard first time this term.. :) What's that?
 
liskov substitution principle
 
Slides from my #drupalcon Prague talk on SOLID OOP design: http://www.slideshare.net/ircmaxell/dont-be-stupid-grasp-solid-v42
 
3:14 PM
if you have not heard of it, please stay away from frameworks .. better invest time in learning OOP
 
@ircmaxell ooooh, nice! im gonna read this one. thanks sir!
 
@Gordon: there you go. Guess where the part you'd like is :-D
 
@tereško wont it be easier to learn them through checking how frameworks implement it first, so you can compare? (not that im saying they all implemented them correctly, you know what i mean)
 
Oh, and I hate presenting to Central Europeans. Almost no feedback during the talk. No laughs, no feedback at all. I'd like a little
 
@ircmaxell When will you update the video on YT? :)
 
3:16 PM
@reikyoushin which frameworks implement SOLID principles?
 
@Fabien it's uploading now, will post once done
 
Awesome! :)
Thank you.
 
check the slides though
 
@tereško hmm.. well, so you know what not to do? XP
 
@reikyoushin and how many people who use frameworks know "what not to do" ?
 
3:21 PM
@tereško ok, i surrender. haha. i for one can't say... im still learning from you guys
 
quick one, I need to return two values from a function is it ok to return an array?
 
m59
I thought of better how to ask what I was thinking of earlier.
Should api/articles and api/users, for example, each have their own way of handling each request method?
GET, PUT, POST, DELETE?
 
@iroegbu not really. It tends to cause confusion. Did you try to refactor it so that there are not two+ variables returned ?
 
Ok, off for a while. Later
 
m59
Oh, and also, should each collection have independent methods for items, also? Like a DELETE request to api/users/1 would run different code than api/articles/1
 
3:29 PM
@tereško ok, I've figured it out... I'll use two functions and write one to wrap them and use returned values.
 
m59
In contrast, I originally used the collection name to determine what to delete and the data to determine what to update, etc. That isn't flexible at all, of course, so everything would have to really conform.
 
@iroegbu in worst case scenario you can return two+ values in an array with named case .. then at least you do not need to remember the order or data
 
oh... that's the easiest way out
 
What the actual fuck.
 
Anyone implement a JSON and MVC service consumer side-by-side? I would like to abstract a service layer out of my code and have both consumers use the layer..but its hard for data matching.
 
3:33 PM
Recovery Beard is coming along nicely. Wish it didn't look like I was crying though.
 
Should the service layer use domain model objects, and when a json requests comes in automatically convert them to these domain objects?
 
A treat for you all, please tear into this absolute noob
It seems we don't use the same language. I don't use OO code, I don't use any framework, my code is pure and optimized. And after all, it's an e-commerce website, it has to be simple and very responsive. Anybody using a framework is an idler who doesn't want his website to be fast and scalable. And I'm using multiple requests with a unique connection. — Yonn Trimoreau 31 mins ago
 
oh wow
 
Not using OO & frameworks doesn't automatically make someone a noob.
If you want your code to be as fast as possible, you would write it procedurally and avoid overheads like frameworks. Having said that, you also wouldn't write it in PHP.
 
His assumption that using it makes it not responsive or simple though...
 
3:46 PM
His language of calling people 'idlers' is unfriendly, but most of what he says is true. The fastest code will not make use of large frameworks.
 
m59
Not so sure about the procedural-ness though
 
@Starsong Does it seem like he has a good grasp on OO principles though?
 
@Fabien No
 
I think that's the main issue for me in what he's saying.
 
@YonnTrimoreau You talk about avoiding OOP and frameworks because you want speed, yet you're using PHP and PDO, neither of which are high performance options. What you're doing is akin to refusing to open the windows in your car because the wind drag may increase top speed, meanwhile you refuse to stop driving your Lada. — Starsong 54 secs ago
 
3:50 PM
You get 1 point for a correct answer and extra points for showing how you got there.
 
Remember the days before tabbed browsing?
 
@Starsong No, it's the following: Anybody using a framework is an idler who doesn't want his website to be fast and scalable
 
@Jimbo Yeah that comment is in a whole new league of stupid.
 
That's what I take issue with
 
m59
I just can't really imagine his code being all that optimized without using classes.
 
3:52 PM
The other issue is that when you say something like that, people don't want to help, they just want to point out how stupid you sound.
 
m59
Unless it's really simple.
 
I agree. It was just plain rude.
 
It may be fast and awesome... it will just be a bitch to maintain
 
@Orangepill It may be, but I'm betting it will be shitty.
 
e-commerce is by no means a fire and forget problem.
@DanLugg You're probably right given him attacking something he doesn't understand ... seems he's pretty rooted and proud of his ignorance
 
3:58 PM
I think it is a problem with a lot of web devs. They worry about performance first when really I think you should be worrying about maintainability first. Refactor for performance when you can prove what you're doing is actually impacting performance.
 
@YonnTrimoreau "Anybody using a framework is an idler who doesn't want his website to be fast and scalable." - Also, this comment is in a whole new league of stupid. Servers are cheap, programmer hours are not. The fact that you'd sacrifice long term code maintainability for the ability to spend a little less on servers is poor business. Frameworks increase coder efficiency and maintainability in exchange for a little performance. Programmers make this exchange all the time, by choosing HLLs, to improve UX, to improve maintainability. That's not laziness, it's economic efficiency. — Starsong 11 secs ago
 

« first day (1075 days earlier)      last day (3856 days later) »