Yarn: SystemUtil -> ?

Created on 1 Jul 2019  ·  6Comments  ·  Source: FabricMC/yarn

SystemUtil contains a bunch of static methods. Some of them relate to a "system":

  • fine-grained timers
  • current operating system
  • JVM flags

But many others are completely unrelated:

  • patching miscellaneous holes in the Java standard library (ifPresentOrElse, thenCombine, completeExceptionally, consume, get, toMap, ...)
  • a bit about the server worker
  • reading and writing UUIDs from Dynamics
  • an identity hash strategy
  • something about translation keys? lol

It appears to be less of a system-related class and more just a dumping ground for random functions that are too small to break into their own named helper class but too broadly applicable to keep near one call site.

Should this class be renamed?

Some suggestions being thrown around on Discord:

  • Misc
  • Util
  • Useful
  • Varia
  • Helper
  • Etc
  • Funny comedy suggesions:

    • Junk

    • Stuff

    • MiscellaneousGameSystemUtilities

    • BucketOShi

discussion

Most helpful comment

Name it ClassThatWeHaveNoIdeaWhatToNamePleaseHelp

All 6 comments

Util gets my vote. Simple and to the point.

Name it ClassThatWeHaveNoIdeaWhatToNamePleaseHelp

I'd go with MinecraftUtil personally but also kashike is god so Util 👍

Util is good, however it does seem like the majority of the functions are system related. System also doesn't necessarily have to mean _just_ the Operating System. Patching Std lib functions, Uuid serialization, and anything with hashing sounds to me as something that technically qualifies as "system utilities". Not the OS system, but the Java system, they're just so low level. Just Sys would work.

There are also other naming strageties I've used such as Objects/Strings/Collections/etc...

Generally, kashike has a lot of wisdom here, so I'd go with Util.

I personally support Misc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Runemoro picture Runemoro  ·  3Comments

Runemoro picture Runemoro  ·  4Comments

asiekierka picture asiekierka  ·  3Comments

enbrain picture enbrain  ·  4Comments

Runemoro picture Runemoro  ·  4Comments