PaulStoffregen / Ethernet

Ethernet library for Teensy (Wiznet W5100 / W5200 / W5500)
http://www.pjrc.com/teensy/td_libs_Ethernet.html
130 stars 83 forks source link

Question: why all headers in one file? #26

Closed Rotzbua closed 5 years ago

Rotzbua commented 6 years ago

Why all header files merged into one big header file? In my opinion that is a unusual and not recommendable coding style.

"Big" header file: https://github.com/PaulStoffregen/Ethernet/blob/master/src/Ethernet.h

"Empty" header files: https://github.com/PaulStoffregen/Ethernet/blob/master/src/EthernetClient.h https://github.com/PaulStoffregen/Ethernet/blob/master/src/EthernetServer.h https://github.com/PaulStoffregen/Ethernet/blob/master/src/EthernetUdp.h https://github.com/PaulStoffregen/Ethernet/blob/master/src/Dhcp.h

PaulStoffregen commented 6 years ago

The old way suffered many problems if the headers were included in the wrong order.

PaulStoffregen commented 6 years ago

I know many people probably do not like this style, but in this case there really isn't any compelling reason to include only part of these classes that are heavily dependent upon each other (friend classes).

Rotzbua commented 6 years ago

Thanks for the answer, I am gonna take a closer look at this problem next weekend.