24Jun2022: Party Overflow, OOP concepts review

Written by Catt Tung on Jun 24th, 2022 Views Report Post

Party Overflow

I finally got back to Party Overflow today and was able to run the proper terminal command to get my backend server running and resolved the bug I was getting in the past. It's always very satisfying to resolve a bug no matter how small it is.

In terms of what I continued to build, I built the logout route and got the posts to get into state - first pulling all the posts lists by creating a postService.js in services to fetch all the posts with an API call, then building a useEffect hook to set the state for PostList in a jsx file.

I also added PostCard.jsx as a component, as well as a Header.jsx. I love how clean and organised all this code is, I think Hunter wrote most of these React apps and it really is great to follow along and build out such neatly organised code.

Review of Programming paradigms

  • Procedural programming - programming where you write a sequence of steps moving toward a solution; each step changes the program's state
  • Functional programming - procedural programming but eliminating global state by passing it from function to function
  • Object-oriented programming - programming where you define objects that interact with each other

I also went over a few new concepts from The Self Taught Programmer today - I've seen it in programming but not defined and I think it's rather helpful -

  • Encapsulation - 1) objects group variables and methods in a single unit - the object 2) hiding a class' internal data to prevent the client from directly accessing it (Note that Python's variables are all public, so by convention if it starts with an underscore it's meant to be a 'private' variable ('use at your own risk' kind of variable))
  • Abstraction - reducing to a set of essential characteristics
  • Polymorphism - being able to apply the same method/interface for different forms/data types
  • Inheritance - inheriting methods/variables from another class when you create a class
  • Composition - models the 'has a' relationship by storing an object as a variable in another object

Catt xx

Comments (0)