Viewing a response to: @reggaemuffin/re-mkt-re-reggaemuffin-introducing-the-coding-challenge-20170817t171542809z
Oh I really just forgot the "in all other cases" part... :D Actually I never print the number, only in the loop but that was just to check the result. But I have to say that it is hard to write "good" code without a real use case. In my opinion a one-liner (like @benniebanana suggested) is often a perfect copy/paste solution for simple and unshakable logic. I like code that is confident enough to say "Don't f***ing touch me. I just work! Please do the same!" Concerning the if-statements I find my version more readable but that's maybe only because I am so used to do it that way. But I don't see any problems with that anyway. Also the function could return null.... maybe that's an issue. But we're in the PHP world here... :P It's like asking your 8 yo child to look after your 4 yo one while you're at work. You get prettily painted walls but the cake doesn't taste that well. :D Anyway... your competition could become very funny and educational. Keep it on!
author | mkt |
---|---|
permlink | re-reggaemuffin-re-mkt-re-reggaemuffin-introducing-the-coding-challenge-20170817t203611617z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"users":["benniebanana"],"app":"steemit/0.1"} |
created | 2017-08-17 20:36:00 |
last_update | 2017-08-17 20:40:42 |
depth | 3 |
children | 1 |
last_payout | 2017-08-24 20:36:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 968 |
author_reputation | 45,513,283,519,678 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,118,156 |
net_rshares | 0 |
PHP certainly is like an 8 year old looking after a 4 year old! I'm less a fan of such confident code when it's just there without comment. If it's a one line code like the one above, I'd hope it has 2 lines of comments explaining it so you know not to mess with it.
author | ratticus |
---|---|
permlink | re-mkt-re-reggaemuffin-re-mkt-re-reggaemuffin-introducing-the-coding-challenge-20170818t072901425z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"app":"steemit/0.1"} |
created | 2017-08-18 07:29:00 |
last_update | 2017-08-18 07:30:00 |
depth | 4 |
children | 0 |
last_payout | 2017-08-25 07:29:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.050 HBD |
curator_payout_value | 0.016 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 267 |
author_reputation | 5,793,669,654,286 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,153,295 |
net_rshares | 19,163,037,586 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
mkt | 0 | 19,163,037,586 | 100% |