Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: Late night Bookmarks  (Read 2023 times)

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Late night Bookmarks
« on: December 24, 2009, 07:16:16 AM »

Quote

For years authors and consultants (like me) have been telling us that functions should do one thing. They should do it well. They should do it only.

The question is: What the hell does “one thing” mean?

http://blog.objectmentor.com/articles/2009/09/11/one-thing-extract-till-you-drop

Quote

Robert C. Martin investigates an interesting dilemma: if the implementation of two functions is identical, yet their intent is completely different, is it still duplicate code?

http://www.informit.com/articles/article.aspx?p=1313447

Quote

We join "The Craftsman," Robert C. Martin's series on an interstellar spacecraft where programmers hone their coding skills. In this tenth tip in the series, the crew learns that functions should have a small number of arguments.

http://www.informit.com/articles/article.aspx?p=1375308


Quote

We join "The Craftsman," Robert C. Martin's series on an interstellar spacecraft where programmers hone their coding skills. In this twelfth tip in the series, the crew learns that Boolean arguments loudly declare that the function does more than one thing. They are confusing and should be eliminated.

http://www.informit.com/articles/article.aspx?p=1392524

Quote

Old maps were marked with the phrase "Here be Dragons" to help seafarers steer away from dangerous places; in programming the best way to avoid dealing with bad code is to avoid writing it. Diomidis Spinellis points out 10 giveaways to spot bad code that you (or others) may have written.

http://www.informit.com/articles/printerfriendly.aspx?p=457502
Logged

nukpana

  • Hero Member
  • *****
  • Karma: 71
  • Posts: 663
Re: Late night Bookmarks
« Reply #1 on: December 28, 2009, 01:46:22 AM »

More late night bookmarks:

Quote
In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem.

.....

Common code smells


    * Duplicate code: identical or very similar code exists in more than one location.
    * Large method: a method, function, or procedure that has grown too large.
    * Large class: a class that has grown too large, see God object.
    * Feature envy: a class that uses methods of another class excessively.
    * Inappropriate intimacy: a class that has dependencies on implementation details of another class.
    * Refused bequest: a class that overrides a method of a base class in such a way that the contract of the base class is not honored by derived class. See Liskov substitution principle.
    * Lazy class: a class that does too little.
    * Duplicated method: a method, function, or procedure that is very similar to another.
    * Contrived Complexity: forced usage of overly complicated design patterns where simpler design would suffice.

[edit]
http://en.wikipedia.org/wiki/Code_smell
http://stackoverflow.com/questions/114342/what-are-code-smells-what-is-the-best-way-to-correct-them

Quote
This is an experimental post on the psychology of programming. As of lately I have become very interested in the thought processes that cause us to write certain code. Because I believe understanding the patterns in your own thinking will by far make the biggest impact on how good you will get as a programmer. Forget design patterns, forget unit testing, forget all those functions you know. Important is to question why they exist and how they could be improved. I'm not saying you cannot be a good programmer if you do not care about this. But I am saying you will most likely never exceed the skills of all the other programmers out there. You will more or less write the same code everybody else does.
http://debuggable.com/posts/programming-psychology-return-home-early:4811de9f-ae28-49c2-a7dc-2f154834cda3
Logged