Giter VIP home page Giter VIP logo

frankarendpoth.github.io's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frankarendpoth.github.io's Issues

Google Verification Code Stored in a Public GitHub Repository

Your Google site verification code is completely visible and easily accessed by any person viewing this repository. This is a security flaw, and you may wish to fix it.

Of course it is up to you what you do with your verification code, but I would highly suggest taking it off of the repo.

Class Inheritance Issues

Hi,
thank you for the Tutorial on the Platformer Game (https://github.com/frankarendpoth/frankarendpoth.github.io/tree/master/content/pop-vlog/javascript/2018/006-rabbit-trap). I really enjoyed watching it. While implementing an own version of it, I recognized an issue with how you implement the "class inheritance".

The way you do it is the following:

Superclass = function(){
    //Definition of Superclass attributes
}
Superclass.prototype = {
    //Definition of Superclass methods
}
Subclass = function(){
    Superclass.call(this);
    //Definition of Subclass attributes
}
Subclass.prototype = {
    //Definition of Subclass methods
}
Object.assign(Subclass.prototype, Superclass.prototype);
Subclass.prototype.constructor = Subclass;

This seems to work for your approach, but as soon as you want to override methods, your implementation leads to always calling the superclass' method instead of the subclass one (Similar to the constructor, that you also had to fix after the assignment).

A nicer way of implementing your approach, and also have the correct overriding behavior would be to turn around the assignment and e.g. use the following instead:

Superclass = function(){
    //Definition of Superclass attributes
}
Superclass.prototype = {
    //Definition of Superclass methods
}
Subclass = function(){
    Superclass.call(this);
    //Definition of Subclass attributes
}
Subclass.prototype = Object.assign(Object.create(Superclass.prototype), {
    //Definition of Subclass methods
});

That way, the subclass' prototype methods correctly overwrite the Superclass once. Method overriding works as intended. No need to fix constructors.

Best,
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.