create account

RE: Introducing the Coding Challenge by mkt

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @reggaemuffin/re-mkt-re-reggaemuffin-introducing-the-coding-challenge-20170817t171542809z

· @mkt · (edited)
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!
properties (22)
authormkt
permlinkre-reggaemuffin-re-mkt-re-reggaemuffin-introducing-the-coding-challenge-20170817t203611617z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"users":["benniebanana"],"app":"steemit/0.1"}
created2017-08-17 20:36:00
last_update2017-08-17 20:40:42
depth3
children1
last_payout2017-08-24 20:36:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length968
author_reputation45,513,283,519,678
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,118,156
net_rshares0
@ratticus · (edited)
$0.07
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.
👍  
properties (23)
authorratticus
permlinkre-mkt-re-reggaemuffin-re-mkt-re-reggaemuffin-introducing-the-coding-challenge-20170818t072901425z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-18 07:29:00
last_update2017-08-18 07:30:00
depth4
children0
last_payout2017-08-25 07:29:00
cashout_time1969-12-31 23:59:59
total_payout_value0.050 HBD
curator_payout_value0.016 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length267
author_reputation5,793,669,654,286
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,153,295
net_rshares19,163,037,586
author_curate_reward""
vote details (1)