-
Functional Programming Patterns in Scala and Clojure
Functional languages have their own patterns that enable you to solve problems with less code than object-oriented programming alone. This book introduces you, the experienced Java programmer, to Scala and Clojure: practical, production-quality languages that run on the JVM and interoperate with existing Java. By using both the statically typed, type-inferred Scala and the dynamically typed, modern Lisp Clojure, you’ll gain a broad understanding of functional programming. For each pattern, you’ll first see the traditional object-oriented solution, and then dig into the functional replacements in both Scala and Clojure. These patterns are common in the functional world and deserve to become part of your problem-solving toolkit. On the object-oriented side, you’ll see many common patterns, such as Command, Strategy, and Null Object. On the functional side, you’ll learn core functional patterns such as Memoization, Lazy Sequence, and Tail Recursion. Each pattern helps you solve a common programming problem. Working through them gives you a set of patterns you can use to solve problems you come across while writing programs. Finally, you’ll learn how to work your existing Java code into new Scala or Clojure projects. You can start off small, adding functional code little by little, so you can complement your existing knowledge with Scala and Clojure as these languages gain popularity on the JVM. -
The Art of Readable Code
As programmers, we've all seen source code that's so ugly and buggy it makes our brain ache. And let's be honest, we've all written code like that. With this book, you'll learn to write code that's easy to read and understand. You'll have more fun and your coworkers will love you. The Art of Coding focuses on the nuts and bolts of programming, with simple and practical techniques you can use every time you sit down to write code. You'll find tips throughout the book, with easy-to-digest code examples, helpful illustrations, and cartoons for fun. * Learn to pick variable names that are "dense with information" * Organize your loops and conditionals so they're easy to understand * Make your comments short and sweet * Recognize when your code is doing too many things at once * Write tests that are concise, but thorough * Master the art of breaking hard problems into many smaller ones -
The Architecture of Open Source Applications
Architects look at thousands of buildings during their training, and study critiques of those buildings written by masters. In contrast, most software developers only ever get to know a handful of large programs well—usually programs they wrote themselves—and never study the great programs of history. As a result, they repeat one another's mistakes rather than building on one another's successes. This book's goal is to change that. In it, the authors of twenty-five open source applications explain how their software is structured, and why. What are each program's major components? How do they interact? And what did their builders learn during their development? In answering these questions, the contributors to this book provide unique insights into how they think. If you are a junior developer, and want to learn how your more experienced colleagues think, this book is the place to start. If you are an intermediate or senior developer, and want to see how your peers have solved hard design problems, this book can help you too. -
代码本色:用编程模拟自然系统
本书介绍了用计算机模拟自然系统涉及的编程策略与技术,涵盖了基本的数学和物理概念,以及可视化地展示模拟结果所需的高级算法。读者将从构建基本的物理引擎开始,一步一步地学习如何创建智能移动的物体和复杂的系统,为进一步探索生成设计奠定基础。相关的知识点包括力、三角、分形、细胞自动机、自组织和遗传算法。本书的示例使用基于Java的开源语言及开发环境Processing编写。本书网站http://www.natureofcode.com)上的示例是在浏览器中通过Processing的JavaScript模式运行的。 作为纽约大学Tisch艺术学院Nature of Code课程主讲老师,Daniel集合了多年开发和教学经验,希望借由此书让大家真正了解如何用代码模拟自然现象。 -
七周七语言
内容简介: 从计算机发展史早期的Cobol、Fortran到后来的C、Java,编程语言的家族不断壮大。除了这些广为人知的语言外,还涌现了Erlang、Ruby等后起之秀,它们虽被喻为小众语言,但因其独特性也吸引了为数不少的追随者。 Bruce A. Tate是软件行业的一名老兵,他有一个宏伟目标:用一本书的篇幅切中要害地探索七种不同的语言。本书就是他的成果。书中介绍了Ruby、Io、Prolog、Scala、Erlang、Clojure和Haskell这七种语言,关注每一门语言的精髓和特性,重点解决如下问题:这门语言的类型模型是什么,编程范式是什么,如何与其交互,有哪些决策构造和核心数据结构,有哪些独特的核心特性。 在这个飞速发展的信息时代,程序员仅仅掌握甚至精通一门语言是远远不够的。了解多门语言蕴涵的思维方式,在编码中互相借鉴,再挑出一两门对自己口味的语言深入学习,这些已经成为在软件行业中安身立命之本。从这个意义上说,每个程序员都应该看看这本《七周七语言》。 -
高质量程序设计艺术
在本书中,作者回归技术层面。从Apache web server、BSD版本的Unix system、ArgoUMl、ACE网络编程库等著名开源软件中选取了大量真实C、C++和java语言源代码,直观而深刻的阐述了代码中可能存在的各种质量问题,涉及可靠性、安全性、时间性和空间性、可移植性、可维护性以及浮点运算等方面,很多内容都市独辟蹊径,发前人所未发。正因如此,本书继作者的《代码阅读》之后在获JoIt生产效率大奖