25 May 2019

Writing code

History / Edit / PDF / EPUB / BIB / 1 min read (~59 words)
Software development Processes
  • Make sure you understand what you have to implement
  • Make it work
  • Write a test for what you implemented
  • Refactor the code for reusability/code standard
  • Verify that your code passes linting and tests
  • Commit your code on a branch
  • Push to the central repository
  • Verify that CI passes
  • Create pull request
  • Annotate code to explain intent of changes
25 May 2019

Web applications

History / Edit / PDF / EPUB / BIB / 1 min read (~61 words)
Software development Processes

  • 3 different environments: development, staging, production
  • Write migrations for schema changes
  • Use ORM if possible over raw queries
  • Always make it possible for testers to report the version they tested against
    • Simplest is to have a meta field in the head section

  • Mockups
  • SRS
  • Database and software architecture
  • Implementation
  • Test/QA
  • Deployment

25 May 2019

Writing commits

History / Edit / PDF / EPUB / BIB / 1 min read (~85 words)
Software development Processes
  • One liner describing what changed (not period terminated)
  • A few lines describing in more details why things changed
  • GPG signed commit

  • Separate subject from body with a blank line
  • Limit the subject line to 50 characters
  • Capitalize the subject line
  • Do not end the subject line with a period
  • Use the imperative mood in the subject line
  • Wrap the body at 72 characters
  • Use the body to explain what and why vs. how

25 May 2019

Writing tests

History / Edit / PDF / EPUB / BIB / 1 min read (~84 words)
Software development Processes

When joining a new project without tests, here is the value you need to provide through the addition of tests:

  1. the application works and doesn't crash
  2. the application works and supports a few input cases
  3. the application works and supports a variety of input cases
  4. the application works and is robust to most input cases
  • Write a test that tests the common case usage of your function
  • Write tests that cover edge cases of your function
  • Write tests to cover all statements, branches, paths
29 Dec 2018

Factorio

History / Edit / PDF / EPUB / BIB / 1 min read (~136 words)
games

An initial seed is computed and stored in the game save file
Based on this seed, the world is pseudo randomly computed, using a certain chunk/block/tile size (e.g., 32x32, 128x128)
The world map is only generated on-demand, that is, as far as the player can see
When a new chunk is discovered, its blocks are computed and persisted in the save file
If there are no active components in a chunk that is not visible, the game will obviously not render it, it will only simulate it (position, item, velocity, etc)
Certain thing, for instance alien types and alien base size, may only be computed once they are observed. At first, maybe only a location anchor will exist to indicate where they should spawn, but the rest will be generated only when needed.