Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,167 members, 7,815,065 topics. Date: Thursday, 02 May 2024 at 06:42 AM

Clean Coding - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Clean Coding (1622 Views)

What Are The Differences Between Programming And Coding / Java Coding Challenge: Task Scheduler (2) (3) (4)

(1) (Reply) (Go Down)

Clean Coding by SoftVersion(m): 4:44pm On Apr 13, 2012
What those it mean for a code to be called clean? Is it by strictly following the rules, commenting regularly, or neatness in the real sense like arrangements. This may sound stupid... But...
Re: Clean Coding by delomos(m): 6:29pm On Apr 13, 2012
Almost like Jazz Music, if you ask, you can't know, you only have to experience it.

Almost like how you can tell a master orator from a wunnabe talker.

Always a thing of beauty...

It's is elegant, no surprises, a little happiness here and there, it's poetic, actually, let me quote from the "Tao of Programming":

"
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity.

A program should follow the `Law of Least Astonishment'. What is this law? It is simply that the program should always respond to the user in the way that astonishes him least.

A program, no matter how complex, should act as a single unit. The program should be directed by the logic within rather than by outward appearances.

If the program fails in these requirements, it will be in a state of disorder and confusion. The only way to correct this is to rewrite the program.
" - (4.1)

Books that will get you closer to that Nirvana:
Code Complete 2: http://amzn.to/HDn8gM
The Pragmatic Programmer: From Journeyman to Master: http://amzn.to/HDneVw
Re: Clean Coding by SoftVersion(m): 6:59pm On Apr 13, 2012
10ks... Since I‘ve not gone too far in this programming stuffs, it‘s better I know now, remember that “it‘s easier to train a child than to correct an adult“.
Since dirty codes doesn‘t really mean wrong codes, meaning the program will still function well... most of us may not get it right, a lot programmers write dirty codes maybe due to the way they stared or taught or deadline pressure and maybe because there‘s no penalty for it. I don‘t really understand grammar easily in mathematics and programming class, if anyone will show me example of a dirty coding and example of the corresponding clean code. I‘ll appreciate it...
Re: Clean Coding by delomos(m): 5:47pm On Apr 14, 2012
In that light, the way to learn clean code is to read clean code, and a great place to start is: https://github.com/languages

There, you can select which language you're interested in and read how they attack problems and see what the conventions [idioms] are (as in language styles). Some language like Ruby and Python, folks in does language tale their idioms seriously, deviating from the idiom is considered dirty especially considering there are so many different ways you can write the same thing. (think of it as the English language, you can say "I'm coming, or I am coming", in academia, writing the later is strongly frowned on, you get the point).

But, again to see example of clean code, read clean codes and learn the patterns (and the great thing about Github is that you can ask the folks directly behind the code questions) and of course, see some clean codes here: https://github.com/languages or http://freecode.com/

( I would typically recommend Github more considering how snobby the guys on there are ... which makes them write even cleaner)
Re: Clean Coding by SoftVersion(m): 7:38am On Apr 15, 2012
@delomos thanks, I think that helps...
And I spent hours reading ur NL posts and googlin ur name and reading your blogs. I think I love your blogs and opinions about things generally... I‘ve been searching and I don‘t really know someone like u exist, I mean an African... I did my permutations, random selections, logical reasoning, tests etc... The end result is void, I mean empty set, no value to return. But here you are... I‘ll somehow like to whatchamacallit... Ummmm... Relate with you.

Or what do you think?
Re: Clean Coding by delomos(m): 4:12am On Apr 16, 2012
@SoftVersion:
I'm humbled brother, thanks.

As to relating to me, not very sure how you mean?
Re: Clean Coding by Daovris: 8:20am On Apr 16, 2012
10ks... Since I‘ve not gone too far in this programming stuffs, it‘s better I know now, remember that “it‘s easier to train a child than to correct an adult“. [img]http://www.keyforex.info/iPad.gif[/img]
Re: Clean Coding by SoftVersion(m): 10:59pm On Apr 16, 2012
@delomos, I will explain better in private mail to you. Can you please provide me your e-mail address or somewhere I can private message you. Thanks
Re: Clean Coding by delomos(m): 2:15pm On Apr 17, 2012
@SoftVersion: me {at{ delewrit.es {dot{ com
Re: Clean Coding by kodewrita(m): 8:44am On Apr 18, 2012
@delomos and @softversion, Me i like this una dating oh... heehehe. nice work. Thats what this forum's all about. Networking. Keep it up.

1 Like

Re: Clean Coding by delomos(m): 4:27pm On Apr 18, 2012
grin
Re: Clean Coding by SoftVersion(m): 12:12pm On Apr 19, 2012
@kodewriter lol...
@delomos message sent...
Re: Clean Coding by SoftVersion(m): 7:33pm On Apr 19, 2012
@delomos... Sth wrong wit dat email... delewrit.es.com?
Re: Clean Coding by delomos(m): 8:16pm On Apr 19, 2012
SoftVersion: @delomos... Sth wrong wit dat email... delewrit.es.com?
Not sure how you mean, I got the mail, will be replying shortly. thanks.
Re: Clean Coding by delomos(m): 1:17pm On Apr 20, 2012
@SoftVersion: please send that email to me (at) delewrit.es -- the one I got was from NL PM, not sure how to respond to it from within NL.

(1) (Reply)

2d Top Down Game Looking For Members / ♦route Redistributing: CCNA Network Engrs♦ / Which Forum Software Is Mobile Friendly To Start A Web Forum

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.