Skip to main content
9 of 9
Commonmark migration

Pro tip

Best answer to any general question. That is, candidates should be drawn from "Tips for golfing in X" questions (as opposed to specific "how do I shorten this piece of code" questions).

Some of the most useful content that we generate for other golfers is in our tips questions, so it would be nice to reward an exceptional golfing trick this way.

Candidates should be tips which show deep insight into the language, yet are applicable in wide range of situations. The exact amounts of bytes saved by the tip is not relevant.

Tips for Golfing in Brain-Flak by Heeby Jeeby Man

Nominated by Poke

Brain-Flak only has two stacks on which to perform operations. The third stack is always present but not always made use of. The concept and application of the third stack is widely used when golfing brain-flak code as it allows for implicit re-use of certain values so they do not need to be computed again later. This can easily be seen in the Hello World answer written in brain-flak

Shorter Header in Tips for golfing in C++ by user202729

Nominated by Mego

C++ has a lot of headers, and unlike C, you have to actually include them if you want to use library functions. This answer tells of a GCC precompiled header file that includes every standard library header, and whose name is fairly short. So, if you need to include multiple headers (like string and iostream), #include<bits/stdc++.h> will almost certainly be shorter. This header file isn't documented very well, so the tips answer is a huge help.

Compressing String Arrays in Tips for Golfing in Japt by Shaggy

Self-nomination

I'm not great at these types of self-promotional blurbs but I put a good bit of work into researching and writing this tip as well as writing tools to help people make use of it. Includes a bonus tip for compressing integer arrays!

totallyhuman
  • 17.3k
  • 1
  • 10
  • 19