Results 1 to 4 of 4
  1. #1
    Diargg is offline Senior Member
    Join Date
    Feb 2012
    Posts
    117
    Rep Power
    0

    Default Arguments for/against rewriting API classes/methods?

    Not sure if this is the right place for this. Please move this if necessary.

    So one of my (student) peers has started yet another project in Java. He sometimes comes to me with questions about his code. He's coded for a few (2?) years now, in Java, but seems to be willfully unaware of the classes and methods available in the core Java API. Thus, his projects end up with several classes that reproduce all the behavior of pre-existing code, especially in graphics. So far I've seen code that reproduces Shape, Rectangle (extends "Shape"), Point, and others, all with less functionality and less efficiency than the standard. He uses Java.util.List at least.

    These projects are personal projects only - there's no maintainability aspect here, only the matter of time/effort spent coding, and the effect this will have on his coding abilities in the future (since he's not learning anything about the assumed standards of coding). He claims that when he gets a "real job" coding, he'll just learn the API, since "it's not that hard".

    How/should I convince him to use the pre-existing code available to him? Would his way benefit him in the long run since he's recreated the code he'd use in the future (and thus might have a better understanding of the low level mechanics?)

    Should I just give him the help he asks for when he comes to me, thereby propagating his code style, or should I try to show him where it's been done before?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Arguments for/against rewriting API classes/methods?

    An employer will be more interested in someone that already knows the API, rather than someone who has decided to learn on the job (ie on the employers time).
    Indeed, API questions (general ones) do come up in many interviews.
    Knowing how to navigate the API is also an important skill (see how many times we point people to that document on here).
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default Re: Arguments for/against rewriting API classes/methods?

    Maybe your friend suffers from the NIH syndrome (Not Invented Here) so he writes everything himself. Sun (now Oracle) had lots of people working on the classes in the code SE set; it's much to much to do yourself (as you already noticed on the code your friend wrote). The NIH syndrome isolates you from the rest of the world. If you have good reasons you can critisize those 'standard' classes and maybe 'they'll even listen ... otherwise 'go with the flow' and use those standard classes.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    rfq
    rfq is offline Member
    Join Date
    Mar 2012
    Location
    Novosibirsk, Russia
    Posts
    15
    Rep Power
    0

    Default Re: Arguments for/against rewriting API classes/methods?

    Quote Originally Posted by Diargg View Post
    Should I just give him the help he asks for when he comes to me, thereby propagating his code style, or should I try to show him where it's been done before?
    Tell him that if he use standard library, the code size to maintain become less and he could do more improvements in his code. The time spent on his home-grown libraries is lost, as no one would reuse them.

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. passing arguments to other methods
    By popeyito18 in forum New To Java
    Replies: 2
    Last Post: 07-02-2011, 11:01 PM
  3. Help: Methods and Arguments
    By whateverme in forum New To Java
    Replies: 5
    Last Post: 12-12-2010, 12:14 AM
  4. Classes and Methods help
    By border9 in forum New To Java
    Replies: 5
    Last Post: 01-30-2009, 06:51 PM
  5. url rewriting
    By jithan in forum Java Servlet
    Replies: 2
    Last Post: 06-23-2008, 06:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •