gitmoji icon indicating copy to clipboard operation
gitmoji copied to clipboard

Hardcoded values or checks

Open marcselman opened this issue 2 years ago • 4 comments

Hello @carloscuesta :sunglasses:!

  • Emoji: 🧬
  • Code: :dna:
  • Description: Add or update hardcoded values or checks

Describe the use case of your emoji

Sometimes, when quickly developing something, we might temporarily use some hardcoded data before refactoring it, it a later time, to use database values or a configuration file. Using a special emoji for this makes it easy to find when the hardcoded data was introduced in the code.

Is this use case covered by an existing emoji?

The 🤡 emoji is for mocking things. But a hardcoded customer id (for example) is not mock data imho. The 💩 emoji is for bad code. Hardcoded values might be bad code but not always and I think it's better to identify it separately.

Does this emoji fall into the "how" category?

Yes

Examples

🧬 Added my hardcoded user id to test/develop new profile page 🧬 Added hardcoded ip address check to show different header color at the office

marcselman avatar Mar 28 '22 12:03 marcselman

So we are striving to now add "how" emojis, only "what" emojis, That said, your suggestions seems to me to be a "what" emoji.

I usually cover hardcoded values with :speech_balloon: image

Why would the :speech_balloon: not suited for this case?

vhoyer avatar May 04 '22 20:05 vhoyer

I use the 💬 for string literals like ui button and input labels and translation texts etc. But for testing or debugging having some (temporary) hardcoded value can be handy and a separate emoji would make identifying the commit easy.

I don't really understand how you determine whether an emoji is a how or a what emoji. You could define it either way. what: a hardcoded value i.e. 🧬 Added my user id to test/develop new profile page how: by hardcoding it i.e. 🧬 Gave office location access to admin environment

marcselman avatar Jun 30 '22 08:06 marcselman

I just said that first line specifically because you were the one saying that the emoji was falling under "how" category, so I didn't spend too much time analyzing this aspect.

Thinking about it now, personally, I'd put it in the "what" category, like you said "what? a hardcoded value"

that said.

If I'm adding a commit so that I can test something, I'd use either :alembic:, or :construction:, or :clown_face:, or even :sound: (depending on the case, as like "I'm trying iprove observability", but this is kinda far fetched, and there is another issue open for observability #725).

If we are talking about the examples you gave, I'd use the :technologist:, what do you think? I'm not confident in this addition.

vhoyer avatar Aug 02 '22 16:08 vhoyer

Agree with @vhoyer. Also I would recommend putting such constants into configuration files and then use 🔧 :wrench:.

johannchopin avatar Aug 18 '22 12:08 johannchopin

Hey!

Closing this issue, feel free to reopen if needed 🙏🏼

carloscuesta avatar Oct 26 '22 17:10 carloscuesta