sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Is This Lazy?

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 671 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      Jim
      last edited by

      Is this an acceptable idiom when using Ruby, or just being lazy? Other than not "seeming" right, is there a down-side?

      
      begin
        Sketchup.active_model.start_operation("Op", true)
      rescue ArgumentError
        Sketchup.active_model.start_operation("Op")
      end
      
      

      Hi

      1 Reply Last reply Reply Quote 0
      • A Offline
        avariant
        last edited by

        There will most likely be some performance hit, but it's not likely to be significant. My personal opinion is that if it is reasonable to code the appropriate "if" conditions (like version number), you are better off doing that. For a simple issue like this, probably irrelevant; for more complex code, you'll want to be more careful.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement