lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Tim Hill:

such pleasant words!!! :D


tl;dr: read the next paragraph, check out Wirth's law, and basically
follow "yagni" and "dry" instead of "clean code". :D


my rule-of-thumb is like:
dont use an extra variable or function for anything that wont be used
for more than once (if possible) except if it really makes sense to
have a freestanding setting/tool, that is future-wise, or there is any
strong-enough reason to do so.


everyone knows Moore's law, they say, that its fine to pull some trash
here and some more there, cuz the customer wants it for yesterday, and
business says that this is the right way to go, and if someone else
will need to use and maintain it, then its fine for them to give trash
and say that it "works"... yuck. did u guys hear about Wirth's law? so
much ppl around the industry didnt, or just dont care about it... :/
the industry forces the right opposite of the golden rule (“Whatever
you wish that others would do to you, do also to them, for this is the
Law and the Prophets.”) we are using tools on a daily basis that were
made with just that mentality, therefor programmers can earn this
much, cuz its a real madness! :D and thats my main reason for using
lua!!! :D

ppl use variables just for giving sense to some magic, like a search
box that is triggered by hitting <enter>, so that is checking for the
charcode if it is 13, so they put it in a variable called 'enter' to
make it human-readable, but i prefer a comment on the end of the line,
that its an <enter>... commenting is the right thing to make things
easy-to-understand for humans. (but for sure, thats suitable for
compiled languages where that wont become overhead, but not a good
practice for scripting.) otoh, if i would need more charcodes then i
would most likely make a hash table for them.

ppl use everywhere set-/getters just because they are afraid of
refactorization, so they make everything bloated, and to be
blackboxes... tracking down all these extra abstraction layers is a
total madness, it can easily give a mental overflow, and when i go for
the essence of such things (like a google+ login where they give a
bloated lib instead of an api specification) then finally ive got a
small bunch of neat lines, instead of megs of bloated mess... they do
this cuz they think its for ease of coding, but they forget about that
they have to understand it as well, so it also becomes error prone,
that is a total madness... too much abstraction is wrong for our
health, mmmkay? :D and also, such common ways generally makes every
little essential tools self-contained in every bloat, so if u have a
nodejs app, for example, then most likely u have probably a s#!tload
of tools included, that are basically the same, but they are
everywhere... :D

also, its fine to use jquery everywhere only for its `xmlHttpRequest`,
that can be written like in 20loc to be a freestanding function with
all the goodies included; and its fine to use bootstrap only for its
responsivity that is a matter of using `float: left;` and `@media`...


all the bests! :)