Ticketing system | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Ticketing system

i am considering using functions or structures for my ticketing system assignment, which is more useful?

17th Dec 2019, 2:30 AM
Daniel - avatar
1 Answer
+ 4
Functions can always do more than structures. But, structures are easier to understand. Therefore, if all of your design aspects can be handled by structures, that should be your top choice. Your next choice could be to combine them both into a class. This tends to be easier to understand over a pure functional approach. However, a tiny single function is better than multiple structures or class. Sometimes, coding multiple ways is needed to find the simpliest design. Other times, you can estimate the final complexity with minimal planning.
18th Dec 2019, 4:57 AM
John Wells
John Wells - avatar