📝
knowledge
  • links
  • 14-Pure-Education
    • My Knowledge Wiki 🌿
      • .github
        • ISSUE_TEMPLATE
          • Question 🤔
          • bug_report
          • Feature ✨
        • Summary
      • design
        • Animation
        • Fonts
        • Framer
        • Color
        • figma
          • Figma
          • Figma plugins
        • Inkscape
        • Blender
        • Design
        • Interior Design
        • Icons
        • Design inspiration
        • 3D modeling
        • Design systems
        • Industrial Design
        • User Experience
        • Logos
      • databases
        • Neo4j
        • Fauna
        • sql
          • SQL
        • blockchain
          • Cardano
          • Arweave
          • Tezos
          • Polkadot
          • Uniswap
          • Ethereum
          • Blockchain
        • Kdb+
        • Cassandra DB
        • PostgreSQL
        • FoundationDB
        • SQLite
        • Prometheus
        • Dgraph
        • Redis
        • DynamoDB
        • Databases
        • Memcached
        • MariaDB
        • Prisma
        • MongoDB
      • augmented-reality
        • Augmented Reality
        • ARKit
      • art
        • Art
        • Pen plotting
        • Drawing
        • Photography
        • Generative art
        • Sketching
        • Comics
        • Anime
        • Furniture
        • Dancing
        • Architecture
        • Clothes
        • Tattoos
      • computer-graphics
        • computer-vision
          • Optical character recognition
          • Computer vision
        • Procedural generation
        • Metal
        • SVG
        • WebGPU
        • [Ray tracing](https://en.wikipedia.org/wiki/Ray_tracing_(graphics))
        • Computer graphics
        • WebGL
        • CUDA
        • OpenGL
        • Vulkan API
        • Bézier curves
        • Shaders
        • Image processing
        • [Rendering](https://en.wikipedia.org/wiki/Rendering_(computer_graphics))
      • computer-science
        • Parsing
        • algorithms
          • Algorithms
          • Compression
        • Computer Science
        • Computer architecture
        • formal-verification
          • Formal verification
          • TLA+
        • Automata theory
        • data-structures
          • Data structures
      • business
        • startups
          • Marketplaces
          • Funding
          • Values
          • Onboarding
          • Venture capital
          • Startups
          • Payroll
        • Products
        • Business
        • Restaurants
        • Landing pages
        • Pricing
      • compilers
        • LLVM
        • Linters
        • build-systems
          • Build systems
          • Bazel
        • Compilers
      • books
        • Mind for numbers - Review
        • Thinking, fast and slow
        • Brave new world
        • Elements of programming interviews
        • Rich dad poor dad
        • Programming in Haskell
        • Code: hidden language of software
        • Surely you are joking Mr Feynman
        • Books
        • Mindstorms
        • Eloquent ruby
        • go-in-action
        • Crafting interpreters
        • Cracking the coding interview
        • Artificial Intelligence: A Modern Approach
      • devops
        • Observability
        • DevOps
        • Site Reliability Engineering
        • Terraform
      • cryptocurrencies
        • Nano
        • Cryptocurrencies
        • Bitcoin
        • Stellar
        • Libra
        • TON
      • backups
        • Backups
      • 3d-printing
        • 3D Printing
      • distributed-systems
        • message-queue
          • Message queue
          • ZeroMQ
          • MQTT
        • [Load balancing](https://en.wikipedia.org/wiki/Load_balancing_(computing))
        • rpcs
          • gRPC
          • Remote Procedure Calls
        • Distributed systems
        • Conflict-free replicated data type
      • cli
        • Command Line Tools
        • Tmux
        • Ngrok
        • Sed
      • automation
        • Home automation
        • Automation
      • biology
        • Computational biology
        • Biology
        • Evolution
        • genomics
          • DNA
          • Genomics
        • immunology
          • Immunotherapy
          • Immunology
        • Bionics
        • bioinformatics
          • Bioinformatics
        • Viruses
      • cloud-computing
        • serverless-computing
          • AWS Lambda
          • Serverless computing
          • Cloudflare workers
        • Cloud computing
        • gcp
          • Google Cloud
        • aws
          • AWS Amplify
          • AWS
        • azure
          • Azure
      • articles
        • Articles
      • anki
        • Anki
      • data-science
        • Data Science
        • Data Visualization
        • Data processing
        • Apache Kafka
      • consciousness
        • Consciousness
        • Ego
      • documentaries
        • Documentaries
      • Summary
      • api
        • API
      • animals
        • Birds
        • Animals
      • courses
        • Courses
      • analytics
        • Analytics
      • chemistry
        • Chemistry
Powered by GitBook
On this page
  • Chapter 1 - write code that looks like ruby
  • Links

Was this helpful?

  1. 14-Pure-Education
  2. My Knowledge Wiki 🌿
  3. books

Eloquent ruby

PreviousMindstormsNextgo-in-action

Last updated 4 years ago

Was this helpful?

Chapter 1 - write code that looks like ruby

  • Code should be crystal clear - good code tells the reader exactly what it is trying to do. Great code shouts its intent.

  • Since there is a limit to how much information you can keep in your head at any given moment, good code is not just clear, it is also concise. It’s much easier to understand what a method or a class is doing if you can take it all in at a glance.

  • If it’s obvious how someone would use your method—if the class or program needs no explanation—then don’t explain it.

  • The danger in comments that explain how the code works is that they can easily slide off into the worst reason for adding comments: to make a badly written program somewhat comprehensible.

    • Is there anything you can do to let the code speak for itself instead of needing subtitles?

    • Remember, good code is like a good joke: It needs no explanation.

Links

Source code for the book