Tutorials for my new contractor


  • mod

    My junior-level contractor* prefers videos or hands-on examples over books and articles, and I'm very much a books and articles kind of person. Does anyone have any good resources I can link him to? Today, he needs to learn some basic Java OOP fundamentals asap, as he's quite confused about when to use extends vs implements and why I made the base class abstract** . I found some tutorials on codeacademy.com, are they any good as a resource?

    * He's a junior QA contractor, so he's roughly intern-level in the development department, but he's quite smart and seems to be absorbing new concepts as fast as I can throw them at him

    ** He made ALL his classes abstract, then got compiler errors and ran to me for help



  • @Yamikuronue said:

    extends vs inherits

    What language is this?


  • sockdevs

    @RaceProUK said:

    What language is this?

    looks like Java.

    one is for classes, the other for interfaces.... i think.

    it's been a while since i did java



  • In Java it's extends and implements



  • I last did Java a decade ago, but I'm pretty sure- oh, @hungrier got there first :smile:


  • mod

    It's Java. I was interrupted four times typing that post, my brain's a bit scattered


  • Impossible Mission Players - A

    @Yamikuronue said:

    extends vs implements

    Well, that would certainly have come in handy if the original programmer of the IRC chat client I cloned knew this.

    Half of the IrcUsers class was written like an extended class, and the rest like it implementsed it. (This class was, of course, a List<IrcUser>). Literally a full week of me fiddling with stuff on my side before I decided to check on that code (since it wasn't mine, I assumed it would have been a bit more sane). I saw... some kind of light. Not sure if it was a good one, but it came one in any case...


  • Discourse touched me in a no-no place

    @hungrier said:

    In Java it's extends and implements

    Yeah, inherits is VB.Net, so perhaps that was a Freudian slip on @Yamikuronue's part?


  • mod

    Not quite a VB slip. Mostly a "extends and i--something", followed by "I'm writing about inheritance so I was typing the word inherit" all in my subconscious, spanning an interruption.



  • @Tsaukpaetra said:

    This class was, of course, a List<IrcUser>

    There's no class in java.util named List<T>.


  • Impossible Mission Players - A

    Not sure if troll or....


  • Winner of the 2016 Presidential Election

    @Tsaukpaetra said:

    Not sure if troll or Ben Lubar

    Assume @ben_lubar.



  • He's being technical because it's an interface and not a class...


  • Winner of the 2016 Presidential Election

    At my last job they had a Pluralsight subscription, which I used quite a bit. Decent videos from some well known people, and it ranges from the basics to quite advanced stuff. I don't know how much it costs, or if your company/the contractor is willing to pay for it.



  • @ben_lubar said:

    @Tsaukpaetra said:
    This class was, of course, a List<IrcUser>

    There's no class in java.util named List<T>.

    Of course not, @Tsaukpaetra said his class was a List<IrcUser>. Nowhere did he say List<T> was a class.

    The implication was that it was something like public MyClass implements List<IrcUser>.

    Filed under: The Real WTF is inventing your own List<T> implementation


  • Impossible Mission Players - A

    @powerlord said:

    Of course not, @Tsaukpaetra said his class was a List<IrcUser>. Nowhere did he say List<T> was a class.

    The implication was that it was something like public MyClass implements List<IrcUser>.

    Even though MS seems to indicate it is indeed a class, I wasn't talking about Java anyways. :smiley:

    It's supposed to Extend List<UrcUser>, but then proceeds to ignore that and pretend to implement it (for about half of the class). Unfortunately, this isn't necessarily an error (at least, it wasn't back in VS 2010, when it was written). Even then, it's only a Warning that some of the functions "hide" the functions of the base class.
    It was, in fact, this little warning that got me to investigate it at all, and how I found out what it was doingpretending to do.



  • ...you're in a thread whose subject is Java talking about a class that happens to have the same name as a Java interface.

    Not surprisingly, at least three different people assumed you were talking about Java because of it.

    @Tsaukpaetra said:

    Unfortunately, this isn't necessarily an error (at least, it wasn't back in VS 2010, when it was written). Even then, it's only a Warning that some of the functions "hide" the functions of the base class.

    If neither the override keyword nor the new keyword is specified, the compiler will issue a warning and the method in the derived class will hide the method in the base class.

    -- C# docs on overriding

    TL;DR it assumes the new key word, but complains because the developer omitted it.

    Having said that, there is a difference between the two: override means that if you have a List<IrcUser> that is really an IrcUsers, it will call the version of the method from IrcUsers. With the new method, it will not... it will call the List<T> version instead.

    Filed under: The real WTF is still inventing your own List<T> implementation


  • Impossible Mission Players - A

    @powerlord said:

    ...you're in a thread whose subject is Java talking about a class that happens to have the same name as a Java interface.

    Not surprisingly, at least three different people assumed you were talking about Java because of it.

    Yeah, my attempts a derailing are... misguided, at best.

    Clearly I am still a grasshopper.

    @powerlord said:

    TL;DR it assumes the new key word, but complains because the developer omitted it.
    Yeah, that's what I noticed. Strange it says it applies to VS 2010, not sure how I missed it before the upgrade...



  • @powerlord said:

    Having said that, there is a difference between the two: override means that if you have a List<IrcUser> that is really an IrcUsers, it will call the version of the method from IrcUsers. With the new method, it will not... it will call the List<T> version instead.

    Having said that, there is a difference between the two: override means that if you have a List<IrcUser> that is really an IrcUsers, it will call the version of the method from IrcUsers. With the new method, it will not... it will call the List<T> version instead.

    (I was editing this into my previous post, but you replied before I finished it)



  • Our MSDN comes with a bit of pluralsight, but it's lame. They teach you the absolute basics of lots of things. The only useful ones are the intro to SOLID, the defensive programming course, and the one about C# syntax analyzers.



  • @powerlord said:

    ...you're in a thread whose subject is Java talking about a class that happens to have the same name as a Java interface.

    As silly as Hungarian is, I kind of like the IInterface naming standard for this exact reason.

    @powerlord said:

    Filed under: The real WTF is still inventing your own List<T> implementation

    I've inherited generic collections once or twice, mostly to provide a nice collection initializer for things like List<Tuple<T1, T2, ...>> or some other more complex structure (in C# at least, all you need to have a collection initializer is to have an Add method in your collection).


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.