3 ms·
Why make a class with class methods? Using a plain old module would do the same thing, easier.
by pjscott 14y ago
Why make a class with class methods? Using a plain old module would do the same thing, easier.
- ekimekim 14y agoIndeed, I made my own one of these a few years ago, it was really just a module defining a bunch of constants. Well, not entirely constants. Rather than defining, say, FG_RED, BG_RED, FG_GREEN, BG_GREEN, etc. I had functions FG and BG that took color codes, like FG(RED) + BG(GREEN) + BOLD + "Garish horrible colors!!" + RESET. Actually I prefer working in inline escapes like that to curses overly complex method of defining color pairs and only ever specifying which to use at write-time. I wish curses had some way to inline attributes in a piece of text, that I can then use as normal data, pass around, etc.