308 karma · joined February 3, 2012
Blog: https://barim.us Mastodon: @CodeCadim
package color
type Color interface {
void()
}
type color struct {
v string
}
func (c color) void() {}
func (c color) String() string {
return c.v
}
var (
Red color = color{"red"}
Green color = color{"green"}
Blue color = color{"blue"}
)If a web frontend is needed, I'll take svelte (not svelte kit) to code independente components that talk to the backend. I'll code there only interface logic (no control, no calculation, etc...)
If you can, get up earlier every morning, before everybody wake up in the house. You must be very motivated if you are not a morning guy.
Other solution is to have a fixed schedule, like having a meeting with yourself, with a "not disturb" agreement with your family (very difficult with young kids)
I am not a tab hoarder, I almost never have more than **15** of them open at the same time.Where can I read more about those affirmations ?
There is no contradiction between monolith and DOTADIW. The code unit is the function, so each function does one thing and does it well.
I don't get why microservices is the opposite of large code base : having the code splitted in different files or in different repo, changes nothing about the sum of all lines of code, no ?
Half done is what I'll think when coding is finished.
if err := DoFoo(); err != nil { ...
The 'err' variable will be local to the 'if' so you can write also : if err := DoBar(); err != nil { ...
It is also nice to write it in one line :-)Drop the "but" and you'll engage even more with your mentee.
It's like saying that considering performance is a natural thing to do after writing a correct code, instead of the opposition that the word 'but' introduces.
Dropping the 'but' is a powerful skill !
Instead of :
If foo then
bar
Else
baz
Endif
Now I write: If foo then
bar
return
Endif
baz
Exit early makes the code easier to read and understandGlad to see yet another tools in this overcrowded field. It confirms my choice to never use one and stick to a text editor like neovim : key M-J to open a daily file, type in what ever I want and abuse using search and grep via telescope to navigate.
Flat files are easy to sync and mine follow me since 2013.
I'm sure people would say this cognitive burden is not useful and freeing your mind from it will let you get more valuable knowledge. But tinkering with your computer is an underestimate skill.
Constraints (car env) drive creativity !