« first day (1614 days earlier)      last day (3334 days later) » 

12:02 PM
@AlmaDo Did you hear about the dyslexic pimp? He ran a warehouse.
 
I didn't ..
 
Ugh, that is such a stupid crappy joke and it still comes to mind every time I see the word "warehouse"
 
E_RECOVERABLE_ERROR
 
terrible @DaveRandom
 
Yes, yes I am.
 
12:09 PM
 
Got a random question, how can i add the column name from my mysql table to my PHP output?
$query="SELECT * FROM DMNBeursResults";

$results = mysql_query($query);



while ($row = mysql_fetch_assoc($results)) {
echo '<div class="arow">';
foreach($row as $field) {
if($field != "")
{
echo '<div class="columntable">' . ($field) . '</div>';
}

}
echo '</div>';
}
Or do i need to run another query (select columns from table)? and then insert these rows ?
I think i already know :P
 
@HuubS Please don't mix code that displays stuff with code that retrieves stuff from a DB.
 
hi guys
 
pce
@HuubS what is the output of var_export($row);?
 
@pce NULL
 
12:12 PM
anyone used aptana studio before?recommend it or not?
 
pce
@HuubS before or in the foreach loop?
 
@Danack why not? I do that all the time tbh :P
@pce the whole array
 
In computer science, separation of concerns (SoC) is a design principle for separating a computer program into distinct sections, such that each section addresses a separate concern. A concern is a set of information that affects the code of a computer program. A concern can be as general as the details of the hardware the code is being optimized for, or as specific as the name of a class to instantiate. A program that embodies SoC well is called a modular program. Modularity, and hence separation of concerns, is achieved by encapsulating information inside a section of code that has a well-defined...
 
pce
@HuubS can you post some key and values of $row?
 
array ( 'id' => '1', 'name' => 'dodo', 'email' => 'dodo@gmail.com',)
@Danack thanks, tbh normally I do that kind of things, but because this is veeery small I thought I can do this all mixed :P
But you're right, its better to seperate these things
actually i always (i realise that now) mix PHP and database things.. CSS JS HTML, C# MVC etc I split
 
12:17 PM
@HuubS Size and maintainability are not as fundamentally connected as many people seem to think...
 
That's what she said?
 
No she said, wow thats a big one
 
-_-
 
:D
At least that is what ur mom said last night
 
As I recall, what she actually said was "who are you and how did you get in my house?"
 
12:20 PM
lol
 
haha
 
@Ocramius is there any performance overhead in implementing every single Zend\ModuleManager\Feature\* interface in zf2 after opcache, etc?
 
@Amelia yagni?
 
@PeeHaa hi.what open source ide would you use or recommend for php?
 
@Gotalove I don't use ide's
 
12:24 PM
notepad++ for the win
 
okay I use notepad++ or sublime
 
yeah sublime is nice
 
must... resist... urge... to... get... involved... ngggghhh
 
@DaveRandom ? :-P
 
get invovled random guy
 
12:26 PM
@PeeHaa well, currently implementing 8 interfaces on an abstract class
 
<my-contribution-to-this-discussion>If you are developing PHP, use PHP Storm.</my-contribution-to-this-discussion>
 
@DaveRandom high five
 
hehe
 
@DaveRandom emacs bro
 
well maybe i upgrade from my notepad++
sublime looks really nice
 
12:28 PM
 
@DaveRandom If you really have to use an ide use phpstorm otherwise man up and use a texteditor
 
There is an xkcd for literally any subject
 
newbies to programming who use storm depend on it too much my 2 cents
 
Exactly
@DaveRandom there's no xkcd about phpstorm ;)
 
@PeeHaa I used to think that. Then I realised that PHP Storm easily doubled my productivity, certainly when debugging. (or halved the amount of effort I need to put in, depends what kind of mood I'm in and how much I've had to drink)
 
12:30 PM
when beginning better to use a simple editor with highlighting, manually look up what goes where and where that came from
 
does 5.4 hit EOL this year or next?
 
5.4 will hit EOL when 5.7/7.0 come out
 
