• Lucid Dreaming - Dream Views




    Results 1 to 25 of 28
    Like Tree2Likes

    Thread: Ask me about Python

    Threaded View

    1. #8
      Rational Spiritualist DrunkenArse's Avatar
      Join Date
      May 2009
      Gender
      Location
      Da Aina
      Posts
      2,941
      Likes
      1092
      Quote Originally Posted by ninja9578 View Post
      No I wasn't; I was demonstrating how C++ programmers use the predictable behavior of when destructors get called. If there is garbage collection, you have no idea when destructors get called, so you can't use them the way you can in C++.
      What I don't get is why C++ programmers always insist that if you can't accomplish something the way that you do in C++ then it's not as good. I've literally had someone try to tell me that C++ is more powerful than python because python doesn't have a 'do' loop. One would often use the 'with' statement to have a context manager have code run when exiting a scope as I demonstrated in my example (though it's much more flexible than that)

      Quote Originally Posted by ninja9578 View Post
      BTW, java will never be faster than native code, that's only possible on the SPARC processor.
      Keep telling yourself that. Optimizing code at compile time as pretty much been optimized to it's fullest extent. Optimizing code at runtime using Just In Time compilers has only just started and is theoretically much more promising. And note that I specified long running processes so that the JIT compiler can accumulate enough information to, e.g. do branch prediction superior to what's currently available in hardware.

      Quote Originally Posted by ninja9578 View Post
      Scripting languages should stay on the web because they're portable, real apps will always be written in native compiled code, without garbage collection. The only "real" language that I know that has a garbage collector is C# and Objective C 2.0, and professionals turn it off in both languages.
      You really seem to be hung up on destructors here if you are willing to dismiss an entire class of very expressive and powerful languages for no reason other than that they make destructors useless. I recognize that clever things can be done with them but clever(er) things can also be done with context managers, closures, descriptors, decorators and metaclasses, none of which are offered in C++.

      I'll repeat myself.

      favor C/C++ when you need the speed (and after you know that another language isn't fast enough)
      favor C/C++ when pauses that are (increasingly only theoretically) associated with (modern) garbage collectors is a game killer.
      favor C when you are writing for an embedded system

      in all other cases

      use a modern language, e.g. python, lua, ruby and most of all, Lisp.

      I guess what I'm saying is that (while I may be 5-10 years ahead of schedule) C and C++ are the new assembler languages.
      Last edited by PhilosopherStoned; 10-02-2010 at 04:44 AM.
      Previously PhilosopherStoned

    Similar Threads

    1. Pass Variables Between JavaScript and C++/Python?
      By youssarian in forum Tech Talk
      Replies: 6
      Last Post: 01-12-2010, 04:27 AM
    2. Halp! (Python)
      By ThreeLetterSyndrom in forum Tech Talk
      Replies: 5
      Last Post: 06-23-2009, 09:43 PM
    3. Tell me about Python
      By DuB in forum Tech Talk
      Replies: 9
      Last Post: 04-29-2009, 04:55 PM
    4. Python Reality Check Tester
      By Wesley_Gray in forum Lucid Aids
      Replies: 10
      Last Post: 08-01-2008, 02:16 AM
    5. Fav Python Quotes
      By Mystical_Journey in forum The Lounge
      Replies: 20
      Last Post: 05-12-2005, 09:50 PM

    Bookmarks

    Posting Permissions

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