Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Harriet Carker
Jun 2, 2009

In this case, I would just make a valueToDisplayName map. Use the value the server expects everywhere and when you need to show it to the user, just use the string value from the map.

Adbot
ADBOT LOVES YOU

Prism Mirror Lens
Oct 9, 2012

~*"The most intelligent and meaning-rich film he could think of was Shaun of the Dead, I don't think either brain is going to absorb anything you post."*~




:chord:
Using “key/value” as a shorthand for “user-facing string/internal value” is pretty common. I guess it varies which way round people choose to say key and value... but if you call the string the value and the value the key I don’t want to work with you :colbert:

Woebin
Feb 6, 2006

dantheman650 posted:

In this case, I would just make a valueToDisplayName map. Use the value the server expects everywhere and when you need to show it to the user, just use the string value from the map.
Yeah, I'd probably do this if it wasn't an established project and things weren't already pretty entrenched.

Prism Mirror Lens posted:

Using “key/value” as a shorthand for “user-facing string/internal value” is pretty common. I guess it varies which way round people choose to say key and value... but if you call the string the value and the value the key I don’t want to work with you :colbert:
In my defense, it's the older senior dev who's doing that, not me. I make my own, different bad decisions.

Macichne Leainig
Jul 26, 2012

by VG
In my mind the “key” is the ID for the associated DB record and the “value” is just the pretty-printed version of the record in context.

Just have a lookup table somewhere that defines a record with ID 3 correlates to “100.00” or whatever you need.

Keeps the DB well normalized as a bonus.

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer

Prism Mirror Lens posted:

Using “key/value” as a shorthand for “user-facing string/internal value” is pretty common. I guess it varies which way round people choose to say key and value... but if you call the string the value and the value the key I don’t want to work with you :colbert:
Generally I'd say the opposite, the machine readable one is the key because that doesn't change and the user display text is the value because then you can swap out a localised dictionary ($100 / € 100) as you need.

Woebin
Feb 6, 2006

Protocol7 posted:

In my mind the “key” is the ID for the associated DB record and the “value” is just the pretty-printed version of the record in context.

Just have a lookup table somewhere that defines a record with ID 3 correlates to “100.00” or whatever you need.

Keeps the DB well normalized as a bonus.
Man, I wish this was in a db and not just endless raw strings within the code.

ChickenWing
Jul 22, 2010

:v:

Working in Development: I make my own, different bad decisions.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Woebin posted:

Man, I wish this was in a db and not just endless raw strings within the code.

Make a constant string for each key (or was it value?) and make a big commit changing all of the handwritten strings to use the consts imo

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


ChickenWing posted:

Working in Development: I make my own, different bad decisions.

Mods?

Macichne Leainig
Jul 26, 2012

by VG

rt4 posted:

Make a constant string for each key (or was it value?) and make a big commit changing all of the handwritten strings to use the consts imo

Yeah, it sounds like it's going to be painful, just rip off that bandaid.

ChickenWing posted:

Working in Development: I make my own, different bad decisions.


:yeah:

Woebin
Feb 6, 2006

ChickenWing posted:

Working in Development: I make my own, different bad decisions.
I would be honored.

rt4 posted:

Make a constant string for each key (or was it value?) and make a big commit changing all of the handwritten strings to use the consts imo
I'm the weirdo who likes doing this sort of stuff, I find it meditative, and I usually slip some cleanup of this sort into my feature branches when I can. My colleagues (mostly the older guy who's been here for over a decade) don't always appreciate the big refactoring PRs though.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Would this double-sided thing be a case for a bidirectional dictionary/map aka bidict aka inverse dictionary/map aka two-way dictionary/map?

Canine Blues Arooo
Jan 7, 2008

when you think about it...i'm the first girl you ever spent the night with

Grimey Drawer
So as others have mentioned, despite the structure of 'user facing string, functional int' not really conforming the conventions of KVP, I'd still use a Dictionary<string , int>/Map/Whatever to represent this. It provides the structure that you'd basically want anyway, and most languages have robust features around Dictionaries such that you don't have to write a lot of supporting code to manipulate and manage them.

marumaru
May 20, 2013



if anyone ever says that humankind has never united under a single banner, show them this beautiful thread: https://twitter.com/ctrlshifti/status/1288745146759000064

Fellatio del Toro
Mar 21, 2009

perfect opportunity to use recursion

code:
func IsEven(i int) bool {
	if i == 0 {
	  return true
	}
	
	return !IsEven(i - 1)
}

Pedestrian Xing
Jul 19, 2007

