How to write classes more efficiently?

WBOY
Release: 2023-03-03 09:20:02
Original
973 people have browsed it

Which implementation method of the following two classes is better? Or are there other better solutions? Discuss discuss.

1. Start with each specific function and write all the functions of the class in one method. After the test passes, the entire function is divided into various methods of the class and tested again.

2. First write the overall structure of the class, and then fill in each function.

Reply content:

Which implementation method of the following two classes is better? Or are there other better solutions? Discuss discuss.

1. Start with each specific function and write all the functions of the class in one method. After the test passes, the entire function is divided into various methods of the class and tested again.

2. First write the overall structure of the class, and then fill in each function.

Object-oriented custom class

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!