« first day (963 days earlier)      last day (4210 days later) » 

17:00
@LightningDust you can invert the colors if you like in the prefs
Thoughts on HTTP Request objects being immutable? (definition: a composition of all data pertinent to a given HTTP request, encapsulated into an object; we've all made them)
as far as I remember, you can somehow disable the aqua layout of os x
user652649
look at this masterpiece: phpjs.org/categories/classkit O_O
@Ocramius you have been virtually killed :)
@LightningDust but there are things on OS X I dislike. Like the gatekeeper, the launchpad, ...; but I'm not forced to use them.
17:04
@Bracketworks Definitely. My own Request objects are immutable; after you construct them there's no (sane) way to modify their contents without using Reflection
Figured; I'm just wondering if anyone has strong opposition to it (can't see why off the top, hence the question)
I'm going the RequestBuilder -> ImmutableRequest route.
But the UI I really like. I sometimes feel that windows looks a bit clumsy compared to OS X
@bwoebi really? I kinda feel like the OSX interface is those too-large lego blocks you find that are cheaper than actual lego
I think I accidentally words
@Suavelizard I don't get this comparison...
It just feels off. Clunky like its talking through an interpreter
like having non-stock android
probably just in my head but it drives me crazy
17:09
mhm.
But this is always very subjective.
@bwoebi I prefer white on black, and as limiting as Windows is there has always been a way to do this easily
@LightningDust this is terminal interface for me^^
I like some things about OSX. It being *nix based for one
Maybe what sucks about windows is that you often have these keyboards you can push deep. while apple keyboards have flat keys.
I like my cheap Qsenn keyboard :p
17:15
._.
What sucks about Windows is that it tries so hard to be UNIX like by
@LightningDust but as said: you can do it white on black in the sys prefs
But* won't go the full way
@LightningDust ah...? how?
Without or with inverting everything
17:17
with.
I don't want images and web pages inverted, just the UI
ah okay
but this looks ugly ?!
Imagine trying to watch YouTube inverted :p
I don't watch yt^^
I do, we don't get MLP on TV here :p
17:19
@LightningDust But isn't it ugly when everything around (UI) is dark and in the middle there's so much light?
No, my usual windows are terminals (dark); email (dark) and an ide (dark)
So ugly is the UI being white with so much dark in the middle
@LightningDust that's why I have everything with more white
posted on June 05, 2013 by Qafoo - PHP

On the train back I'm just uploading the slides of my talks at the International PHP Conference in Berlin, which ended some minutes ago. In my first talk I captured my experience with designing RESTful web services, summarizing pitfalls and low hanging fruits under the topic "Pragmatic REST". The second talk dealt with Behavior Driven Development on basis of Behat. Find the slides for download

