DesignOfEverydayThings - What I learned as a developer


I only notes part of "Fundamental Principles of Interaction"
It's just a small unit of this book, but already help me A LOT.
Whenever I'm confused of designing, I re-read this book to get more ideas.

Because I'm a developer, so the most important thing it taught me is:
Why we need write clean code, how a clean code look like? How to know a design is good or bad.

  • Affordance and Signifier: That's why we need good naming.
    • Ex. visible signifier
StringUtils.trimToEmpty
StringUtils.substringBetween
    • Ex. Invisible
String dateString = PrivateDateUtils.toDateString( date ); // What is the format?

@SuperAnnotation // Things become invisible when there are many decision made at runtime, developer won't know.
public class NormalClass {}
  • Mapping and Conceptual Models: Developers always handling mapping and conceptual models
PersonDao.persist( person ); // Clear model, dev expect it will persist
Person.save(); // May be a little confuse
personService.find( id ); // When a find method persist data due to other reason such as queue full or statistics, it become confusing
  • Feedback: We need many feedback, no matter in code or in performance tunning or monitoring
personService.find( id ); // It's better to response quickly
personService.find( id, timeout, TimeUnit ); // It's better to provide timeout when things may become long

public void find(String id) {
    try {
        personDao.someErrorMayHappen(); 
    } catch (Exception ex) {
        // Eveything is find, treat as no data
    }
}
    • When there are too many error, we even unable to know the feedback is valid or not


沒有留言:

張貼留言

Lessons Learned While Using Claude Code Skills

Recently, I started experimenting with Claude Code Skills . I first saw this YouTube video: https://www.youtube.com/watch?v=CEvIs9y1uog ...