Kraken Technologies: How we organise our large Python monolith
I quite like layered dependency structures.<p>I even have a lua codebase where I&#x27;ve linearized the sourcecode files into a particular order.  The layout looks like this:<p><pre><code>  01_foo&#x2F;  
    03_foo.lua  
    04_bar.lua  
    15_whatever.lua  
  02_bar&#x2F;  
    22_whatever.lua  
    56_something.lua  
</code></pre>
It has always bothered me in codebases that they don&#x27;t have a &quot;beginning&quot; and an &quot;end&quot;, and therefore it&#x27;s difficult for a reader to know where to start when they just want to read the codebase.<p>So, my approach is to impose this linear order and only allow code that comes later to depend on code that comes earlier, never the other way around.  This way, you can read through the code rather easily.  As you look at any piece of code, it will only depend on code you&#x27;ve already looked at, so you don&#x27;t have to be constantly jumping through the codebase as you&#x27;re reading.<p>I&#x27;ve also found that failure to correspond to a linearizable dependency structure is a &quot;code smell&quot;, and that, as I try to eradicate that code smell, I frequently end up with code that&#x27;s better in all kinds of ways.