Fellatio del Toro posted:

perfect opportunity to use recursion

code:
func IsEven(i int) bool {
	if i == 0 {
	  return true
	}
	
	return !IsEven(i - 1)
}

It's not webscale, can you refactor into an IsEvenEvaluatorFacadeFactoryBeanImplService?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/ctrlshifti/status/1288653375634956288

Carbon dioxide
Oct 9, 2012

.

Carbon dioxide fucked around with this message at 12:08 on Aug 1, 2020

Pedestrian Xing
Jul 19, 2007


Oof yeah, time tracking or any mention of personal KPIs is basically :sever: for me.

Hughlander
May 11, 2005

Pedestrian Xing posted:

Oof yeah, time tracking or any mention of personal KPIs is basically :sever: for me.

I really can't understand any manager that expects a positive outcome of time tracking. The only rational outcome of time tracking is to work to the time.

prom candy
Dec 16, 2005

Only I may dance
We used to have to do it when I worked at an agency, but eventually I would just kinda say "how much do you want to bill them for this? great, that's exactly how long it took"

Still an annoying waste of time and I fought really hard to get us to switch to selling weeklong sprints but they weren't having it.

Hughlander
May 11, 2005

prom candy posted:

We used to have to do it when I worked at an agency, but eventually I would just kinda say "how much do you want to bill them for this? great, that's exactly how long it took"

Still an annoying waste of time and I fought really hard to get us to switch to selling weeklong sprints but they weren't having it.

Well yah contract is something totally different. I had been at places where we had to track to 1/10th of the hour. And guess what? I didn't give any free time then!

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Pedestrian Xing posted:

Oof yeah, time tracking or any mention of personal KPIs is basically :sever: for me.

Personal KPIs: 1a. endear myself to at least 1 manager in my part of the org and 4 in other parts of the org that don't have their reports do personal KPIs. These numbers will be doubled if I can't prioritise my work based on my personal KPIs.

:grin:


Really though; every time I've done them I've had to blow them up and re-do them for some priority change. Which makes them feel even more pointless than I know they are.

Hughlander
May 11, 2005

leper khan posted:

Personal KPIs: 1a. endear myself to at least 1 manager in my part of the org and 4 in other parts of the org that don't have their reports do personal KPIs. These numbers will be doubled if I can't prioritise my work based on my personal KPIs.

:grin:


Really though; every time I've done them I've had to blow them up and re-do them for some priority change. Which makes them feel even more pointless than I know they are.

Reminds me of a place that required team wide Achievements (What you did this week) and Objectives (What you plan to do next week.) be sent out to all members every Friday...

I loved when I sent out my two liner
Achievement:
Resigned this week effective 7/31
Objectives:
Turnover

Woebin
Feb 6, 2006

I'm an oddity in that I started using Toggl to get a better idea of where my time goes during university, and I've just kept using it at every job since purely for my own benefit. I really like being able to look at my own history and seeing how much time I spent on any one thing, how much got wasted in meetings etcetera. Plus it helps keep me accountable to myself when it comes to not overworking, which is nice - I like my job, but I'm not spending more time on it than I get paid to.

That's just my own private tracking though, if some middle manager with a need to feel useful demanded that I did exactly the same thing and reported it to them I'd be annoyed at best.

Che Delilas
Nov 23, 2009
FREE TIBET WEED
To paraphrase what's been said before: metrics that become targets lose all their value as metrics.

Woebin
Feb 6, 2006

Che Delilas posted:

To paraphrase what's been said before: metrics that become targets lose all their value as metrics.
Good point, that differentiation really is key.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Che Delilas posted:

To paraphrase what's been said before: metrics that become targets lose all their value as metrics.

Goodhart's law

Che Delilas
Nov 23, 2009
FREE TIBET WEED

Yeah him

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

Pedestrian Xing posted:

Oof yeah, time tracking or any mention of personal KPIs is basically :sever: for me.
My shithole job estimates tickets by the half-hour, pretends there are 6 developer hours in a day, that developer hours are fungible, and then ignores our estimates entirely for numbers pulled out of their rear end. They wonder why we scramble to meet deadlines and why our estimates don't match their fictions.

We're still expected to log hours against our tickets. I haven't done that in months.

Yes I'm :sever: ing

EDIT: Also I vastly overestimate tickets because even if the development work is done in the time they never take into consideration rejection by QA, discovery of issues, working with other team members, etc. They are extremely bad at project management.

Woebin
Feb 6, 2006

Wow, the thread got the new name, huh? A legacy I can be proud of.

Anyway I just quit work for the day, which marks the beginning of three weeks' vacation! Gonna be weird to not work on this project for a while, this is the first time I ever feel like I might kinda miss my job while I'm off. Is this just what it feels like to have a job you like? All my previous dev jobs have been varying levels of terrible for me.

ChickenWing
Jul 22, 2010

:v:

Woebin posted:

Wow, the thread got the new name, huh? A legacy I can be proud of.

Anyway I just quit work for the day, which marks the beginning of three weeks' vacation! Gonna be weird to not work on this project for a while, this is the first time I ever feel like I might kinda miss my job while I'm off. Is this just what it feels like to have a job you like? All my previous dev jobs have been varying levels of terrible for me.

While I can honestly say I've never missed work while I've been off, I'm certainly susceptible to checking slack while I'm out just to make sure everything is still ticking along. Having a job you like is pretty great.


Aside: my startup got acquired by a Microsoft shop and now we have teams instead of slack and while I love it for everything calendar related, everything else can gently caress right off. Especially the part where we need MDM if we want to look at anything work related on our phones. gently caress you I just want to be able to call in sick without leaving my bed :mad:

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

ChickenWing posted:

While I can honestly say I've never missed work while I've been off, I'm certainly susceptible to checking slack while I'm out just to make sure everything is still ticking along. Having a job you like is pretty great.


Aside: my startup got acquired by a Microsoft shop and now we have teams instead of slack and while I love it for everything calendar related, everything else can gently caress right off. Especially the part where we need MDM if we want to look at anything work related on our phones. gently caress you I just want to be able to call in sick without leaving my bed :mad:
Work Profile was a significant factor in my decision to switch to Android a few years back

prom candy
Dec 16, 2005

Only I may dance

ChickenWing posted:

While I can honestly say I've never missed work while I've been off, I'm certainly susceptible to checking slack while I'm out just to make sure everything is still ticking along. Having a job you like is pretty great.


Aside: my startup got acquired by a Microsoft shop and now we have teams instead of slack and while I love it for everything calendar related, everything else can gently caress right off. Especially the part where we need MDM if we want to look at anything work related on our phones. gently caress you I just want to be able to call in sick without leaving my bed :mad:

I hate Slack/chat apps, I honestly miss email.

beuges
Jul 4, 2005
fluffy bunny butterfly broomstick

prom candy posted:

I hate Slack/chat apps, I honestly miss email.

Hi Prom Candy

Noted.

Regards,
beuges
<1MB signature image that's now been added to the email for the 10th time>
Please be kind to the environment and think before you print this email

Disclaimer: this email is intended only for the addressed recipient. If you have received this email in error, please destroy it and you are self. Unlawful possession of this email or the contents therein could result in death by immolation. If you are unable to read this email or disclaimer please send an email to lol@urbutt and you will receive another email with this disclaimer in it.

CPColin
Sep 9, 2003

Big ol' smile.
Auto-reply: Due to the COVID-19 crisis, I'm working from home. I'll be checking my email periodically. Who gives a poo poo. Also this auto-reply fired despite my having sent the initial email.

Clanpot Shake
Aug 10, 2006
shake shake!

Can you take me off this chain? I left that work unit 6 months ago but somehow I'm still in this group. Thanks in advance.

ChickenWing
Jul 22, 2010

:v:

Vulture Culture posted:

Work Profile was a significant factor in my decision to switch to Android a few years back

okay how's this work because I'm very strongly of the "I don't want corporate IT's grubby paws in my device" persuasion but I've heard peripherally of this option and how it's basically a second partition?

prom candy
Dec 16, 2005

Only I may dance

beuges posted:

Hi Prom Candy

Noted.

Regards,
beuges
<1MB signature image that's now been added to the email for the 10th time>
Please be kind to the environment and think before you print this email

Disclaimer: this email is intended only for the addressed recipient. If you have received this email in error, please destroy it and you are self. Unlawful possession of this email or the contents therein could result in death by immolation. If you are unable to read this email or disclaimer please send an email to lol@urbutt and you will receive another email with this disclaimer in it.

I'll take this over having 3 parallel conversations in the same slack channel, or taking a day off work and just completely missing anything important that happened, or getting a non-time sensitive request but still needing to respond right away or else it'll be pushed off the screen and as good as gone.

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012

prom candy posted:

I'll take this over having 3 parallel conversations in the same slack channel, or taking a day off work and just completely missing anything important that happened, or getting a non-time sensitive request but still needing to respond right away or else it'll be pushed off the screen and as good as gone.

tldr; you use slack wrong

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply