Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31
Like Tree5Likes

Thread: DNA class- bioinformatics(

  1. #21
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,515
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Nazneen Ali View Post
    Fortanesque??
    What does that mean?
    Fortran-like; Fortran is/was an ancient programming language, now only understood by dinosaurs like me ;-) it had not many features and the features that it had are laughable.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  2. #22
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    "Made the privates private."
    Does that matter when our program contains only one class?
    No, exposing privates is fine. But many people are in the habit of hiding them anyway, just in case.
    In OOP you try to be consious of what needs to be exposed.
    Most code is ment to become part of a bigger program, so why not do it right from the start. It also stands out more in your code, but that is a matter of taste and/or readability.
    Last edited by Jodokus; 08-01-2011 at 12:51 PM. Reason: I was too slow. Jos was first.
    No bug ever had to calculate its fitnessfunction.

  3. #23
    Nazneen Ali is offline Senior Member
    Join Date
    Jul 2011
    Posts
    112
    Rep Power
    0

    Default

    @Jos: OK :))

    Yeah I have heard about Fortran, but its nothing more than the name of the language that I know about... But thanks for adding a new word to my vocabulary ;-)
    Last edited by Nazneen Ali; 08-01-2011 at 12:57 PM.
    Don't forget to smile :-)

  4. #24
    Nazneen Ali is offline Senior Member
    Join Date
    Jul 2011
    Posts
    112
    Rep Power
    0

    Default

    No, exposing privates is fine. But many people are in the habit of hiding them anyway, just in case.
    In OOP you try to be consious of what needs to be exposed.
    Most code is ment to become part of a bigger program, so why not do it right from the start. It also stands out more in your code, but that is a matter of taste and/or readability.
    Isn't private the default access modifier in java?
    Don't forget to smile :-)

  5. #25
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    Isn't private the default access modifier in java?
    No. Without modifier you have ""package visibility". All classes in the same package can read/write those fields.
    No bug ever had to calculate its fitnessfunction.

  6. #26
    Nazneen Ali is offline Senior Member
    Join Date
    Jul 2011
    Posts
    112
    Rep Power
    0

    Default

    @Jodokus: Ok :-)
    Thanks alot :-)
    Don't forget to smile :-)

  7. #27
    Nazneen Ali is offline Senior Member
    Join Date
    Jul 2011
    Posts
    112
    Rep Power
    0

    Default

    Most code is ment to become part of a bigger program, so why not do it right from the start.
    But how shall I know what has got to be private, public or protected unless I have another class which is a friend, subclass or neither, of the main class. I mean how can I know what modifier to use prior to having a class whose access has to controlled?
    Don't forget to smile :-)

  8. #28
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,515
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Nazneen Ali View Post
    But how shall I know what has got to be private, public or protected unless I have another class which is a friend, subclass or neither, of the main class. I mean how can I know what modifier to use prior to having a class whose access has to controlled?
    You don't know that so start by making all members/properties private.You can always change it later (if needed).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #29
    Nazneen Ali is offline Senior Member
    Join Date
    Jul 2011
    Posts
    112
    Rep Power
    0

    Default

    That big blob of code (in green) is simply a mapping from an encoding triplet to an amino acid; why don't you first fill a Map with the encoding triplets and their associated amino acid and simply do something like this:

    Code:
    String triplet= ...;
    String amino= ecodingMap.get(triplet);
    if (amino != null)
    al.append(amino);
    kind regards,

    Jos

    Well I had misunderstood your post because I was completely unaware of the Map interface in java. I am reading have read that " each key can map to at most one value." at
    XML Code:
    http://download.oracle.com/javase/6/docs/api/java/util/Map.html
    But I have amino acid which are encoded by more than one triplet. So I have got confused.
    Don't forget to smile :-)

  10. #30
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    each key can map to at most one value
    You use triplets to find aminoacids, not the other way around.
    Maybe later you try to reconstruct chromosomes from phenotype, but for the moment you follow nature:
    chromosomes -> proteins -> phenotype.

    An other small remark: don't edit previous posts in a way that the thread becomes illogical for later readers. For instance, the "green blob" is not green anymore, so how could historians/anthropologists in a few hundred years reconstruct what Jos was talking about?
    No bug ever had to calculate its fitnessfunction.

  11. #31
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    Quote Originally Posted by Nazneen Ali View Post
    Fortanesque??
    What does that mean?
    IE: As with the computer programming language called "FORTRAN" (FORmula TRANslation). (It's kind of a little like BASIC.)

    The relevant issue is that FORTRAN does not have Map classes. Nor does it have collection classes. Really, it doesn't have classes. Everything is done with arrays.

    FORTRAN is one of the two oldest high level computer programming languages. (The other is COBOL.)
    Nazneen Ali likes this.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: 03-27-2011, 05:49 AM
  2. Replies: 5
    Last Post: 01-26-2011, 06:38 PM
  3. Replies: 8
    Last Post: 04-14-2010, 05:49 AM
  4. Replies: 7
    Last Post: 05-06-2009, 12:42 PM
  5. Replies: 8
    Last Post: 03-21-2009, 09:34 AM

Tags for this Thread

Posting Permissions

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