elegance   422

« earlier    

The Law of Leaky Abstractions – Joel on Software
[TCP/IP example]

All non-trivial abstractions, to some degree, are leaky.

...

- Something as simple as iterating over a large two-dimensional array can have radically different performance if you do it horizontally rather than vertically, depending on the “grain of the wood” — one direction may result in vastly more page faults than the other direction, and page faults are slow. Even assembly programmers are supposed to be allowed to pretend that they have a big flat address space, but virtual memory means it’s really just an abstraction, which leaks when there’s a page fault and certain memory fetches take way more nanoseconds than other memory fetches.

- The SQL language is meant to abstract away the procedural steps that are needed to query a database, instead allowing you to define merely what you want and let the database figure out the procedural steps to query it. But in some cases, certain SQL queries are thousands of times slower than other logically equivalent queries. A famous example of this is that some SQL servers are dramatically faster if you specify “where a=b and b=c and a=c” than if you only specify “where a=b and b=c” even though the result set is the same. You’re not supposed to have to care about the procedure, only the specification. But sometimes the abstraction leaks and causes horrible performance and you have to break out the query plan analyzer and study what it did wrong, and figure out how to make your query run faster.

...

- C++ string classes are supposed to let you pretend that strings are first-class data. They try to abstract away the fact that strings are hard and let you act as if they were as easy as integers. Almost all C++ string classes overload the + operator so you can write s + “bar” to concatenate. But you know what? No matter how hard they try, there is no C++ string class on Earth that will let you type “foo” + “bar”, because string literals in C++ are always char*’s, never strings. The abstraction has sprung a leak that the language doesn’t let you plug. (Amusingly, the history of the evolution of C++ over time can be described as a history of trying to plug the leaks in the string abstraction. Why they couldn’t just add a native string class to the language itself eludes me at the moment.)

- And you can’t drive as fast when it’s raining, even though your car has windshield wipers and headlights and a roof and a heater, all of which protect you from caring about the fact that it’s raining (they abstract away the weather), but lo, you have to worry about hydroplaning (or aquaplaning in England) and sometimes the rain is so strong you can’t see very far ahead so you go slower in the rain, because the weather can never be completely abstracted away, because of the law of leaky abstractions.

One reason the law of leaky abstractions is problematic is that it means that abstractions do not really simplify our lives as much as they were meant to. When I’m training someone to be a C++ programmer, it would be nice if I never had to teach them about char*’s and pointer arithmetic. It would be nice if I could go straight to STL strings. But one day they’ll write the code “foo” + “bar”, and truly bizarre things will happen, and then I’ll have to stop and teach them all about char*’s anyway.

...

The law of leaky abstractions means that whenever somebody comes up with a wizzy new code-generation tool that is supposed to make us all ever-so-efficient, you hear a lot of people saying “learn how to do it manually first, then use the wizzy tool to save time.” Code generation tools which pretend to abstract out something, like all abstractions, leak, and the only way to deal with the leaks competently is to learn about how the abstractions work and what they are abstracting. So the abstractions save us time working, but they don’t save us time learning.
techtariat  org:com  working-stiff  essay  programming  cs  software  abstraction  worrydream  thinking  intricacy  degrees-of-freedom  networking  protocol  examples  traces  no-go  volo-avolo  tradeoffs  c(pp)  pls  strings  dbs  transportation  driving  analogy  aphorism  learning  paradox  systems  elegance  nitty-gritty  concrete  cracker-prog  metal-to-virtual 
6 weeks ago by nhaliday
C++ Core Guidelines
This document is a set of guidelines for using C++ well. The aim of this document is to help people to use modern C++ effectively. By “modern C++” we mean effective use of the ISO C++ standard (currently C++17, but almost all of our recommendations also apply to C++14 and C++11). In other words, what would you like your code to look like in 5 years’ time, given that you can start now? In 10 years’ time?

https://isocpp.github.io/CppCoreGuidelines/
“Within C++ is a smaller, simpler, safer language struggling to get out.” – Bjarne Stroustrup

...

The guidelines are focused on relatively higher-level issues, such as interfaces, resource management, memory management, and concurrency. Such rules affect application architecture and library design. Following the rules will lead to code that is statically type safe, has no resource leaks, and catches many more programming logic errors than is common in code today. And it will run fast - you can afford to do things right.

We are less concerned with low-level issues, such as naming conventions and indentation style. However, no topic that can help a programmer is out of bounds.

Our initial set of rules emphasize safety (of various forms) and simplicity. They may very well be too strict. We expect to have to introduce more exceptions to better accommodate real-world needs. We also need more rules.

...

The rules are designed to be supported by an analysis tool. Violations of rules will be flagged with references (or links) to the relevant rule. We do not expect you to memorize all the rules before trying to write code.

contrary:
https://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/
This will be a long wall of text, and kinda random! My main points are:
1. C++ compile times are important,
2. Non-optimized build performance is important,
3. Cognitive load is important. I don’t expand much on this here, but if a programming language or a library makes me feel stupid, then I’m less likely to use it or like it. C++ does that a lot :)
programming  engineering  pls  best-practices  systems  c(pp)  guide  metabuch  objektbuch  reference  cheatsheet  elegance  frontier  libraries  intricacy  advanced  advice  recommendations  big-picture  novelty  lens  philosophy  state  error  types  concurrency  memory-management  performance  abstraction  plt  compilers  expert-experience  multi  checking  devtools  flux-stasis  safety  system-design  techtariat  time  measure  dotnet  comparison  examples  build-packaging  thinking  worse-is-better/the-right-thing  cost-benefit  tradeoffs  essay  commentary  oop  correctness  computer-memory  error-handling  resources-effects 
8 weeks ago by nhaliday
What's the expected level of paper for top conferences in Computer Science - Academia Stack Exchange
Top. The top level.

My experience on program committees for STOC, FOCS, ITCS, SODA, SOCG, etc., is that there are FAR more submissions of publishable quality than can be accepted into the conference. By "publishable quality" I mean a well-written presentation of a novel, interesting, and non-trivial result within the scope of the conference.

...

There are several questions that come up over and over in the FOCS/STOC review cycle:

- How surprising / novel / elegant / interesting is the result?
- How surprising / novel / elegant / interesting / general are the techniques?
- How technically difficult is the result? Ironically, FOCS and STOC committees have a reputation for ignoring the distinction between trivial (easy to derive from scratch) and nondeterministically trivial (easy to understand after the fact).
- What is the expected impact of this result? Is this paper going to change the way people do theoretical computer science over the next five years?
- Is the result of general interest to the theoretical computer science community? Or is it only of interest to a narrow subcommunity? In particular, if the topic is outside the STOC/FOCS mainstream—say, for example, computational topology—does the paper do a good job of explaining and motivating the results to a typical STOC/FOCS audience?
nibble  q-n-a  overflow  academia  tcs  cs  meta:research  publishing  scholar  lens  properties  cost-benefit  analysis  impetus  increase-decrease  soft-question  motivation  proofs  search  complexity  analogy  problem-solving  elegance  synthesis  hi-order-bits  novelty  discovery 
9 weeks ago by nhaliday
Chậu kim ngân dát vàng – Quà tân gia độc đáo – 24kgoldart
Chậu kim ngân dát vàng – Quà tân gia độc đáo https://ift.tt/2JpChJf

This is the image description

via 500px https://ift.tt/2MgtYxd

https://ift.tt/2LFXAmq Uncategorized, 500px, abstract, blank, circle, design, elegance, IFTTT, pattern, rectangle, ribbon, shape, shiny, spiral, symmetry June 10, 2018 at 03:13PM
IFTTT  WordPress  Uncategorized  500px  abstract  blank  circle  design  elegance  pattern  rectangle  ribbon  shape  shiny  spiral  symmetry 
june 2018 by 24kgoldart
Chậu kim ngân dát vàng – Quà tân gia độc đáo – 24kgoldart
Chậu kim ngân dát vàng – Quà tân gia độc đáo https://ift.tt/2sXKXva

This is the image description

via 500px https://ift.tt/2MgtYxd

https://ift.tt/2LFXAmq Uncategorized, 500px, abstract, blank, circle, design, elegance, IFTTT, pattern, rectangle, ribbon, shape, shiny, spiral, symmetry June 10, 2018 at 02:58PM
IFTTT  WordPress  Uncategorized  500px  abstract  blank  circle  design  elegance  pattern  rectangle  ribbon  shape  shiny  spiral  symmetry 
june 2018 by 24kgoldart

« earlier    

related tags

-  0257-4106_rc-3592_easy  2016  24-in  500px  aaronson  abstract  abstraction  academia  accretion  accuracy  adaptability  advanced  advice  aesthetics  algebra  algebraic-complexity  algorithms  analogy  analysis  android  anglosphere  aphorism  apple  applicability-prereqs  applications  aristos  armstrong  art  at  axioms  barre_de_favoris  bcwine  beauty  best-practices  bestpractice  big-list  big-peeps  big-picture  big-surf  binomial  blank  blog  blowhards  bonferroni  books  bret-victor  brilliant  britain  brochure  build-packaging  c(pp)  calculation  canon  carmack  cartoons  ceiling  ceilings  cheatsheet  checking  chemistry  circle  circuits  civilization  classic  coarse-fine  code-organizing  coding  coffer  coffered  commentary  communication  community  comparison  compilers  complex-systems  complexity  compressed-sensing  compression  computation  computer-memory  concentration-of-measure  concept  concrete  concurrency  confluence  confusion  cool  correctness  cost-benefit  coupling-cohesion  cracker-prog  creative  critique  crux  cs  culture  data-science  datasheet  dbs  definition  degrees-of-freedom  design  devices  devtools  dimensionality  direct-indirect  direction  discovery  discussion  dotnet  draft  driving  dynamic  early-modern  easy  economics  ecosystem  education  efficiency  einstein  electromag  elegant  elgato  embodied  empirical  empty  encyclopedic  engineering  english  enlightenment-renaissance-restoration-reformation  error-handling  error  essay  estimate  europe  eve  evolution  examples  exocortex  expert-experience  exposition  facebook  fedja  feminism  feynman  fit  fluid  flux-stasis  foodgasm  foodporn  formal-values  fourier  frontier  functional  gbooks  genius  geometry  giants  gnon  gowers  gravity  grokkability  ground-up  growth-econ  guessing  guide  gupta  guy  hardness  haskell  hci  heavyweights  hi-order-bits  high-dimension  history  hn  home  homogeneity  hsu  ideas  identity  ieee  ifttt  impetus  importés  impossibility  impossible  incentives  increase-decrease  info-dynamics  inner-product  insight  installation-instructions-15-16-and-9-16-grid  instinct  instruction  integral  interdisciplinary  interface  interview  intricacy  intuition  jvm  kapil  knowledge  learning  lecture-notes  lens  let-me-see  levers  libraries  limits  liner-notes  links  lisp  list  literature  lower-bounds  lowes  magnitude  map-territory  math.ca  math.fa  math.mg  math.rt  math  mathematics  mathtariat  measure  mechanics  memory-management  meta:math  meta:research  meta:science  metabuch  metal-to-virtual  metameta  methodology  minimum-viable  models  modernity  moist  monotonicity  mostly-modern  motivation  multi  networking  neurons  nibble  nitty-gritty  no-go  norms  notation  novelty  objektbuch  ocaml-sml  occam  occident  okanagan  oly  oop  operational  org:bleg  org:com  org:edu  org:mat  orourke  overflow  p:**  p:someday  p:whenever  panels  paradox  parsimony  pattern  people  performance  philosophy  physics  pic  pigeonhole-markov  pls  plt  popsci  positivity  possibility  possible  presentation  princeton  probabilistic-method  probability  problem-solving  programming  project  proofs  properties  protocol  publishing  python  q-n-a  quantifiers-sums  quantum-info  quantum  quixotic  quotes  r  random  rant  ratty  reading  reason  recommendations  rectangle  reddit  reference  reflection  relativity  research  resilience  resources-effects  review:  rhetoric  ribbon  right-wing  rigor  roots  s:**  s:*  s:null  safety  sane-people  sanjeev-arora  sauvignonblanc  scala  scholar  science  scitariat  search  sexy  shape  shiny  siddha  signum  simple  simplicity  simplification  single  skeleton  slides  smart  social  soft-question  software  space  span-cover  sparsity  spatial  spiral  stackex  stat-mech  state  static-dynamic  stats  stories  strings  structure  subculture  sum-of-squares  summary  survey  symmetry  synthesis  syrah  system-design  systems  tcs  tcstariat  teaching  tech  technical-writing  techtariat  tensors  text  the-great-west-whale  the-trenches  theory-practice  thermo  thinking  thurston  tidbits  tightness  tile  tiles  timcarmody  time  timing  tip-of-tongue  tips  top-n  topology  traces  tradeoffs  transportation  tricki  tricks  truth  twitter  types  ui  unaffiliated  uncategorized  unit  unread  ux  video  virtu  visual-understanding  visualization  volo-avolo  von-neumann  wditot  white  wigderson  wiki  wire-guided  wisdom  wordpress  working-stiff  wormholes  worrydream  worse-is-better/the-right-thing  writing  x  yoga  zooming  👳  🔬  🖥 

Copy this bookmark:



description:


tags: