Skip to content

Instantly share code, notes, and snippets.

@andrewsg
Last active April 13, 2016 00:53
Show Gist options
  • Save andrewsg/7536050 to your computer and use it in GitHub Desktop.
Save andrewsg/7536050 to your computer and use it in GitHub Desktop.
ADA talk on programming languages (notes for second half of lecture)

Language taxonomy

Static analysis

  • Typed vs. untyped languages (just to introduce the concept of a type)
  • Static vs. dynamic type-checking
  • Implications for how objects are stored in memory (static type-checking implies objects are of a predictable size)
  • Duck typing
  • Implicit type conversions (JS) vs. strong typing (Ruby, Python)

Distance from "the metal"

  • Compiled languages (C and relatives)
  • Byte-code compiled languages (Java, C#)
  • Interpreted languages (Python, Ruby, PHP, Javascript)
  • Different implementations of the same language can be closer or further away from machine code
  • Some implementations include JIT compilers to try and get faster without sacrificing language features

Programming paradigm

  • Imperative languages (Ruby, Python, C)
  • Functional languages (Lisp)
  • Declarative languages (SQL)

Object-orientedness

  • The purpose of OOP
  • Essential features (polymorphism/encapsulation, descriptors... but no one thing is really essential)
  • Use of classes and misuse of classes (mention "Stop writing classes" talk)
  • Some older languages lack any support for OOP at all (C, PHP until recently)
  • Some languages enforce OOP as a structure across the board (Java)

Comparison of web dev languages

Introduction

  • PHP (fast startup speed, slow execution speed, very low memory requirements between requests; fast to get started with, but extremely painful after that; uses a CGI paradigm instead of a worker paradigm; thin wrapper over C)
  • Java (slow startup speed, moderately fast execution speed, high memory requirements; code bloat is a huge problem; enforces separation of concerns)
  • C# (very similar to Java, but slightly less prone to boilerplate code due to support for properties and some other more modern language features; tightly coupled with Microsoft stack)
  • Ruby (slow startup speed, slow-to-medium execution speed, moderate memory requirements; multithreading is inhibited by the GIL; very flexible; metaprogramming features enable extremely clean frameworks and interfaces; terse; code is a data structure)
  • Python (performance characteristics are essentially identical to Ruby, right down to the GIL; slightly less flexible than Ruby in ways that slightly increase execution speed; somewhat fewer metaprogramming features so frameworks tend to not be as nice; no DSLs so fewer language idiosyncrasies to learn; radically different philosophy; even more terse)

Philosophy

  • Java/C# philosophy (language should enable static analysis and execute quickly on a VM; code bloat is acceptable, can be managed by static analysis tools; enforce encapsulation)
  • Python philosophy (readability is the most important thing; syntax should be clean and easy to grasp; the language should do as much as possible to prevent common mistakes; explicit is better than implicit, especially when it comes to namespaces; formal documentation is essential; there should be one way to do it)
  • Ruby philosophy (radical freedom: language should enable advanced programming and it's okay if that results in complexity; no need to hold hands, there can be more than one way to do it)
  • PHP philosophy (amateur hour; don't attempt to smooth over flaws of C libraries wrapped by PHP; backwards compatibility is king except when it's not; flaws are alternately justified as being for the benefit of beginner programmers, or as not being important because experienced programmers should know better)

Culture

  • Java culture and organization (Amazon and offshoots, Expedia, Twitter 2011-present)
  • C# culture (Microsoft and offshoots)
  • PHP culture (Facebook, Wordpress)
  • Python culture (Google, Disqus, Instagram, NYT, WaPo, startups)
  • Ruby culture (Twitter pre-2011, Basecamp, Groupon, Github, startups)

Uses outside of web dev

  • PHP (basically none, and even inside web dev it's questionable)
  • Java (Android, antiquated web plug-ins, poorly performing desktop software)
  • C# (applications and esp. games that run on Microsoft platforms)
  • Objective-C (never used in web dev, but bring it up as the analogous language for the Apple ecosystem)
  • Python (server tools, science, math, misc.)
  • Ruby (also server tools and etc. but smaller community overall)

Zero-choice languages

  • Javascript (essential for browsers; can be translated from other languages, awkwardly; also can be used for backend stuff via node)
  • SQL (essential for databases; can be targeted by ORMs written in other languages)
@andrewsg
Copy link
Author

Add'l notes:

  • self-introduction
  • connection between communication and programming
  • three types of communication
  • computer brains are different from ours!
  • machine language and simplest possible machine
  • flow control
  • "if" statement and jumping
  • assembler
  • Grace Hopper believed programming should be done in something as close to English as possible
  • The "A" (v. A-0) compiler in 1952 (not related to "C" language)
  • MATH-MATIC and FLOW-MATIC compiler-based languages released in 1954
  • COBOL in '59, still used today
  • The advantages of more complex languages (DRY, concision, higher-level concepts, etc. -- liken to a zoom level on a map, or giving driving instructions by telling someone how to operate the steering wheel)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment