Init folders:
mkdir project_name
cd project_name
pipenv --shell
pipenv install django djangorestframework django_rest_knoxSince it has come up a few times, I thought I’d write up some of the basic ideas around domain modeling in Clojure, and how they relate to keyword names and Specs. Firmly grasping these concepts will help us all write code that is simpler, cleaner, and easier to understand.
Clojure is a data-oriented language: we’re all familiar with maps, vectors, sets, keywords, etc. However, while data is good, not all data is equally good. It’s still possible to write “bad” data in Clojure.
“Good” data is well defined and easy to read; there is never any ambiguity about what a given data structure represents. Messy data has inconsistent structure, and overloaded keys that can mean different things in different contexts. Good data represents domain entities and a logical model; bad data represents whatever was convenient for the programmer at a given moment. Good data stands on its own, and can be reasoned about without any other knowledge of the codebase; bad data is deeply and tightly coupled to specific generating and
| <# : | |
| @echo off & setlocal & set __args=%* & pwsh.exe -NoProfile -Command Invoke-Expression ('. { ' + (Get-Content -LiteralPath ""%~f0"" -Raw) + ' }' + $env:__args) & exit /b %ERRORLEVEL% | |
| #> Add-Type @' | |
| // ========== BEGIN C# CODE ========== | |
| using System; | |
| using System.Runtime.InteropServices; | |
| public class Program | |
| { | |
| public static void Main(string[] args) |
So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.
Database in a browser, a spec (Stepan Parunashvili)
What problem are we trying to solve with a sync system?
The web of tomorrow (Nikita Prokopov)
I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.
In this file:
PascalCase names. They will appear to C# as static methods.