News for hackers. Stuff that matters.
Re:Don't Name Classes After Patterns. Mostly by johbjo on Sunday August 23, 2020 @06:30AM (#24250926)
a_b in maths is pronounced "a of b" in English, and is often intended to be equivalent to a(b).

Superscripts in maths is closer to concatenated class names, as it separates it from being a function of something.

Re:Don't Name Classes After Patterns. Mostly by mjburgess on Sunday August 23, 2020 @06:46AM (#24250998)
Subscript to "of" doesn't always work.

A model trained on UK data is f_uk. It isnt "model of UK"... its a model of, eg., prices for goods.

f_UK is more like "the UK's model (of prices)"

I think the better way to interpret the mathematical convention is ObjectOfStudy_variation

...which is the convention being used in programming.

Re:Don't Name Classes After Patterns. Mostly by johbjo on Sunday August 23, 2020 @10:14AM (#24252097)
Kind of. Pronouncing a_b as "a wrt b" should work though.

With f_uk, it could mean a model with parameters trained for UK - "theta uk".

In my view, it's nice to have subscript-like things in the constructors. Ex:

uk_price_model = PriceModel(uk_model_parameters)

Re:Don't Name Classes After Patterns. Mostly by OnlyOneCannolo on Sunday August 23, 2020 @09:37AM (#24251844)
f = goods price model

uk = United Kingdom

f_uk = goods price model of the United Kingdom

Seems to work. Did I misunderstand?