Is it recommended to use DocBlock even if I’m not using phpDocumentor?

I’m developing a simple website for a client.

I have read about phpDocumentor and DocBlocks, and I thought that documenting my classes and functions will be very useful.

I’m almost sure I will not generate any documentation for the site, since it’s a pretty simple website, and guess what? It doesn’t have an API…

But is it still recommended to write DocBlocks in my code? From what I know many programmers even don’t write simple comments, but DocBlocks.
I’m not going to generate any readable documentation by the client/ next programmer but I still think that making some comments that are more than just simple text will be better.

edit – If you think that DocBlocks are redundant in my case, are there any other “standards” for writing comments / documentation?
The last time everything that doesn’t have a standard makes me feel stupid, that I’m not sure if it’s better to write if(){ or if () {, /* */ or //, etc.

I’m new to the documentor and DockBlocks, and I’m still not sure if I have to write this question here or in StackOverflow. Thank you very much anyway!

3

It is useful to document similar stuff in a similar way. This makes it easy to read the code as you can grasp the important things easily. Using an established standard as a foundation is useful as new team members will quickly get used to the scheme. phpdocumentor format is based on JavaDoc. The same form is sometimes used in other languages, too. Therefore even developers not familiar with PHP are more like to understand and use it quickly.

Additionally tools like IDEs support the format. And can derive information for some help from it.

If you should be strict in using it is a different question. You might use just little parts of it and modify others to your needs. Just like with any other tool 😉

1

At my previous jobs we didn’t use DocBlocks for PHP if the code was not an API and was not going to be used to generate documentation. Here was our philosophy on comments:

Use /**/ only for formal documentation at the top of the script that includes the author, date, brief description, etc. Use // for all other comments.

We noticed that comments can get out-dated and turn into lies about the code. We instead would try to write “self-illuminating” code by choosing function/class names that better reflect their purpose/function. We would also re-factor complex functions into simpler functions that “do one thing” instead of writing large functions that had a short novel comment above it to try and describe what it did.

The only benefit I can see that we were missing is labeling the function arguments on what data type they expecting and what data type the return value is. But then again, PHP is a loosely typed language where the DocBlocks could betray you (best to just use === and !== and is_*() functions if you really need to look at data types).

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật