ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

When we use function and when we use class? Answer in one line

user-image
تم إضافة السؤال من قبل Ahmed Gamal Soliman , Senior Oracle Adf Developer , Personal Project
تاريخ النشر: 2017/03/27
Muhammad Rehan
من قبل Muhammad Rehan , Senior Software Engineer , Ascertia

Functions are used to DO specific things, whereas classes ARE specific things (class is a way of grouping functions (as methods) )

Ahmed Gamal Soliman
من قبل Ahmed Gamal Soliman , Senior Oracle Adf Developer , Personal Project

I accept answer of mr mohamed rehan

I think function we use when we need to deal with one task as power function- loop function then class we use when we need to deal with multi taskesin many form

Amany Saad Abolella
من قبل Amany Saad Abolella , Senior PHP Developer , Speedi

Functions are the meat of your application and classes are more like the plate. It's messy to eat meat without a plate. But if you don't have any meat, you don't have a meal.

 If you want to represent data as objects use classes.

If you want a quick solution use function.

 

المزيد من الأسئلة المماثلة