The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Although in some strange realm that may be something one needs to do, if one were writing their own strlen(...), would it not be better to give it its own name, too? Or maybe create some weird-ass overload if the language permits it?
On the other hand, if it's scope is wide enough, think of the fun you could have with other members of some team when their code goes insane for no discernible reason.
You can add methods right to core classes! You don’t have to call Time.now.advance(days: -1), you can write 1.day.ago! It makes Ruby a joy to read and write. Until…
You hit weird bugs because a patch changed Hash.
You get confused about which code actually ran, so you can’t debug it when it breaks.
And you finally figure out that all your problems were caused six months ago, when you monkey-patched Enumerable to make one line of code five characters shorter.
That example perfectly encapsulates one of the issues of modern programming languages. History repeats itself, as programmers in the 90's mistook less lines of code, with obfuscated one-liners.
Now the line's not obfuscated, but you're still sacrificing so much... for a few lines of code.
If I remember right, PHP did not have anything like namespaces. I think this was their grand alternative to solving name collision. Just what I would expect from guys playing around with a badly thought through interpreter.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
Someone told me that in Forth, every token is a symbol of a defined value. So you may define 3.14159 to have the value 3.0. Or to have the symbol 3 have the value 17. I never programmed in Forth, so I never tested out if this is true. If it is ...
Last Visit: 22-Feb-20 16:21 Last Update: 22-Feb-20 16:21