kirplink
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
At the moment I have to jump between using JS, C#, and Python. There is no way I'm keep all the correct syntax in my head.
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
My suggestion is focus on understanding when you should do/use something and not focus on syntax. Take a loop as an example. I think it is more important to know when you should use a loop and it is not as important to know how to write a loop. As long as you know what to use you can always google the syntax
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
It will all come to you eventually
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
In this case understanding the principles of object oriented programming. What are the benefits it brings and what are the drawbacks, and when should you apply it to what you are working on.
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
I think it is more important to understand different principles of programming
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
@lossw If you don't want to deal with classes at the moment I wouldn't worry about it
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
At the end of the day the 'class' keyword in JS is syntactic sugar. It obfuscates what is really going on behind the scenes and implies that JS is doing something it is not.
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
JS Classes don't have the encapsulation that you would expect in true object oriented languages
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
but @boiithugger you need to understand the inner workings of JS to not fall into the trap of thinking you can use classes like you do in other programming languages.
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
I do use classes. Constructors are the gateway drug to classes.
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
You use them when you need to have multiple objects that have the same methods, but different states. Think of all the enemies in a game. They all need an attack method and a take damage method, but they should have their own health pool. This way you can call enemy1.takeDamage() and you know it will only damage enemy1
27 replies
KPCKevin Powell - Community
•Created by loss on 7/7/2023 in #front-end
Constructor functions and usage
I think reading more about object oriented programming would help you out. This give a pretty good overview of the principles of object oriented programming. https://www.freecodecamp.org/news/object-oriented-programming-concepts-21bb035f7260/
27 replies
KPCKevin Powell - Community
•Created by Senra on 7/6/2023 in #ui-ux
Need help with font and colors for a single-page site
17 replies
KPCKevin Powell - Community
•Created by Senra on 7/6/2023 in #ui-ux
Need help with font and colors for a single-page site
17 replies
KPCKevin Powell - Community
•Created by Senra on 7/6/2023 in #ui-ux
Need help with font and colors for a single-page site
17 replies