Posts

Showing posts from October, 2021

Uncomfortable Truth about Coding Tutorial Videos

I use google a lot to find information about my problems. And google seems to pick up onthat and started recommending coding tutorial videos titled something like "Learn [popular language] in [number] hours complete course", with additional keywords like "for beginners". In this kind of videos, you will learn the most basic concepts about the language and that's about it. Great, you learned if statement and for statement. Now how do I actually use them in practice? Very few would be able to write something like this after watching that video if given the appropriate problem. (And this is not a good code either. You should use Linq if it's possible.) public class Main{     public void CheckAndPrintArray<T>(T[] array, Func<T, bool> checkError){         for(int i = 0; i < array.Length; i++){             if(checkError( array[i] )) Console.WriteLine($"Array element# {i} has error."); ...

Abstraction and Encapsulation

 There are 2 main paradigms for programming languages now: imperative and object oriented. While these are vastly different paradigms, they do the exact same thing: changing and moving around some numbers. Your "Player" object doesn't really exists. Its numeric representation is just somewhere in the RAM and you just can only access it if you have to reference(pointer) to that object. But humans don't think this way. Real world doesn't work this way. So we use abstraction to make somewhat believable object that represents real world things. And this is the core concept of object oriented languages(imperative languages also have abstraction, but it's not their core concept). Abstraction is reducing real things down to concepts. Real things are complex. They are made of atoms(and even more small particles if you go further) and even the small things you can see in daily life consist of billions and trillions of atoms. But computers can't represent that. They...