2 ms·
> You don't want to expose what kind of date string that something depends upon in your variable name. Sure you do if you're a subscriber to Hungarian Notation
by zimpenfish 9y ago
> You don't want to expose what kind of date string that something depends upon in your variable name.
Sure you do if you're a subscriber to Hungarian Notation. And if you're working in a loosely-typed language, it helps a lot to be able to track types through variable names.
- coldtea 9y ago>Sure you do if you're a subscriber to Hungarian Notation. Hungarian notation encodes types (and/or scope etc) -- not formatting details. Where would it stop if the latter was the case? >And if you're working in a loosely-typed language, it helps a lot to be able to track types through variable names. ymd is not a type though. str_currentDate is.
- dagw 9y agoThere are two 'schools' of Hungarian Notation, original Hungarian notation as described in the original paper, and Hungarian notation as used by the Windows team and later most MS Developers. Joel Spolsky has a pretty good blog post about them here: https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/ https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...
- zimpenfish 9y ago> Hungarian notation encodes types (and/or scope etc) -- not formatting details That entirely depends on your interpretation of Hungarian - there are many. Plus "YMD" is easily valid as a type - imagine creating a struct with { y int; m int; d int; } and using that instead. > ymd is not a type though. Only because you have decided it isn't in this instance. There is no obstacle to it being a type.
- coldtea 9y agoAlso because types in PHP are specific things.