AHKCon 3: 🎓 Master classes and objects - Attend this lecture!
Channel: AUTOHOTKEY Gurus
Date: 07/08/2022

In the 3rd hour of AHKCon Isaias Baez leads us through an AutoHotkey tutorial on Objects and Classes.  We looked closely at Meta functions and Inheritance, and some practical examples.  If you want to learn more about Objects & Classes you should consider purchasing his course: https://the-Automator.com/Objects

TLDR: Object-oriented programming focuses on creating classes and objects to improve maintainability and reliability.

1. 00:00 🤔 Creating classes and objects can help solve problems in the intermediate autohotkey course.
 1.1 Isaiah and the speaker discussed using objects, classes, and methods to solve problems in the intermediate auto hockey course.
 1.2 Classes are like blueprints for objects, allowing you to create multiple objects from one blueprint.
 1.3 Objects are instantiated from a class and can have different options, while com objects are interfaces to a class that allow two objects to communicate.
 1.4 Most people have not created their own classes and objects, but this lecture will explain how to do so.
 1.5 Creating a class with properties using this notation can help clarify confusion for those who have never played with classes.
 1.6 An object can have properties and actions, such as a house having the ability to open its door.

2. 06:51 🔑 AHK Version 2 of the hotkey can detect if something doesn't exist, preventing unexpected results.
 2.1 Creating an instance of a class creates an object, which can be used with dot notation and have different values.
 2.2 Classes and objects are used to compartmentalize memory and operations for complex processes.
 2.3 Group common functions together to avoid interaction with other functions and keep them separate.
 2.4 Different languages will handle a property or method that doesn't exist differently, with some returning an error, some returning a null or empty string, and others expecting the language to tell the user that the property doesn't exist.
 2.5 Version 2 of the hotkey can detect if something doesn't exist, preventing unexpected results.

3. 13:12 🤔 Create a static instantiation function to call classes as functions, use new and delete meta functions to define behavior when creating/deleting objects, and use call meta function to define default actions when a method is called.
 3.1 Classes require an include to be used, but you can create a static instantiation function to call it as a function.
 3.2 The new and delete meta functions allow you to define behavior that is automatically done when creating or deleting an instance of an object.
 3.3 When using the delete function, make sure it is self-contained and not accessing outside variables, as it can be unreliable.
 3.4 The call meta function is called when a method that is not defined in a class is called, allowing for default actions to be defined.
 3.5 This function returns the name of the method called and can be used as a deciding factor for further actions.
 3.6 Params must be defined as variatic for it to be accepted, with params one being the first one and so on.

4. 25:12 🤔 Polymorphism allows for the same function to behave differently depending on the parameters passed.
 4.1 The get meta function allows for automated and dynamic ways of returning values when a property is not set.
 4.2 Using the set method allows you to target and perform actions on values before saving them into an object.
 4.3 In v1, if there are not enough parameters, the expected result may not show up, but v2 should take care of this.
 4.4 Polymorphism allows for the same method to be defined with different parameters, and AutoHotkey will decide which one to call based on the parameters passed.
 4.5 Polymorphism is when the same function behaves differently depending on how it is called.
 4.6 Polymorphism allows functions to behave differently depending on the number of parameters passed, and can be achieved by defining parameters or creating separate methods.

5. 36:55 🤔 Inheritance allows for code reuse by creating a class that adds differences to an existing class, such as a house and a building.
 5.1 Inheritance allows classes to grab code from other classes and modify it, such as a building being a big house.
 5.2 Inheritance allows for code reuse by creating a class that adds differences to an existing class, such as a house and a building.

6. 44:33 🤔 Extend classes to modify behavior, create your own functions, and don't worry about updates.
 6.1 We have 15 minutes for questions, then a break with lunch and open mic for chatting.
 6.2 You can extend existing classes to modify their behavior to suit your needs.

7. 49:26 🤔 Extend your code with classes and objects for maintainability and reliability, and use DLL calls for speed and reliability advantages.
 7.1 Extending classes is a non-destructive way to modify code and use object-oriented programming.

8. 57:17 🤔 Object-oriented programming focuses on classes and objects.
learn more here: https://the-Automator.com/Objects