Sometimes when I'm working on an idea, I want to get that idea out of my head and into written code format, even if I never actually run it or test it.
I'll usually start with some pseudo-code written down on scratch paper, but when it comes to actual syntactically-correct code, I'll fire up an editor and type it out just to see what it looks like. I do this for data types or objects, or functions or methods, or interfaces, or what have you.
Then I end up with a scratch directory with files such as "scratch.go", "scratch1.go", "coord.go" and other random names.
I've even considered and maybe even experimented a bit with using source control to be able to keep ideas, even after I've moved on to better ideas.
One thing that does help is using an editor with syntax or lint checking, such as vim or vscode.
Does anyone else have a better process for this?
Top comments (5)
I usually create a git repository on my private server (I use Gitea). Depending on the project, I may either write down the idea/concept as a README or start coding a few lines immediately.
I generally create private gists to try out ideas. They're actually repositories, so I use them that way. See the thread of this tweet.
That is actually an awesome idea. Thanks for the tip!
For UML diagrams:
draw.io
Create an explicit API between frontend and backend (web dev):
github.com/lord/slate
I'm a hobbyist or small time developer. I don't want to reduce the value of using techniques such as UML diagrams, or flow charts, or whatever, but they just don't help me visualize the usage and relationships the same way that source code does, in whatever language that I'm using.
Is Slate kind of like godoc? While I don't want to evangelize for Google's Go language, many of the tools encourage good practices such as documenting interfaces and exported functions and values.
But this is still good advice, thanks!