Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 15 03:49
    RIAEvangelist commented #122
  • Jan 15 03:44

    RIAEvangelist on 3.3.1

    (compare)

  • Jan 15 03:41
    RIAEvangelist labeled #125
  • Jan 15 03:41
    RIAEvangelist assigned #125
  • Jan 15 03:41
    RIAEvangelist opened #125
  • Jan 15 03:33

    RIAEvangelist on master

    updated contributors added @ro… (compare)

  • Jan 15 03:29
    dependabot[bot] labeled #124
  • Jan 15 03:29
    dependabot[bot] opened #124
  • Jan 15 03:29

    dependabot[bot] on npm_and_yarn

    Bump ansi-regex from 5.0.0 to 5… (compare)

  • Jan 15 03:28

    RIAEvangelist on master

    Expose utils/urls as an export … Merge pull request #123 from ro… (compare)

  • Jan 15 03:28
    RIAEvangelist closed #123
  • Jan 15 03:28
    RIAEvangelist closed #120
  • Jan 12 19:34
    robbieaverill opened #123
  • Jan 06 17:06
    That-Half-Dead-Skeleton opened #122
  • Jan 05 06:31
    RIAEvangelist commented #121
  • Dec 14 2021 20:14
    RIAEvangelist commented #121
  • Dec 14 2021 06:37
    Lawrence-ux opened #121
  • Dec 10 2021 23:28

    RIAEvangelist on master

    Added sponsor feed (compare)

  • Jul 04 2021 19:02

    RIAEvangelist on master

    ignoring coverage for language … (compare)

  • Jul 04 2021 02:07
    RIAEvangelist commented #2
Brandon Nozaki Miller
@RIAEvangelist
Yeah, I have never paid for one.
Madeline Cameron
@madelinecameron
Brackets seems like a bit of a step-up from Atom. Atom is sort of clunky and weird in my opinion but it works as a text editor.
Brandon Nozaki Miller
@RIAEvangelist
Some of the guys I worked with forced me from vim to netbeansd then I went to cloud nine, and back to netbeans and now Ive been on brackets for a wile.
yeah, I tried atom for a week but preferred brackets
I actually tried atom twice just to give it a fair shake.
brackets plugins are the bomb.
git, term etc.
Madeline Cameron
@madelinecameron
Brackets is for windows as well?
Brandon Nozaki Miller
@RIAEvangelist
FYI im debugging the Address test.
Madeline Cameron
@madelinecameron
They don't do a great job at advertising it... but it is giving me an .msi
Oh okay.
It works on my machine. The test that is failing for me is pricing.
Let me know what is going wrong with it because I wrestled with two of those tests for a while to get working.
Brandon Nozaki Miller
@RIAEvangelist

can you make sure you have pushed the most recent tests?

I'm thinking moving away from prototypical objects to oop defined Class objects might be really good.

I will convert the Address.js Class and then we can discuss.

Madeline Cameron
@madelinecameron
The issue I found and this is a total guess / assumption is Javascript is weird about concatenating strings together so those strings aren't equal. Or it is mocha.
Brandon Nozaki Miller
@RIAEvangelist
That cool with you?
Madeline Cameron
@madelinecameron
Besides not using prototype.
Uhh, I hope this isn't a dumb question but isn't prototype + function basically oop. I looked in 'oop javascript' and prototypes seemed like the way to go. What I am asking is what will be the difference?
And my message is going to be weirdly ordered, I think.
Yeppp
'function'
Brandon Nozaki Miller
@RIAEvangelist
I'm not a big fan of prototype, its only one way to do oop, but it can obfuscate the shit out of stuff for jr devs. especially with inheritance.
I'll just do one Class and then we can discuss
I'll do it in one commit so if you don't like it we can revert.
Madeline Cameron
@madelinecameron
Yeah definitely. I am interested. I wasn't entirely aware that Javascript had inheritance. I was under the impression that Javascript was sort of faux oop. That a lot of traditional oop things weren't actually present in Javascript.
Brandon Nozaki Miller
@RIAEvangelist
Pretty much thats correct. Primary reason for doing this is that the way the prototypical objects are set up now is fucking with the scope of 'this'
Madeline Cameron
@madelinecameron
Ahh okay. Yeah, change away. I am interested to see if it can make things a bit more sane, especially as additional features get added.
Brandon Nozaki Miller
@RIAEvangelist
Pretty sane, though I don't know many other devs who have gone this route. I LOVE it. it defines stuff clearly.
Madeline Cameron
@madelinecameron
oop in general or the new method we might change to?
Brandon Nozaki Miller
@RIAEvangelist
new method
Madeline Cameron
@madelinecameron
Oh okay
Brandon Nozaki Miller
@RIAEvangelist
K if you do a git pull on the PI branch you will see the new Address Class.
Tell me what you think.
I feel it makes the Class very transparent right off the bat for anytone who looks at it.
They know what they can edit, use etc.
also, if they use this in the browser or say nw.js, it makes the console, very clear.
Everything is now passing accept Price
Madeline Cameron
@madelinecameron

Yeah, that is the one I am having trouble with as well. The build I have for PizzaGiver is still working so that's why I haven't updated the module since something broke between then and now.

I am thinking it might be a difference on Domino's side but I haven't been able to spot anything different.

