Can't change vars in JSON after consolidating lists into one

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #16
    :) you pick the sentences from my post as you like ... nope ... you did well ... but using oop is always a good idea, even when you don't benefit from it yet you will do in the future ... believe me ... ;) it is a little bit more to do at the start of a project in case you would have to learn it meanwhile ... but in case you have it done ... you'll ask yourself: why didn't i use js oop before? ... the answer is: most people don't know about the very cool javascript that is a very underestimated programming language ... and they use it the script-kiddies cut&paste way ... and don't know about the concepts ... its good, because people have a quick success with their projects ... but its bad when someone has to maintain that snippet-like-code ...

    there are very little good js-tutorials out there so most people that have a strong interest in javascript ... mostly the ones that are trying to build strict ajax applications ... have to learn it the hard way ... especially when using one of those ajax-frameworks out there you have to have a look at the js-core concepts to understand the frameworks and to be able to adapt things the way you need ...

    i'm convinced that you'll do well ... and in case you have any questions pm me or post in the forum ... btw: interesting approach for your project ... keep up to let me know how it goes on :)

    kind regards

    Comment

    • RMWChaos
      New Member
      • Oct 2007
      • 137

      #17
      Okay, YES, I have heard of Object Oriented Programming before, but not exactly what that means or what it does--my background is in BASIC and COBOL, which are not OOP languages. Just in reading the explanation of what OOP is, I can already tell it is essentially what I was trying to accomplish with my "modular" code, and what you have been urging me to do all along with util-methods.

      So I think you are correct, OOP is going to be a very good method of programming for me to understand and use.

      What I really need here, though, are better code examples. I need real-world examples of the explanations that I am reading so that I can fully appreciate their meaning. That's how I've learned everything else I know about JS so far.

      Will get back to you when I know more.

      Comment

      • RMWChaos
        New Member
        • Oct 2007
        • 137

        #18
        Head spinning, brain hemorrhaging, losing all knowledge of programming...J ava-what? What's a script?

        Ugh.

        Just had a crash-course in OOP, refactoring, and many, Many, MANY other concepts. Now what to do with it all...

        Refactoring if conditional statements with polymorphism is a good thing!? AH!!!

        I think you are testing my fortitude.

        Comment

        • RMWChaos
          New Member
          • Oct 2007
          • 137

          #19
          Now to be controversial, I'm not yet convinced that OOP and refactoring are the best ways to program. (Don't laugh at my naiveté!)

          What I mean is that I see the benefits to OOP and refactoring as they apply to maintaining code, particularly as code grows to huge proportions. So it is good for developers to read, share, and modify.

          However, I am not sure that OOP and refactoring are good for code functionality. Does OOP/refactored programming run "faster" or more efficiently than procedural/structured programming? Does a machine really care one way or the other?

          If the answer is, yes, oop/refactored programming is "faster" and/or more efficient to run than procedural/structured programming, then okay, I am sold. However, if the only benefit is to the developers, then I say no, I want another way to do this.

          I know there are refactoring programs such as Bicycle Repair Man, which refactor code based on agile methodologies, but are their programs that do precisely the opposite: take refactored code and "optimize" it for runtime efficiency?

          Writing code for human readability is essential, I agree, and minifying the code reduces its download footprint. But OOP and refactoring seem to me to potentially increase code length in some cases and create more functions that must be loaded into the global scope. I know we argued about this previously. Using util-methods decreases the chance for redundancy, and I agree with that. However, if the code is and always will pertain to a specific constructor or object, what is the benefit of splitting it out other than readability? Here is the classic human-vs.-computer needs, and is why we compile code from what a human understands to machine code.

          Then again, perhaps this is just my flawed and incomplete understanding of OOP and refactoring. Or just the fact that it's 2:30 in the morning. 8-}

          In any case, I must restate my goals, which at the moment appear to be in conflict: I want modular and fast/efficient code. OOP and refactoring meet the modular requirement, but do they impede, enhance, or have no effect on the fast/efficient requirement? If the answer is either "enhance" or "have no effect on", then I am all for OOP and refactoring.

          Comment

          • RMWChaos
            New Member
            • Oct 2007
            • 137

            #20
            Well, this answer is ambiguous:
            Some people may argue that certain compilers like SmallEiffel convert polymorphic calls into conditionals and that conditionals are faster and better than polymorphic calls. From a technical side it should be noticed that with polymorphic methods, the number of classes will not impact the performance whereas with nested conditionals the more classes that have to be type-checked, the more penalty you get. Then, although it is really justified for compilers to transform the code into faster forms — this is mainly why they exist, still this is not a justification to code like a compiler. The code we write is intended for developers, that’s why it should be readable, support abstraction and be more maintainable.

            All this tells me is that there is still a need for "developer viewable code" and "runtime code." I am willing to script in the former, but I want my scripts to run in the latter.

            Comment

            Working...