Time |
S |
Nick |
Message |
01:19 |
|
|
SEx2 joined ##javaee |
01:59 |
|
|
TinkerTyper joined ##javaee |
03:03 |
|
|
Guest16298 joined ##javaee |
03:39 |
|
|
Voyage__ joined ##javaee |
06:18 |
|
|
Guest362 joined ##javaee |
06:18 |
|
Guest362 |
howdy!!!!!!!! |
08:47 |
|
|
neuro_sys joined ##javaee |
10:56 |
|
acuzio |
Is that you Quest ? |
11:54 |
|
|
weyer joined ##javaee |
12:19 |
|
|
neuro_sys joined ##javaee |
14:50 |
|
|
weyer joined ##javaee |
15:00 |
|
|
cem joined ##javaee |
15:00 |
|
Guest51630 |
hiiiii |
15:06 |
|
Guest51630 |
double ## for the channel is a problem , i usually end up in namespace :'( |
16:05 |
|
acuzio |
yeah ; it happens |
16:57 |
|
|
sfisque joined ##javaee |
16:57 |
|
Guest51630 |
switch is better then if else |
17:16 |
|
acuzio |
no |
17:26 |
|
|
TinkerTyper joined ##javaee |
17:27 |
|
neuro_sys |
switch is terrible |
17:27 |
|
neuro_sys |
speaking from my experience |
17:27 |
|
acuzio |
yup |
17:46 |
|
|
Milla joined ##javaee |
18:42 |
|
|
weyer joined ##javaee |
18:44 |
|
sfisque |
depends on implementation. in some cases a switch will generate better code, other cases if-then is better |
19:00 |
|
|
Voyage__ joined ##javaee |
19:20 |
|
neuro_sys |
what about nested turnary operator |
19:20 |
|
neuro_sys |
it looks pretty |
19:20 |
|
neuro_sys |
either ways, missing a break in switch-case is disastrous |
19:25 |
|
sfisque |
if you mean ()?: i hate when people nest that shiz. heroically unreadable and fraught with lots of "i spent 7 hours last night debugging that one line you did" |
19:25 |
|
sfisque |
unless you're writing code for an "obfuscated [lang] |
19:26 |
|
sfisque |
" contest, don't nest that crap |
19:26 |
|
neuro_sys |
the heck |
19:26 |
|
neuro_sys |
it reads beautiful |
19:26 |
|
neuro_sys |
http://stackoverflow.com/a/243349 |
19:28 |
|
sfisque |
1) not a real world example. 2) it is unclear what it is trying to achieve outside of just code (the business rule is not easily elucidated and ultimately would need to be commented because the code is not self-commenting) |
19:29 |
|
sfisque |
very few nested ?: operations i've seen are "scalar" driven, but instead contain method calls, operations, and other stuff that in the end just turns it into spaghetti code in the real world, no matter how elegant it looks "in the lab" |
19:30 |
|
neuro_sys |
?: operations that have method calls sounds disturbing |
19:30 |
|
* neuro_sys |
twitchs |
19:31 |
|
neuro_sys |
I avoid it always at work lest my coworkers are like the fuck. |
19:31 |
|
sfisque |
you are not alone in that sentiment :-D |
19:31 |
|
neuro_sys |
but there's been a few cases when switch-case's were missing a crucial break |
19:32 |
|
sfisque |
aye, i wish they would treat it like a block. if you have a case enclosed in {} it should be considered "scoped" and break at the end, otherwise treat it inline with no break |
19:33 |
|
sfisque |
or something similar |
19:33 |
|
sfisque |
though that could make cascading (when you want that feature) more difficult to maintain |
19:33 |
|
neuro_sys |
yeah a curly braces block would be neat |
19:33 |
|
sfisque |
there are times where i've made use of cascading in switches with very nice |
19:33 |
|
sfisque |
code optimization results |
19:34 |
|
neuro_sys |
yes cascading switches are useful, adds to readability as opposed to an equivalent if-else ladder I guess. |
19:35 |
|
sfisque |
or segmetned cases where you repeat tons of code over and over again |
19:35 |
|
sfisque |
blech |
19:36 |
|
pdurbin |
neuro_sys: your co-workers are like http://www.osnews.com/story/19266/WTFs_m |
19:36 |
|
neuro_sys |
haha I know that one |
19:36 |
|
sfisque |
lolz |
19:36 |
|
neuro_sys |
it's so true |
19:37 |
|
sfisque |
or "why's per hour"…. |
19:39 |
|
neuro_sys |
it's awful if the colleague whose code you're reading is across in the same room |
19:40 |
|
neuro_sys |
and that moment when you're like in the most polite tone, "hey, mister Foobar could you look over here for a bit, I don't quite get what this block means." |
19:40 |
|
neuro_sys |
it's even more hilarious if they say "I don't remember either" |
19:42 |
|
neuro_sys |
http://imgur.com/a/F7AcL |
19:42 |
|
pdurbin |
sfisque: have you ever used perltidy? |
19:43 |
|
sfisque |
negative |
19:43 |
|
pdurbin |
:( |
19:44 |
|
sfisque |
neuro_sys it's not strange to not remember what a block of code does. there was a study back in the day by bell labs. they found that optimally, a developer of decent calibre could "actively maintain" 5k lines of code (as in they knew what every line was doing and understood all of the side effects) |
19:45 |
|
pdurbin |
does checkstyle actually format your code for you (according to the rules you've specified) or does it only complain about where you broke your own rules? |
19:45 |
|
sfisque |
i believe PMD, CS and BF only complain and do not do formatting |
19:45 |
|
pdurbin |
(you can use perltidy either way) |
19:45 |
|
pdurbin |
hmm. I want a tool that goes ahead and does the formatting, like perltidy does |
19:46 |
|
sfisque |
i believe there is/was a NB plugin that did tidying for java and maybe C. not sure about perl/php |
19:47 |
|
pdurbin |
oh sure, netbeans will do it. but what if someone is using a different IDE? at least a command line tool (like perltidy) is IDE-independent |
19:49 |
|
neuro_sys |
http://xkcd.com/1319/ |
19:50 |
|
pdurbin |
nothin' huh? oh well |
20:16 |
|
|
abeym joined ##javaee |
20:25 |
|
|
abeym left ##javaee |
21:51 |
|
|
chris64 joined ##javaee |