Tutorials for my new contractor
-
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
vsimplements
and why I made the base classabstract
** . 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
-
-
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
andimplements
-
I last did Java a decade ago, but I'm pretty sure- oh, @hungrier got there first
-
It's Java. I was interrupted four times typing that post, my brain's a bit scattered
-
extends
vsimplements
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
extend
ed class, and the rest like itimplements
ed it. (This class was, of course, aList<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...
-
In Java it's
extends
andimplements
Yeah,
inherits
is VB.Net, so perhaps that was a Freudian slip on @Yamikuronue's part?
-
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.
-
This class was, of course, a List<IrcUser>
There's no class in
java.util
namedList<T>
.
-
Not sure if troll or....
-
-
He's being technical because it's an interface and not a class...
-
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.
-
@Tsaukpaetra said:
This class was, of course, a List<IrcUser>
There's no class in
java.util
namedList<T>
.Of course not, @Tsaukpaetra said his class was a
List<IrcUser>
. Nowhere did he sayList<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
-
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.
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 wasdoingpretending 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.
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 thenew
keyword is specified, the compiler will issue a warning and the method in the derived class will hide the method in the base class.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 aList<IrcUser>
that is really anIrcUsers
, it will call the version of the method fromIrcUsers
. With thenew
method, it will not... it will call theList<T>
version instead.Filed under: The real WTF is still inventing your own
List<T>
implementation
-
...you're in a thread whose subject is Java talking about a class that happens to have the same name as a Java interface.
Yeah, my attempts a derailing are... misguided, at best.Not surprisingly, at least three different people assumed you were talking about Java because of it.
Clearly I am still a grasshopper.
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...
-
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 aList<IrcUser>
that is really anIrcUsers
, it will call the version of the method fromIrcUsers
. With thenew
method, it will not... it will call theList<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.
-
...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.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 anAdd
method in your collection).