In practice, we would often prefer to use an existing version of code if we're sure we can trust it
This means knowing what libraries/packages/modules are available for the language we're interested in, and where to find collections of other code people have developed in the language. (Both tasks much easier since the creation of decent search engines!)
Here are references for the core libraries/packages/modules of a few common languages:
A nice collection of code is available at Rosetta Code , where they show solutions for hundreds of tasks in each of hundreds of languages.