@DaveRandom People keep saying that, but that never happened in my experience :(
 
@PeeHaa If you've once got used to it, it's hard to change to something different again.
 
12:33 PM
To be fair, I don't need a debugger very often...
 
@DaveRandom thanks, couldn't remember the link for the life of me
 
I use Netbeans. Works really well. it just has a lag between PHP releases and support for that release
 
In php at least, reading the code is often enough
 
@PeeHaa Really it's jump-to-def/find usages that are the big winners for me. Everything else I could live without (although I don't really want to)
 
@DaveRandom you can use ctags for that
 
12:34 PM
@DaveRandom find usages. That is just "find through files" right? :P
 
Even vim has support for it :P
@PeeHaa no, it's semantic
 
@Machavity Yes, that would be a reason to switch to a simple editor, because PhpStorm obviously doesn't support yield from etc. yet.
 
@DaveRandom in a proper psr-0/4 project that's not a problem at all
 
...and this is precisely why I didn't want to get involved in this discussion :-P
/me smokes
 
12:38 PM
@DaveRandom hey you, stop right there, continue :P
 
@Amelia I don't get it
 
@Amelia cc @Ocramius
@Amelia ZF is an open source project, open an issue on it if you can :)
 
@DejanMarjanovic globally in zf2 you assume that the EventInterface there is an MvcEvent (which has no interface for what it defines). But that's not type-hinted. You're literally praying that you actually got an MvcEvent :p
 
Ah, okay, not familiar with ZF2, let's just blame @Ocramius :-P
 
unless you're not meant to. in which case every single bit of documentation about that method needs some changin' :p
 
12:48 PM
31 today, I expect cake!
 
Happy Birthday @JoeWatkins!
15
2 years before dying!
(Jesus' reference)
 
Happy birthday~
 
AAB
hi all
Can anyone help me with this github.com/chriso/klein.php
Happy Brithday @JoeWatkins
3
 
@JoeWatkins Haphpy Birthday!
 
1:05 PM
@iroegbu knew that was coming :p
 
aphpy birthday, @JoeWatkins ! All the best to you!
 
Gratz @JoeWatkins! \o/
@iroegbu You are a terrible person... :)
 
@JoeWatkins You're already so old :-D Happy Birthday
 
come on, he's a year younger than 0x20
 
and a year older than #o36
 
1:10 PM
you would not say that
 
@AlmaDo 11111 years already ;-)
 
@bwoebi crap ..
 
All of the coolest people are 31 now. Happy burpday @Joe :)
 
1:44 PM
fanx guys
 
Happy Birthday Joe
 
in The DMZ on The Stack Exchange Network Chat, yesterday, by Rоry McCune
http://www.ie8.rip/ <-- heh
 
@JoeWatkins 3v4l.org/F3oit
12
There's a tiny possibility that I'm avoiding work because I don't like the task I currently have to do...
 
@DaveRandom nice
 
<?php
// Bad approach

$some_arr = 10000000;
$time_start = microtime(true);
for($i=0;$i<count($some_arr);$i++)
{
// calculations
}
$time_end = microtime(true);

$execution_time = ($time_end - $time_start);

echo '<b>Total Execution Time:</b> '.$execution_time.' Secs';

// Good approach

$time_start_new = microtime(true);
$arr_length_new = count($some_arr_new);
for($i=0;$i<$arr_length;$i++)
{
// calculations
}
$time_end_new = microtime(true);

$execution_time_new = ($time_end_new - $time_start_new);
any guess
 
1:59 PM
Are you asking "why should I store the count in a variable instead of calling count on every iteration"?
 
Yup
 
Because it avoids the function call on every iteration, function calls are relatively expensive compared to reading the value of a variable
 
You could always write it like this:
for($i=0, $c = count($arr); $i < $c; $i++){}
 
@John use a pastebin... -.-
 
@SebastianBergmann I hope to get the patch finished today so it can be reviewed /cc @NikiC
perhaps we should remove arc4random totally
 
2:08 PM
I'm waiting for the day everyone links to libressl instead of openssl
 
You'll be waiting a while, I suspect
 
By the time it happens, TLS will be obsolete
And openssl et al will probably be abandoned.
 
2:24 PM
> "We are upgrading all qualified PCs, genuine and non-genuine, to Windows 10," says Terry Myerson, Microsoft’s Windows chief. Source
 
Hi Guyz... I have a problem with Zebra Barcode Printer. Please could any one help me
I am using Zebra GK420d Printer.
When printing the Barcode i am replacing special characters like (-,(,),:) with hexadecimal code to print the those characters
It is working fine In Firefox. But its not working in IE
i am using Latest IE version
 
/rooms/11/hardwaresupport
 
Could anyone help me to solve this problem. Thanks
 
@user3454479 How does your problem relate to PHP?
 
@allen
Sorry, I didnt find any chat room for ZPL
i am using PHP programming
 
2:28 PM
This has to be a troll
 
@user3454479 I had big issues with ZPL, eventually I abandoned in favour of PDFs (which the driver is perfectly capable of handling). Where is the printer attached? To the server that is executing your PHP script or to a client computer that is downloading the document to print and printing it locally?
 
FPDF has a horrible API but it does produce good results
 
@rdlowrey didn't you have an http client?
 
@DaveRandom snappy wants to have a word with you
 
2:36 PM
@Patrick Yeh that's a renderer though, while wkhtmltopdf produces some great looking documents, they are constructed pretty weirdly in many respects (they are difficult to manipulate after the fact). I've played with that in the past but it didn't suit the needs of the particular project I was working on at the time (label printing for shipping services)
@FlorianMargaine github.com/amphp/artax
 
@DaveRandom how is it difficult? We have all our documents (bills etc) as html/css and then create the pdf with it. Works great and changing things is very easy.
 
Have you ever tried modifying one of those documents in e.g. Acrobat after it's been produced, though? I realise that's not a common requirement, but the way wkhtml produces PDFs means that you end up with weird cell alignments and other oddities that make it very difficult to do so
 
@DaveRandom ah, thanks
 
@DaveRandom No... I wouldn't use a PDF if it has to be modified after creation
 
@Patrick tell me about it
When I saw the requirements for that project it was a pretty huge wtf for me
 
2:50 PM
@NikiC initial merge done, testing and doing some refactoring now
 
3:02 PM
@NikiC have you merged engine exceptions yet?
 
 
user895378
@FlorianMargaine yes. Chris's link should tell you everything you need to know :)
 
user895378
morning all
 
@rdlowrey yup, didn't find it in github.com/rdlowrey, I forgot that you moved it to github.com/amphp
 
user895378
ah sorry about that.
 
3:10 PM
np np
 
user895378
Hey @JoeWatkins! Happy birthday mate!
 
thoughts: should the exception be an EngineException or a TypeException extends EngineException ?
 
user895378
I would prefer a TypeException but it's easy to fall into the rabbit hole of exception hierarchy design. So be careful :)
 
@ircmaxell grats on the RFC passage, thank you for taking it up
 
thanks :-)
 
3:13 PM
Now.... named parameters ahem Nikita
I jest... kind of
 
user895378
I still don't understand why everyone wants named parameters ...
 
user895378
That and method overloading.
 
I don't think I'd go out and use named parameters in every bit of code I wrote, but if they were around, I'd use em.
 
@ircmaxell I would have assumed TypeException extends Exception. It's a data not a code problem.
 
@Danack It's a code problem most times
 
3:16 PM
@rdlowrey I don't want them ..
@rdlowrey and that crap as well ..
oh, ok, not crap. misleading stuff (for me)
 
user895378
I don't know about others but I rename things all the time ... making parameter names (and not numeric indexes) part of the public API is just asking for pain.
 
@rdlowrey that I will actively fight against
named parameters, I dislike, but whatever
 
user895378
@ircmaxell same. kwargs is whatever. overloading is harmful.
 
Not for weak types. But I don't care that much - except in that it probably does need to be catchable separately from EngineException, as bad data is a very different thing from code being borked.
 
With numeric arguments you can only be confused if you have too much parameters. And the rule is: 0 parameters - great. 1 parameter - good. 2 parameters - acceptable. 3 parameters - too much.
 
3:18 PM
Named parameters strikes me as similar to strict types -- not everyone wants them or would use them, but their absence in the language is frustrating if you DO because the alternatives to accomplishing the pattern are nasty. myFunct(array $args) is gross.
 
@Danack bad data is a sign that code is borked, because you should have validated it better
 
Thus, just don't create methods with f*ng 10 parameters
3
 
user895378
@ChrisBaker I'm with @AlmaDo ... if you have so many params that you need this you're problaby doing something wrong.
 
@rdlowrey or the class (if it is the constructor signature) is doing too much
 
user895378
Something else I don't really get: people whining about the strict typing application to an anonymous callable passed as an arg. The only logical thing to do in that case is apply the rules from the file where I created the callable.
 
user895378
3:22 PM
To me that is not a valid argument against the proposal. It's the only thing that makes sense.
 
well, we need to add typing of callable hints
 
user895378
@ircmaxell I'm not sure I understand what you mean there?
 
eh.. you mean that if you hint callable $x then it's not only the Closure which might pass? (also, array/string) ?
 
the ability to declare function foo(callable(int): int $bar) or whatever syntax
 
does $(tput cols) command works in unix shell ? it's works in linux shell ?
 
user895378
3:25 PM
Oh I see. Personally I think it would be more helpful to be able to specify individual callable types instead of an inline template like callable(signature, signature, ...)
 
@ircmaxell hm. Got it. Not sure can say now what procs/cons are (well, at least one benefit is obvious in declaring strict callable signature, but does it really has use-case when it can not be resolved other way .. not sure)
 
user895378
like being able to define a callable type like:
 
user895378
myCallableTypeName function(string $foo, int $bar);
 
@rdlowrey There are PHP core functions with 4, 5, 6+ arguments. The general theory of that philosophy is fine, but in practice we all know we wind up with a curmudgeon every now and again.
 
user895378
Then typehint with myCallableTypeName
 
user895378
@ChrisBaker You can easily create wrapper functions to solve this in userland if it's a problem.
 
user895378
And now you don't have to change the language with a feature of questionable usefulness.
 
user895378
Sure: the garbage neverending parameter lists of many internal functions is regrettable.
 
@ChrisBaker if someone is doing something wrong, it doesn't mean you should do that wrong as well
 
@rdlowrey Fair, but that's adding complexity and possibly boilerplate to userland when an Occam's Razor solution exists in letting me name the parameters I'm passing.
 
user895378
3:29 PM
@ChrisBaker You think it's simpler to change the language than to add a single level of abstraction in userland?
 
I think it is worth talking about. I'm not passionate enough on the subject to offer an effective ongoing rebuttal against anyone who is passionately against it.
 
I think named parameters would be awesome in php
array_search(needle: $needle, haystack: $haystack);
the world is saved
 
@FlorianMargaine that's trying to work around broken functionality…
 
user895378
function myHtmlSpecialChars(string $string, array $options = []) {
    $flags = empty($options['flags']) ? ENT_COMPAT : $options['flags'];
    $encoding = empty($options['encoding']) ? ini_get("default_charset") : $options['encoding'];
    $doubleEnc = !empty($options['double_encode']);
    return htmlspecialchars($string, $flags, $encoding, $doubleEnc);
}
 
user895378
^ problem solved
 
3:32 PM
One should not propose change in core PHP functions.
 
@bwoebi no, that's working around real APIs
 
sorry. I meant inconsistent APIs.
 
AND, I think the tendency to dismiss concepts like this as the drunken rants of people who are doingitwrong is an unhelpful culture within the internals community. Major languages implement this functionality for a reason, not to appease fools.
 
I'd rather we had a complete and utter sweeping overhaul of the standard library in a major release to properly standardize them
but I think that's destined for the bike shed
 
user895378
^ not going to happen because no one would upgrade
 
3:33 PM
true
 
user895378
If anything it would have to exist in a separate namespace.
 
^^ agree with all above
 
user895378
And even then you're looking at a deprecation period of several years
 
I'd rather have a stdlib namespace
 