only the terminal is black with green font color in a separate space
I can't code dark on light, hurts my eyes to stare at white for so long
17:23
do you often code when it's dark outside?
don't you have any other light sources in your room?
Yes, its well lit
@LightningDust not enough it seems.
I have a nice mid grey komodo theme
Very comfortable to use for hours at a time
17:25
I prefer light.
Usually the only light thing open on my screens is SO chat and whatever I'm watching on Youtube or other video players
or websites
I could now … If I wouldn't know that this is very subjective.
And as it's subjective, I wish Apple had included it as an option :P
Like even MS does
Where things are subjective, make them optional
Not including gcc and requiring me to use a bloated tool like Xcode bothers me too
@LightningDust it includes llvm-gcc
when you install xcode
you only need to install it.
you don't need to use it.
as far as I know, gcc isn't included by default on the most *nixes?
Yes, I had to download a 3GB IDE to get a c++ compiler :p
Seems more than a little irrational
Which, of course, doesn't play nice with other IDEs
17:35
it's part of xcode but you also can install it separately
@bwoebi Ahh, that's a new option afaik
I last used OSX in 2010
But XCode is a good IDE I think.
@LightningDust Even Apple improves sometimes :p
@bwoebi I've heard good things about XCode
but?
I didn't see a dark theme for one
Or a bzr plugin
17:40
@LightningDust what's bzr?
@LightningDust Is this your only problem?
Canonical's VCS
@LightningDust It has built-in git support
Dark theme is a bigger one
I've actually never used git extensively, company I work for uses bzr
17:41
@LightningDust I mean the dark time
@LightningDust and I never heard of....
You've heard of launchpad and Ubuntu I assume?
Both use bzr
I only know the launchpad built-in program of os x...
and ubuntu^^
So do Oracle and GNU
But I think you've meant another launchpad?
Among other org
It's pretty big
I mean launchpad.net
It's like github for bzr
17:43
@LightningDust never heard of
It hosts the Ubuntu code base
I think git is good enough (at least more popular...)
And a lot of ppa's for Ubuntu/Debian
And MySQL apparently
I'm sure git is fine but my workplace uses bzr so I need it supported
and linux, php, bootstrap etc. use git.
Yeah git is huge
Even if I have some minor gripes with it (why change all the command names from the ones we all know? :()
17:49
@LightningDust you may also edit in your ide and then commit from the cmd line?
But no, I haven't heard much bad about XCode, though I wouldn't be able to use it at work and learning / switching between the keybindings for multiple IDEs may not be efficient, right now I just use Komodo everywhere
I can do that, I don't mind commit/push/pull from the cli, I just want to be able to diff in the IDE as I code
there aren't lots of keybindings, most of what you need, you can do with your mouse.
In Komodo IDE, it marks lines which have been added since the last commit
I barely touch my mouse except for code crawling :P
Komodo has a lot of very good keybindings
Oh, not having right click is weird too
@LightningDust I mean, you can use keybindings, but you don't need lots of.
I also don't understand why XCode is bigger than VS by like 100%
and bigger than Komodo by 500%
17:53
the only keybinding I really need is "build & run" cmd + r
breakpoints I can set by clicking on the line number with the mouse
What languages do you code?
I often use f7/f8 (next/last method)
ctrl-g for 'Go to declaration'
the actual variables are all listed on breaking
@LightningDust mostly C, a bit Obj-C
OK, I've never used Obj-C
I write C, C++, PHP, Ruby
@LightningDust PHP I write too, but not in XCode
My job is mainly PHP/Oracle stuff
We ditched MySQL :P
17:56
@LightningDust hold cmd key and click on the method's name
Table with 5 million records in MySQL crawls
@LightningDust good luck^^
What do you code PHP in?
PHPStorm
Didn't even know that was available on Mac
17:57
It is.
I really like it.
(For quick scripts I use /usr/bin/nano)
I tried so many IDEs for PHP then ended up right back at komodo
Aptana was too slow, Zend Studio was even slower, NetBeans was even slower still. Sublime was OK but lacked proper code completion... Komodo isn't perfect but it does everything how I expect it to
For quick scripts I tend to fire up emacs
I used emacs a lot in college, but the IDE really does increase productivity once you're working on projects of a certain size
phpstorm has code completion and a lot of coding style and layout options
@LightningDust same here.
Amagad - Can anyone confirm that class_exists() caches results during the same script? I'm going nuts here.
I'm supposed to follow Zend coding style, though I don't think I 100% do
"My quick script worked perfectly." - No one, Ever
3
18:00
^ So true
@LightningDust I don't know the names of them...
"My quick script worked perfectly, therefore I haven't found the bug yet."
@LightningDust I tend to use only brackets where necessary. Everything what increases line number without increasing readability is unnecessary.
@LightningDust I use every time double quotes. Only if I need double quotes in the string I switch to single quotes
@LightningDust wtf… spaces around the . operator?!
eeeeh I really hope I never have to inherit your code :P
CAM
CAM
18:04
alias judo='afplay /Users/chris/Music/hiya && sudo'
Baller
@PeeHaa埽 Mine or @bwoebi s? :P
@bwoebi's :-)
@bwoebi: $this = $that." with some ".$text.$here OR;
$this = $that . " with some " . $text . $here; ?
@PeeHaa埽 why?
Which is more readable? :P
18:05
@LightningDust the first.
@bwoebi No whitespacing. No braces.
I normally use single quotes for just about everything
Mixing quote types
at least in an ide which highlights strings
I get cried at for it sometimes
18:06
@LightningDust Everything besides sql
I never use variables in strings either, always use the . operator.
@PeeHaa埽, we use Zend so I'm rarely writing an SQL statement
@LightningDust goto ;
@PeeHaa埽 but I make a new line before and after ifs, whiles etc.
@bwoebi Even worse
if (something)
    echo 'something';
I'm sometimes guilty of this:
^ bad things bout to happen
18:08
if($this) return false;
@PeeHaa埽 ACK ACK ACK
@PeeHaa埽 Why? It optically separates the if from the other code?
When everyone else here uses:

    if ($this) {
        return false;
    }
if (something)
    echo 'something';
    echo  'hmmmmm';
aragasdasdOfjidfj[psihdihsd[ih{)DIFH[0ISDF[0iSJDF[
stahp.
18:09
I also hate whitespace
// like:
$var = "bla";

if ($var == "bla")
    return 1;
elseif ($var === 0)
    return 96;

return 0;
if($this){ is perfectly readable...
@LightningDust no! help!
^ I don't do that @bwoebi :P
@PeeHaa埽 That's why you indent correctly...
18:10
@LightningDust and also , it is completely pointless
the result will always be truthy
@bwoebi no. you missed the point of adding something to the block
@PeeHaa埽 ??
I don't want to think about whether somebody added braces. I just want to add my stuff in the block
when you add sth, you add the braces?
// Example
$var = 'foo';
if($var == 'foo'){
    return true;
}else{
    return false;
}
return 0;
or better
18:11
how would you get to the return 0 :P
@PeeHaa埽 In an one-liner if you see if there are braces without searching for them.
@PeeHaa埽 that's why I did an elseif xD
@bwoebi I don't want to fix the braces.
I just want to add my code
$var = 'foo';
if($var == 'foo') return true;
return false;
The point is that when I come across code without braces I have to stop reading and study in detail the block so I can be sure it is formatted correctly. Rarely if ever are you reading 3-5 lines of code in isolation
If I write an if statement without braces it's always on one line.
18:13
@cspray Thta's why I indent my code?!
@LightningDust bäääh.
@LightningDust Boo.
@bwoebi I'm sorry but I don't trust every developer that might come along to do that all the time in a sane way. I don't like whitespace indicating control flow; that's why we have braces and other block designators.
I also get complained at for using ternary operators all the time
@LightningDust Boo ? BOO! : BOOOOO!
@LightningDust For good reason
18:14
@PeeHaa埽 I don't {} write when return, continue, break is in question, because I know there won't be anything more than one line there... and I found myself often not correct :P
@PeeHaa埽 Not really, they're very readable.
@LightningDust Not really. They tend to become unreadable fast
@LightningDust If you don't use nested ternary operators, it's okay.
There are usecases. But people tend to abuse it
return $var == 'foo' ? true : false; most pointless ternary if ever...
18:16
@bwoebi I've done that on occasion, but no I don't generally, it gets unreadable fast.
@webarto Until you have to refactor it
The problem with ternary operators, is maintenance. They're readable in only the simplest terms, but when you come along and have to add subsequent condition branches, now you can either nest ternary operators (which hopefully you'll be hit by a truck for) or you can convert to an if block (which you should have done to begin with)
@webarto yeah, @PeeHaa埽 why refactor?
@bwoebi Why refactor? Because nobody writes code the right way in one single run
@Bracketworks that's why I say: never nest them. It'll make you insane.
@PeeHaa埽 no, why is it a problem when you refactor?
18:17
@bwoebi You won't have time to go insane, as I'll be driving around looking for people to hit with my truck.
@PeeHaa埽 return $var == 'foo'; :P Are you saying you are writing Refactor ready code? :P
@webarto Nope. I would call it defensive
$var = ($x > 5 ? 'foo' : 'bar');

vs

if($x > 5){
    $var = 'foo';
}else{
    $var = 'bar';
}
I see no reason to use the latter ever
@webarto But in that specific piece I can live with it
@LightningDust remove these parenthesis!
18:18
@bwoebi Mistakes are lurking
@PeeHaa埽 IMHO you have to be defensive because when shit hits the fan it's too late. (in general)
@LightningDust uhhhm no neither
$var = 'bar';
if ($x > 5) {
    $var = 'foo';
}
@LightningDust I'm guessing the reason for your parenthesis is you're preparing to nest ternaries ;)
Still seems less readable to me
if($x > 5)
    $var = 'foo';
else
    $var = 'bar';
@Bracketworks The fact that nested ternaries are a PITA is PHP's fault though, not the ternaries
18:20
@PeeHaa埽 I'd still rather use the one line ternary than that four line (or two line if you don't use the braces) operation.
also: evning
@NikiC nested ternaries aren't beautiful in C for example too.
@LightningDust Am I getting old or do people really love to write unreadable code?
@bwoebi They can be okay, because C has the right precendence
@PeeHaa埽 I try not to write unreadable code.
18:22
@LightningDust You wouldn't pass FizBuzz interview question, then.
@PeeHaa埽 No, but everyone may have it's own definition of beautiful code style
return x == 0 ? 1
     : y == 1 ? 7
     : z == 2 ? 3
     : 42;
^-- doesn't look that bad, does it? but not possible in php
@NikiC I don't really love this as I'm confusing it with PHP's style^^
@NikiC - Looks nice to me :P
@NikiC that looks terrible...
18:23
@bwoebi There are some things you can do (and everybody should do) to limit the number of WTFs in code
Next we will be declaring the return type in the method declaration.
@Pheagey I would love that :)
@PeeHaa埽 I don't have WTFs when I reread my code from 6 months before
@Pheagey Why is that bad? :p
@bwoebi My entire code looks WTF when I look back...
18:24
(I only have WTFs when I read code created when I begun programming (the first year)
@webarto Then you do sth wrong.
Me too, it'd make other peoples horribly commented code slightly less confusing
@LightningDust IMHO return should return a value of the method, not be/have part of the method logic -in- the return data location,.
return $data; simple, complete, easy to read.
@bwoebi I suck.
@webarto Nice to know.
18:26
public bool isFull()
Vs public function isFull()
The former is far more obvious as to what it does
From the method declaration
I like it in PHP to be able to return NULL or an integer for example. (NULL as error)
Is it Refactor Ready?
Return 0 :p
if you write unsigned long long func (); and 0 is a valid return value (≠error), then you have a problem.
to signalize that there was an error
Throw exception
18:29
in C?
I thought you were comparing C++ to PHP.
C needs libraries to handle exceptions correctly
C++ has exception handling
that's why I use a pointer in the params list
char * error ...
I do like the ability to return variable types, I guess that's true
Different* variable types
Like int|false
But that could be allowed in the method declaration in a high level language like PHP
18:33
@LightningDust yeah, that's what you can in PHP. That's why it's good that PHP is dynamically typed.
Unfortunately a lot of people don't know how to comment code properly
For me, I start a function with a comment like this:
@LightningDust you don't want to know how much I comment my code :-(
/**
 *  someFunction()
 *  This function does something
 *  Version 1.4
 *  Author Lightning Dust <[email protected]>
 *
 * @param int $someId
 * @param array $someParams
 * @return bool
 */
public function someFunction($someId,$someParams)
{
    ...
@LightningDust If PHP would allow full typehinting and return type definition you would almost never have to comment your methods, because you can just read the method signature
18:35
trait WebSocket {
	public function WebSocketInput (User $user, $buffer) {
        // ...
        }
}
I consider this to be acceptable commenting
for a function
I don't comment such functions as it's evident what they do
Also. Version? author? Why?
method name? Yo dawg
Venting here: this is the font I've been told to use for all H1 headings on the company website: google.com/fonts/specimen/Dancing+Script
@PeeHaa埽 We use authors internally so that code responsibility is easy to track
18:36
@LightningDust version control
@Suavelizard
@PeeHaa埽 Yes, we have that too :P But if someone adds one line to my function I still retain code responsibility for the function.
@LightningDust brrrrrrrrrrrrrrrrrrrrrrrrrrrr
But the VCS would say it's him that's recently updated it
@bwoebi I tried man I really did. But I went down like a Stark
18:37
@LightningDust track where it was added?
This chat gives me headache. Bye.
@webarto Are you performing better when coding like the people posting here?^^
@PeeHaa埽 I have to approve any pushes which modify my functions before they can go live.
@LightningDust Talk about overhead :P
@Suavelizard quit.
18:39
@LightningDust still: brrrrrrrrrrrrrrr....rrr
@PeeHaa埽 Mission critical setup :P
@LightningDust that's why we have unit tests
@PeeHaa埽 We do too, but code responsibility is still an issue
@PeeHaa埽 how do I test an untestable thing like a daemon?
@LightningDust hmmmm I would really say thanks but no thanks
@bwoebi What do you mean?
18:40
Someone needs to get the blame if something falls over :P
@bwoebi How is a daemon untestable?
@LightningDust Yes. But that really isn't me when somebody else tweaked the code :)
@PeeHaa埽 I have a big pthreads application with websocket. how do I unit test the websocket?
@bwoebi The hardest things to tests are UIs
@PeeHaa埽 If that person is a part of a team which you are responsible for, yes it is :P
@bwoebi You don't test the entire thing in one test.
@LightningDust the api with the rest of the world.
18:42
@LightningDust Behavior Testing...
@bwoebi Write tests which make the API calls, test for expected returns
@PeeHaa埽 I don't say in one test, but how do I?
What @LightningDust said
@LightningDust how do I test the websockets output when this is some binary data?
18:43
@PeeHaa埽 or you can just use phpstorm which makes it for you without any further comments :)
@bwoebi We just created an API key for 'test user'
And then call every single API call, time the responses and check the returns are expected
@hakre Still it would be pretty awesome
:-)
(timing is important, someone could make one tiny looking change which destroys performance)
@LightningDust I mean how do I know if I have the expected output when it's some binary data?
@bwoebi How does your web socket interface with the outside world?
18:45
which is bitmasked to
@bwoebi Expected data in expected data out
@PeeHaa埽 give me the expected data
@bwoebi I assume people don't connect to it looking for a stream of binary data, so do whatever the client on the other side is doing to make it valuable
I can't imagine it from me head
@bwoebi You can / should do that in your tests
18:46
@Suavelizard pretty :]
@LightningDust then I'd have to write a decrypt in my unit test which may be also wrong
You provide the (specific) data yourself when running unit tests.
I'd need to unit test the unit test then xD
Yo dawg :P
@CarrieKendall -.-
18:46
@Suavelizard i hope its a wedding/bridal website thought ;]
@bwoebi Why would the decrypt be wrong? You don't know your own decryption keys? :P
@LightningDust look at the websocket API.
the rfc I mean.
@CarrieKendall avionics manufacturing.
You need to do some bit ops etc.
@bwoebi Implement websocket in your unit test, it should act as a client would
18:48
There are mocks for that ;)
@Suavelizard aha, close enough
@PeeHaa埽 how do I create the mocks? they're only some binary data I cannot write off my head
@bwoebi Our full test suite runs overnight, it's colossal
@LightningDust no, your application is too slow to run it faster, that's the problem :p
"they're only some binary data I cannot write off my head" Record and playback?
18:49
?
every time someone says something is huge, colossal, big, etc i have this undying desire to reply no u
@bwoebi So use bindings
what sort of bindings?
@bwoebi If they're really sending binary data which you have no control over, you can just record what they're sending and repeat it, if you want to test that your server issues an acceptable response to the same data.
Would have to better understand what's sent and what's expected in order to know how to test it. If you have an API that suggests that you issue a call and get a response.
We use a JSON-RPC API, for example. You send json, you get json.
You send {'function':'getBalance';'apikey':'bunchofbase64';'params':{...}}
And you get some predictable output

« first day (963 days earlier)      last day (4210 days later) »