Madeline Cameron
@madelinecameron
I looked at the new Address and I don't think this makes it make more sense for less experienced dev. I notice that there is an init function now which is quite nice but personally I don't think it makes the code clearer or is there a performance / other boost that this technique benefits from. I don't mean to be rude, just wondering.
Also, I was under the impression enumerable meant iterable (basically) so I am kind of lost on what that does. I can't find any references for that on Google.
Brandon Nozaki Miller
@RIAEvangelist

Primary benefits are that all Class methods are defined up front in a single location, made writable or not, enumerable or not, all share the same scope, and have somewhat private features. Biggest thing is easily maintained scope.

Also, I suppose it stands to say that defining like this is as close to an oop class as you can get, while prototype is well, prototypical. You can extend a single child, or all future children this way without having cowboy coding.

Prototype gets a lot of jr devs in trouble hiding, mutating and confusing objects and methods in complex situations.

Thern again, that's just my experience.
I havent looked at the pricing yet, only Address incase you were working on any of the others.
Once Harmony is officially supported should be easy to port over to the new ECMA Script 6 Class too
Brandon Nozaki Miller
@RIAEvangelist
Also gives control over enumerable methods etc. for lik for in loops Object.keys etc.
Brandon Nozaki Miller
@RIAEvangelist
Also, I was thinking maybe we should make the delivery method a var instead of always needing to pass a string. What do you think? This way users don't have to worry about capitalization etc? not sure if it makes a difference though.
Brandon Nozaki Miller
@RIAEvangelist

was curious about performance so I ran a test. Seems that over thousands of iterations the Object.define is always just slightly faster, like so minimally it may as well be no difference slightly.

console.time('prototype');
var objects=[];

var MyClass=function(paramaters){
    this.ID=paramaters.ID
}

MyClass.prototype.getInfo=function(callback) {
    if( !this.ID || !callback){
        if(callback)
            callback(
                {
                    success: false,
                    message: 'A callback is required to get store info'
                }
            );
        return;
    }
    callback(
        {
            success: true,
            message: this.ID
        }
    );
}

for(var i=0;i<2000;i++){
    objects.push(new MyClass({ID:i+1}));
    var current=objects[objects.length-1];
    for(var j=0; j<5000; j++){
        current.getInfo(
            function(data){
                if(!data.success){console.log(data)}
            }
        )
    }
}

objects=[];

console.timeEnd('prototype');

//case sensitive differences

console.time('class');
var oBjects=[];

function Myclass(paramaters){
    Object.defineProperties(
        this,
        {
            ID:{
                value:paramaters.ID
            },
            getInfo:{
                value:getInfo
            }
        }
    );

    function getInfo(callback){
        if( !this.ID || !callback){
            if(callback)
                callback(
                    {
                        success: false,
                        message: 'A callback is required to get store info'
                    }
                );
            return;
        }
        callback(
            {
                success: true,
                message: this.ID
            }
        ); 
    }
}

for(var i=0;i<2000;i++){
    oBjects.push(new Myclass({ID:i+1}));
    var current=oBjects[oBjects.length-1];
    for(var j=0; j<5000; j++){
        current.getInfo(
            function(data){
                if(!data.success){console.log(data)}
            }
        )
    }
}

oBjects=[];

console.timeEnd('class');

I ran it several times to check.

VM122:43 prototype: 7084.202ms
VM122:97 class: 6936.807ms

VM123:43 prototype: 7205.583ms
VM123:97 class: 7152.946ms

VM125:43 prototype: 7193.067ms
VM125:97 class: 7158.549ms

VM127:43 prototype: 7342.147ms
VM127:97 class: 7233.754ms

VM126:42 prototype: 7185.525ms
VM126:96 class: 7164.016ms

When I removed the calls to methods, and ONLY initialized the Class and prototype, prototype was faster.

console.time('prototype');
var objects=[];

var MyClass=function(paramaters){
    this.ID=paramaters.ID
}

MyClass.prototype.getInfo=function(callback) {
    if( !this.ID || !callback){
        if(callback)
            callback(
                {
                    success: false,
                    message: 'A callback is required to get store info'
                }
            );
        return;
    }
    callback(
        {
            success: true,
            message: this.ID
        }
    );
}

for(var i=0;i<2000;i++){
    objects.push(new MyClass({ID:i+1}));

}

objects=[];

console.timeEnd('prototype');

//case sensitive differences

console.time('class');
var oBjects=[];

function Myclass(paramaters){
    Object.defineProperties(
        this,
        {
            ID:{
                value:paramaters.ID
            },
            getInfo:{
                value:getInfo
            }
        }
    );

    function getInfo(callback){
        if( !this.ID || !callback){
            if(callback)
                callback(
                    {
                        success: false,
                        message: 'A callback is required to get store info'
                    }
                );
            return;
        }
        callback(
            {
                success: true,
                message: this.ID
            }
        ); 
    }
}

for(var i=0;i<2000;i++){
    oBjects.push(new Myclass({ID:i+1}));

}

oBjects=[];

console.timeEnd('class');

VM143:35 prototype: 8.667ms
VM143:82 class: 10.209ms

VM358:35 prototype: 6.140ms
VM358:82 class: 18.715ms

VM361:35 prototype: 3.849ms
VM361:82 class: 9.515ms