@rdlowrey One place it would be really useful is SOAP. I detest it with every fibre of my being but it isn't going away any time soon. For me the main use case for named params is in wrappers making horrible APIs less horrible, I probably wouldn't use them when creating new APIs but sometimes (too frequently) one has to work with things that have horrible APIs, and making nicer wrappers for them often has value in those cases.
 
3:33 PM
declare(new_API=1) :-D
 
to be quite honest, now that we can use function
 
user895378
@bwoebi this would be a disaster. See mbstring overload
 
i'd use function stdlib\implode; :3
 
@bwoebi declare(language=C#)
 
@rdlowrey huuuuh?
 
3:34 PM
@rdlowrey A scalar OO API could solve a lot of those problems.
 
@ChrisBaker I think maybe if/when the named param RFC fail, we should reconsider Stas' default param RFC. That one at least is compatible with callbacks:
$foo = function ($foo1 = "foo", $foo2 = 'foo') {}
$bar = function ($bar1 = 'bar', $bar2 = 'bar') {}
$fn = rand(0,1) ? $foo : $bar;

//Named param style of default
$fn('foo2' => 'whatevs'); //This borks

//Default param style of default
$fn(default, 'whatevs'); // This works
 
@rdlowrey No, I ask why it'd be a disaster… (I know what it is… I learned 15 mins ago about it^^)
 
Yeah, it's so tempting to have millions of declare() statements, juggling them so no one will ever get the idea what will happen on next line without looking to that declaration list (:
Worse, some of them are global, while some of them aren't
 
user895378
@bwoebi Because code works differently (silently without erroring) from machine to machine.
 
user895378
3:36 PM
It breaks so much code in impossible to predict ways.
 
@kelunik There is nothing inherently wrong with a scalar API… But…
 
user895378
@Danack I still think it's a bad idea to add features to support bad API design.
 
@rdlowrey How is that related to awkward mbstring overloading?
 
@Danack That's a solid alternative.
 
user895378
@bwoebi Because that's exactly what mbstring overloading does.
 
3:38 PM
@Danack if you need a bunch of optional params… just make an array.
 
user895378
@ChrisBaker /me disagrees :)
 
user895378
It's a hack to support bad API design.
 
user895378
People should just not write bad APIs in the first place.
 
Why do people need default parameters so much? And why would you ever need more than one?
 
user895378
And for the terrible language APIs you can write wrappers.
 
3:39 PM
@rdlowrey named parameters is not just bad api though. Why should I care about the order of arguments, when all I want is to pass a needle and a haystack?
 
@FlorianMargaine Knowing position vs knowing the name: I'd argue in many cases the latter would be harder to remember.
 
user895378
@FlorianMargaine Because you're making a public API contract based on something that's exceedingly fluent and changeable.
 
user895378
parameter names change.
 
@rdlowrey The problem is once they're written other people don't have the luxury of re-writing their libraries and breaking compatibility. I'm not saying that I think default params are great, but they're at least compatible with callbacks whereas named params aren't.
 
Parameter orders change too
 
user895378
3:39 PM
@Danack wrapper functions.
 
@LeviMorrison much easier to read though
 
@FlorianMargaine Eh, I disagree.
 
@rdlowrey ...they do?
 
user895378
@FlorianMargaine disagree. There's nothing stopping you from doing some_call($name = 42, $name2 = 41)
 
user895378
@DaveRandom If you've ever wanted private constants you should probably be against named params
 
3:41 PM
sorry, but array_search(needle: $foo, haystack: $bar); is easier to read than array_search($foo, $bar);
 
user895378
You're just adding more to the public API contract.
 
There is a language I am aware of that assignment is not an expression, so you can't do things like while (value = func()). This means that they can use "assignment" syntax for their default parameters: in_array(haystack = $haystack, needle = $needle).
 
it's immediately clear what the parameters are
 
@rdlowrey I never appreciate this response. Shoulda coulda woulda, most working code in the wild does not stand up to textbook standards. Most working code is a hot mess, and the reality most developers deal with at their job is dealing with that hot mess. I don't see much value in taking a theory hardliner approach when the vast majority of real code does not.
 
user895378
@FlorianMargaine you can do that in your code now. Nothing is stopping you.
 
3:41 PM
That's much longer than in_array($needle, $haystack).
 
@rdlowrey how?
 
user895378
@FlorianMargaine array_search($haystack = $foo, $needle = $bar);
 
@rdlowrey yeah, except you're creating variables
 
user895378
So?
 
user895378
If you want readability that's a great thing.
 
user895378
3:42 PM
Where did that value come from?
 
@ChrisBaker +1
 
user895378
Variables are better declared with names than literals.
 
and array_search($needle = $bar, $haystack = $foo); suddenly doesn't work
 
user895378
Since we're advocating for readability here.
 
user895378
If readability is what you're after then name your parameters. Period.
 
3:43 PM
@rdlowrey if I name my parameters, it's stupid to rely on order
 
Look, this would go away with better static type checkers anyway.
 
user895378
No default placeholder or named parameter is required. You can have all the readability you want today.
 
user895378
@FlorianMargaine Except you've added more to the public API contract that people have to remember.
 
user895378
It's more cognitive overhead.
 
@rdlowrey what? no, they just have to know the names of the parameters. And sorry, but I remember names better than orders.
 
3:44 PM
@Danack If you know that you want to skip the first parameter no matter what the callback will I play the contrived use-case card :)
 
for example, you know that array_search takes a needle and a haystack, but you don't know the order
 
user895378
@FlorianMargaine And now you can't change the name of parameter without breaking BC. When you could've had all the readability you want without that new restriction.
 
Surely if you can pass them in any order, you've merely replaced one thing to remember with a different thing to remember. You haven't actually added any cognitive overhead.
 
user895378
It's a completely superfluous and unnecessary addition.
 
@rdlowrey just like you can't change the function name
 
3:45 PM
@DaveRandom I think names are harder to remember than positions, honestly.
 
user895378
@FlorianMargaine Not a new rule.
 
a public API is a public API... your argument is kinda bad imho
 
And let's be real: checking documentation is part of your job.
 
user895378
@FlorianMargaine your argument is kinda bad imho
 
user895378
Readability does not require named params
 
user895378
3:45 PM
What other argument do you have?
 
require? no
helps? definitely
 
@FlorianMargaine Currently the name of the parameters is not part of the API. This is just one of the reasons I really, really don't like named parameters.
 
user895378
@FlorianMargaine No it doesn't. Not if you use the tools already at your disposal.
 
user895378
"If I just had this new feature then I would write readable code"
3
 
Shoot, until very recently you could use the same parameter name in a parameter list in the PHP source APIs…
 
3:46 PM
@rdlowrey that's not what I said. Don't put words in my mouth
 
user895378
That's like saying, "if only I made more money then I would put some into my savings account"
 
How is that equivalent? If I made more money, then I would put some into my savings account -- real talk.
lol, bad analogy
 
user895378
It's perfectly feasible to write readable code right now without named parameters. If folks aren't doing it then it's a programmer failing and not a language failing that needs to be addressed.
 
user895378
@ChrisBaker perfect analogy.
 
No offense to people saying that it's a bad analogy, but I suspect you guys aren't good with money if you don't see the relevance :)
 
3:48 PM
yes, it's perfectly feasible. I think named parameters would be a nice addition to it.
I'm not saying good APIs can't be done today
 
No... right now, I make enough to pay my bills. If I made more, I would put it in savings because it is extra. Anyway, don't want to derail.
 
user895378
@FlorianMargaine Fair enough :)
 
I'm just saying that named parameters would make it even easier/better
 
user895378
Possibly true. I just see it as having a non-zero cost in terms of new complexity and potential for abuse. The only question to resolve is whether or not the added flexibility justifies those costs.
 
user895378
That's where the debate really lies (like most features).
 
3:49 PM
well, yeah, like most features, as you say :P
 
user895378
I certainly appreciate you guys opinions. Thanks for the healthy debate.
 
public function AddDocumentIn($eventTypeID, $caseID = null, $leadID = null, BaseDocument $document = null, FollowupOptions $followupOptions = null, $flags = 0) <-- real code, an unavoidable evil because it wraps someone else's API, and one that would be made a lot nicer for the caller if I could pass $flags without having to pass 4 nulls first
 
