Skip to content

Remove redundant legacy code and improve overall consistency #262

Open

Description

@sizzlemctwizzle

My haphazard design decisions during initial development combined with the enhancements of @Zren have left the code base full of redundancies and inconsistencies. The current state of the code is borderline incoherent. I doubt anyone other than @Zren and myself have any clue how things are structured.

The solution is to remove all redundant legacy code and to make all existing code conform to the same pattern. This includes finishing the discussion software since its lack of the ability to be voted, flagged, and removed is inconsistent. The voting and flagging routines need to be modified to match removal (since that was the last one I implemented, it's the most well formed). These routes will be converted to POST routes and accessed via Ajax on the client-side.

This issue needs to be resolved before we can move forward so added the blocking label (also I'll be changing things all over the code base and we don't want to run into merge conflicts). Please refer to our contributing documentation for specific information on the meaning of that label.

Although I've assigned myself to this issue, I'll be pushing a branch to this repo called issue-262. If anyone wants to help out, just mirror this branch on your own repo and let me know about any changes you want me to pull in the comments here.

Activity

  1. Martii commented on Jul 13, 2014

    @Martii
    Member

    Agreed... I'm lost. I have no clue how to do certain things. I have no problems redoing any snippets I've done but it's really difficult to figure out what to use and where. Part of my skill set is reverse engineering but I'm at a loss at this time.

    Applies to:

  2. sizzlemctwizzle commented on Jul 13, 2014

    @sizzlemctwizzle
    MemberAuthor

    it's really difficult to figure out what to use and where.

    Definitely. Even I struggle sometimes, which says something about the current state of affairs.

  3. Martii commented on Jul 13, 2014

    @Martii
    Member

    If I could make one request... when declaring function arguments... please use aIdentifierName the a indicates that it's part of an argument in a function.. that makes code inherently easier to read (including without having to scroll all the way up to the function declaration and then back down) ... also allows intermediates to be defined if we need them with a non-a-prefixed identifier name. Doesn't have to be all at once if you don't want to but it sure would help.

  4. sizzlemctwizzle commented on Jul 13, 2014

    @sizzlemctwizzle
    MemberAuthor

    That sounds good. I also plan on doing some rough documentation of the design as I go through the code. I'll put it in our wiki. But don't expect something grand since I'm focusing on the code.

  5. Martii commented on Jul 13, 2014

    @Martii
    Member

    Well documentation is a forte of mine so I can wiki assist for sure.... even if it's something as simple/similar as $ npm ls output to show our objects and methods/properties I could at least figure out what to use and where.

  6. added this to the #262 milestone on Jul 13, 2014
  7. jerone commented on Jul 13, 2014

    @jerone
    Contributor

    +1 on the global idea.
    Will there be a list of things that requires addressing?
    Can I also suggest using more of the Promises pattern (Promises/A+ support?).

  8. Martii commented on Jul 13, 2014

    @Martii
    Member

    That's a good idea @jerone but I also usually see a lot of promises not fulfilled in my browser console quite often, even from Add-ons, and not sure if we want to do this at this stage of a refactor... IDK for sure.... also does V8 via node.js support these? They are relatively new.

  9. sizzlemctwizzle commented on Jul 13, 2014

    @sizzlemctwizzle
    MemberAuthor

    Can I also suggest using more of the Promises pattern

    I hate promises. They're a sloppy way to deal with asynchronous code imo. I prefer the async library. We just need to make sure that all callback functions conform to the (err, results) pattern (with both being either an object or null), which some don't atm.

    Will there be a list of things that requires addressing?

    I've created a milestone for this blocking issue, and I know there are several other related issues can be attached to this milestone as well. You can propose others that don't already exist if you feel they fit within the goals of this issue. I'll probably create some of my own as I encounter things that need discussion.

    I'll begin my initial work (planning) tonight and report my progress. I seem to do my best work when the sun goes down.

  10. Martii commented on Jul 13, 2014

    @Martii
    Member

    I seem to do my best work when the sun goes down.

    hehe me too.

  11. Zren commented on Jul 13, 2014

    @Zren
    Contributor

    If anything, removal should confirm to flagging rather than the other way around. That way it's just a boolean on off to undo a removal.

  12. 55 remaining items

  13. added a commit that references this issue on Mar 13, 2016
  14. added a commit that references this issue on Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementSomething we do have implemented already but needs improvement upon to the best of knowledge.soonerSooner would be appreciated.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions