DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

DatalessProgramming > ProgrammierSprachen > AbstractSyntaxTrees > ProgrammingLanguage > ProgrammierSprachen > PythonBytecodeHacks > SoftwareArchitecture > PragmaticProgrammers > IntermediateLanguage > VersionControlSystem > VersionControl > JohannesSiedersleben > PythonSuccessStories > TailCallOptimization > Recursion > BehaviorDrivenDesign > SmartDataAndDumbCodeClear Trail
Main /

Smart Data And Dumb Code

DataIsCode
CodeIsData

Lisp

DataDrivenProgramming


Smart data structures and dumb code works a lot better than the other way around.

He treated the code as central and the data structures as support for the code. As a result, the code was beautiful but the data structure design ad-hoc and rather ugly (at least by the high standards of this old LISP hacker).

This and the previous changes illustrate a general principle that's good for programmers to keep in mind, especially in languages like C that don't naturally do dynamic typing:

Smart data structures and dumb code works a lot better than the other way around.


> There is really not a lot you can do to improve [position evaluation]
> short of starting over from scratch and creating your data structures
> in such a way as to exploit lots of low level tricks.

Sounds like you're already focusing in the right area. Make smart data, so that the code can be dumb. The advantage is that you can write dumb code in most any language -- so you can choose Python if you want to prototype your smart data structures.


Minimize Code, Maximize Data

Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.

data is facts. Code is actions that operate on facts.

This point is simply that the better class of programs are those that begin with a distinction between fact and action, and seek first to organize the facts and only then to plan the actions.

And Again: Understand the facts first. From there design your data structures. After that the algorithms write themselves.


Getting the data model correct, in my experience as well, is both hard but worthwhile as the code ends up being simpler.



data is just dumb code and code is just smart data.

Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 19.04.2011 22:03 Uhr und seit 7. April 2005 6153 aufgerufen.