Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we get coders to look up existing functions before writing their own?

Tags:

php

spl

Why are so many people still writing crappy versions of things in standard libraries? Not to go after PHP developers, but guys go read the PHP SPL

like image 779
Andrew Clark Avatar asked Mar 13 '09 15:03

Andrew Clark


People also ask

Why do programmers write functions rather than writing everything out in order?

A function is almost like a mini-program that we can write separately from the main program, without having to think about the rest of the program while we write it. This allows us to reduce a complicated program into smaller, more manageable chunks, which reduces the overall complexity of our program.

How do you read an existing code written by someone else?

This 4 step process is simple and will save you a lot of time and effort; all you need to do is: Run the code and explore the results. Find the main function or the start point of the code. Run the code under the debugger and fully understand the code's mechanics.

How does a programmer know if a program works?

That is, the programmer prepares the instructions of a computer program and runs those instructions on the computer, tests the program to see if it is working properly, and makes corrections to the program. The programmer also writes a report on the program.


1 Answers

Peer review can help catch that kind of thing. If you have another developer looking at the code, and they continually find implementations of standard library methods, it should fail the review unless there's a good reason for reinventing the wheel.

like image 190
Elie Avatar answered Oct 28 '22 10:10

Elie