@DaveRandom that's not the debate though :P
 
in c, can you do a variadic macro?
#define RAISE_TYPE_ERROR(strict, args) if (strict) {\
	zend_type_error(args);\
} else {\
	zend_error(E_WARNING, args);\
}
 
user895378
19 mins ago, by rdlowrey
function myHtmlSpecialChars(string $string, array $options = []) {
    $flags = empty($options['flags']) ? ENT_COMPAT : $options['flags'];
    $encoding = empty($options['encoding']) ? ini_get("default_charset") : $options['encoding'];
    $doubleEnc = !empty($options['double_encode']);
    return htmlspecialchars($string, $flags, $encoding, $doubleEnc);
}
 
user895378
3:51 PM
@DaveRandom ^
 
user895378
problem solved
 
my opinion is that adding named parameters, even with just 2 parameters, gives more readable code
 
but I guess you already read that?
 
lmgtfy
 
3:53 PM
@FlorianMargaine C99 if I read that correctly
 
the preprocessor is part of C standard?
 
> Variable-argument macros were introduced in 1999 in the ISO/IEC 9899:1999 (C99) revision of the C language standard, and in 2011 in ISO/IEC 14882:2011 (C++11) revision of the C++ language standard.[1]
 
public function __construct($success=false,$transactionId='',$profileId='',$message='',$amount=0,‌​$method='none',$sandbox=false) <-- real code and no budget or dev time to refactor, passing sandbox=true without all the intervening defaults would be nice. Deal-breaker? No. Nice? Yes.
 
dammit
 
3:54 PM
anyway @rdlowrey my experience with named parameters comes from Ada, and it's been really pleasant to use them
 
user895378
@ChrisBaker So create an init function. $obj = myClassCtor()
 
user895378
@FlorianMargaine I mean ... I see how they can be quite useful. I used them all the time when I started out in python as a noob coder. But I look back on that time and realize that it was all terribly written code. The potential for abuse is high.
 
user895378
It lowers the cost of writing bad code ... which is not something I'm sure we want to encourage.
 
user895378
(much like traits)
 
@ircmaxell Possibly. The use case is going to be that when people are processing a large batch of data, they are going to want to be able to catch type errors, and continue processing the rest of the data. Which sounds like a horrible use case, but is something people will want to do.
 
3:56 PM
@rdlowrey it makes reading/writing bad code easier?
ffs I want it immediately!
dunno what world you live in, but mine is full of it :P
 
user895378
hehe maybe valid ... php is all about fast and easy. Much like @PeeHaa's mother.
6
 
@FlorianMargaine :D
@rdlowrey It / she sure is \o/
 
That's what I do :) Then in 3 months, I have to go look at myClassCtor instead of seeing, right in place, new myClass(sandbox => true);. I don't mind the helper function, but KISS, right? That's a use case that comes up again and again and again in real-world code. CAN you get around it? Yes. But I'm "getting around" something, if the language could accommodate the use-case using a well-defined approach common to other languages, then I can simply instantiate my object and move on.
 
@rdlowrey I know you will scoff at this, but it's the stringyness of the names that bothers me there. There's something about that, when syntax highlighted, which bothers me and affects readability quite heavily for me. It's also deferring errors in param naming to run time, whereas with "real" named params these could be caught at compile time.
 
user895378
@PeeHaa And it's a good thing too! Otherwise we might not get to enjoy your witticisms :)
 
3:59 PM
Hi all
can someone please help me in my issue?
1
Q: How to implement 'Token Based Authentication' for accessing the website's resources(i.e. functions and data) which is developed in PHPFox?

user2839497I want to use methods and resources from the code of a website which is developed in PHPFox. Basically, I'll receive request from iPhone/Android, I'll get the request and pass to the respective function from the PHPFox code, take the response from that function and return it back to the device....

 
:P
 
user895378
@DaveRandom this is me not scoffing. It's a valid point and one I hadn't really considered.
 
A world without PeeHaa is just Pee, and no one likes that.
4
 
user895378
^^ all the laughs would be gone
 

« first day (1614 days earlier)      last day (3334 days later) »