Aktuelle Änderungen Printable View Änderungen Bearbeiten
DatalessProgramming > ProgrammierSprachen > AbstractSyntaxTrees > ProgrammingLanguage > ProgrammierSprachen > PythonBytecodeHacks > SoftwareArchitecture > PragmaticProgrammers > IntermediateLanguage > VersionControlSystem > VersionControl > JohannesSiedersleben > PythonSuccessStories > TailCallOptimization > Recursion > BehaviorDrivenDesign > SmartDataAndDumbCodeClear TrailHe 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.
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.
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.data is facts. Code is actions that operate on facts.
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.