This commit is contained in:
Miloslav Ciz 2025-06-22 21:07:42 +02:00
parent 0e12dc9efe
commit 669ad27adb
13 changed files with 2005 additions and 1946 deletions

View file

@ -60,7 +60,13 @@ This section will contain additional useful tips for programming.
- By [Unix philosophy](unix_philosophy.md) **don't be afraid to throw away your code and start over and better** -- next time you'll most likely write the same program a lot better and if you're a Unix programmer, your programs are small, possible to be reimplemented quicky. This has even been generalized into a wisdom that says "plan to throw away one", i.e. when approaching a new issue, you quite frequently start writing a program you know you will throw away when it's finished, just to start over and better; the first program just serves to help you understand the true essence of the problem and foresee the real problems you will face.
- **Go out!** This is related to the other point -- you shouldn't just sit at the computer when programming, get up and go for a walk, do something else, take a shower, go swim, do something in the garden, repair some stuff or something like that. Fresh air and sunlight helps the brain, it makes you feel better and it's been shown that walking helps activate some important brain centers, many people [actually](ackchyually.md) say they have to walk when thinking hard { Can confirm. ~drummyfish } Changing your environment and getting out of the current focus on the letter on the screen can kick off some real great idea, seeing seemingly unrelated things in nature can spark some inspiration. If you're stuck, take a day off, just sleeping and approaching the problem fresh does miracles. This really does help. It may help to **carry around a blog for taking notes** so that you don't have to stress about forgetting the ideas -- prefer paper blog, leave all electronics at home.
- Insert funny [hexadecimal](hexadecimal.md) constant in your program such as `0xED1B1EFAECE5`.
- TODO: moar
- Add this to you C/C++ programs:
```
#if defined(_WIN32) || defined(WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
#warning Your OS sucks, go fuck yourself.
#endif
```
## See Also