3 ms·
Your code sucks and it will suck for the next many years. Therefore, DO NOT start building a "library of useful functions". Build a library of knowledge, learn
by pbalau 5y ago
Your code sucks and it will suck for the next many years. Therefore, DO NOT start building a "library of useful functions". Build a library of knowledge, learn how to iterate over files in a directory in sh, bash, python, matlab. Then when you have to do it in ruby, you already know the basics and you can ask questions about what order the entries are going to be returned, will the list contain . and .., can I filter out some extensions etc.
There is a sister theory to the above: never automate things you don't fully understand. Let me rephrase: do not automate hard/complicated things. Automate tedious things. When you are fully confident of doing a thing manually, then you should automate it. Not before.