Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Dynamic typing

Dynamic typing

Scheduled Pinned Locked Moved The Lounge
databasecsharpc++javascriptpython
30 Posts 21 Posters 0 Views 1 Watching
  • 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.
  • N Nemanja Trifunovic

    For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


    Programming Blog utf8-cpp

    J Offline
    J Offline
    Jimmanuel
    wrote on last edited by
    #9

    For Perl: use strict; This forces you to "declare" variables before usage.

    1 Reply Last reply
    0
    • M Marc Clifton

      I'm still trying to figure out how the "pubic" attribute affects method access. Marc

      Thyme In The Country
      Interacx

      People are just notoriously impossible. --DavidCrow
      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #10

      Marc Clifton wrote:

      how the "pubic" attribute affects method access

      I think it is synonymous with private access.


      Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website

      1 Reply Last reply
      0
      • N Nemanja Trifunovic

        For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


        Programming Blog utf8-cpp

        N Offline
        N Offline
        NealAB
        wrote on last edited by
        #11

        The problem is that you want static typing and hard syntax rules about 97% of the time. But occasionally you crave the fluid freedom of dynamic typing, usually in high-level abstract pattern-like situations. And once in a very great while you even need an interpreter, so you can construct and run snippets of code from within your program. But usually you want strict and static typing; you know you're a bad boy and cannot be trusted.

        M 1 Reply Last reply
        0
        • M Marc Clifton

          I'm still trying to figure out how the "pubic" attribute affects method access. Marc

          Thyme In The Country
          Interacx

          People are just notoriously impossible. --DavidCrow
          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

          D Offline
          D Offline
          Douglas Troy
          wrote on last edited by
          #12

          Not sure, but I bet if you use the wrong method, it'll throw an access violation exception but quick ... :rolleyes:


          :..::. Douglas H. Troy ::..
          Bad Astronomy |VCF|wxWidgets|WTL

          1 Reply Last reply
          0
          • N Nemanja Trifunovic

            For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


            Programming Blog utf8-cpp

            D Offline
            D Offline
            Dario Solera
            wrote on last edited by
            #13

            Nemanja Trifunovic wrote:

            For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...)

            I don't like them because they are not strongly typed.

            ________________________________________________ Personal Blog [ITA] - Tech Blog [ENG] - My Photos ScrewTurn Wiki 2.0.2

            B 1 Reply Last reply
            0
            • N Nemanja Trifunovic

              For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


              Programming Blog utf8-cpp

              N Offline
              N Offline
              NormDroid
              wrote on last edited by
              #14

              Snytax Errors, that's VB and gay.

              .net is a box of never ending treasures, every day I get find another gem.

              L 1 Reply Last reply
              0
              • M Marc Clifton

                I'm still trying to figure out how the "pubic" attribute affects method access. Marc

                Thyme In The Country
                Interacx

                People are just notoriously impossible. --DavidCrow
                There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                T Offline
                T Offline
                Todd Smith
                wrote on last edited by
                #15

                #define private public my favorite C++ hack

                Todd Smith

                M 1 Reply Last reply
                0
                • N NealAB

                  The problem is that you want static typing and hard syntax rules about 97% of the time. But occasionally you crave the fluid freedom of dynamic typing, usually in high-level abstract pattern-like situations. And once in a very great while you even need an interpreter, so you can construct and run snippets of code from within your program. But usually you want strict and static typing; you know you're a bad boy and cannot be trusted.

                  M Offline
                  M Offline
                  Marc Clifton
                  wrote on last edited by
                  #16

                  I must live on another planet. I frequently want to construct and run snippets of code within my program, I'm always craving the fluid freedom of dynamic typing because I use high-level abstraction, and 3% of the time I'm wanting strong typing. :sigh: Clearly, I'm at odds with the approved approaches for programming! :-D Marc

                  Thyme In The Country
                  Interacx

                  People are just notoriously impossible. --DavidCrow
                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                  N S 2 Replies Last reply
                  0
                  • N NormDroid

                    Snytax Errors, that's VB and gay.

                    .net is a box of never ending treasures, every day I get find another gem.

                    L Offline
                    L Offline
                    l a u r e n
                    wrote on last edited by
                    #17

                    :laugh:

                    "there is no spoon" {me}

                    N 1 Reply Last reply
                    0
                    • T Todd Smith

                      #define private public my favorite C++ hack

                      Todd Smith

                      M Offline
                      M Offline
                      Miszou
                      wrote on last edited by
                      #18

                      I think Mr. Mackay[^] best summarises my thoughts on this.


                      Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page

                      1 Reply Last reply
                      0
                      • B Bassam Abdul Baki

                        No need to yell. Use your inner VB voice. :) However, as Austin Powers would say, yeah baby! :-D


                        "You can lead a horse to Vista, but it won't get in stall." - Bassam Abdul-Baki Web - Blog - RSS - Math - LinkedIn - BM

                        C Offline
                        C Offline
                        Chris Losinger
                        wrote on last edited by
                        #19

                        Bassam Abdul-Baki wrote:

                        No need to yell.

                        you have to be forceful when casting the Spell of Explicitude. otherwise, the magic doesn't work, and you might turn your computer into a toaster. haven't you ever read a Harry Potter book?

                        image processing toolkits | batch image processing | blogging

                        C B 2 Replies Last reply
                        0
                        • N Nemanja Trifunovic

                          For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


                          Programming Blog utf8-cpp

                          V Offline
                          V Offline
                          Virtual Coder
                          wrote on last edited by
                          #20

                          Nemanja Trifunovic wrote:

                          For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.

                          That's the price you pay for the flexibility of 'dynamic' languages. No risk, no fun!

                          1 Reply Last reply
                          0
                          • C Chris Losinger

                            Bassam Abdul-Baki wrote:

                            No need to yell.

                            you have to be forceful when casting the Spell of Explicitude. otherwise, the magic doesn't work, and you might turn your computer into a toaster. haven't you ever read a Harry Potter book?

                            image processing toolkits | batch image processing | blogging

                            C Offline
                            C Offline
                            Clickok
                            wrote on last edited by
                            #21

                            Chris Losinger wrote:

                            you have to be forceful when casting the Spell of Explicitude. otherwise, the magic doesn't work, and you might turn your computer into a toaster. haven't you ever read a Harry Potter book?

                            Microsoft have tried this in Windoes 3.11, but get a lot of flying toasters... :-D [edit] Ops, look that who have the credits is AfterDark[^] and not Microsoft. [/edit]


                            Engaged in the learning of English grammar. ;)
                            For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16) :badger:

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              I must live on another planet. I frequently want to construct and run snippets of code within my program, I'm always craving the fluid freedom of dynamic typing because I use high-level abstraction, and 3% of the time I'm wanting strong typing. :sigh: Clearly, I'm at odds with the approved approaches for programming! :-D Marc

                              Thyme In The Country
                              Interacx

                              People are just notoriously impossible. --DavidCrow
                              There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                              People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                              N Offline
                              N Offline
                              Nathan Addy
                              wrote on last edited by
                              #22

                              Marc Clifton wrote:

                              I frequently want to construct and run snippets of code within my program

                              What's your experience with these techniques? Do you have a lot of success getting these systems working and robust? Those kinds of techniques always have had a kind of perverse fascination with me, but it always seemed to be a dangerous road. In all of those situations, you're just representing actions with syntax (the word "cp" implies the action "to copy a file"), with the idea being that you can represent arbitrarily defined actions as a collection of software instructions. But that always seemed to be potentially difficult. Imagine the relative challenge of something like 'edit the first part of the second action so that it works on directory foo instead of bar...' in the code "cp thisFile thatFile; mkdir foo/ && rm thatFile ; date". (a pretty contrived example). Because of that, it has always seemed like it's better to represent this as something like a virtual event class, that has a single execute method. Then you can do the same thing (in all the examples I've thought of anyway) by representing would would be some code that needs to be interpreted as the execution of objects that represent programming commands in your code. You're essentially building your own virtual machine for code execution, instead of using your programming environment directly. Every time I think about it, that level of abstraction always seems like it might really save me trouble. What is your experience with it? Any pitfalls or gotchas to look out for? Is it a workable design technique?

                              1 Reply Last reply
                              0
                              • N Nemanja Trifunovic

                                For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


                                Programming Blog utf8-cpp

                                S Offline
                                S Offline
                                Shog9 0
                                wrote on last edited by
                                #23

                                Try to avoid scenarios where the code won't fail badly if you misspell a name. Then test. Everything. Repeatedly. That said... i've still been bitten by this once or twice. Expandos are the devil.

                                ----

                                It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.

                                --Raymond Chen on MSDN

                                A 1 Reply Last reply
                                0
                                • M Marc Clifton

                                  I must live on another planet. I frequently want to construct and run snippets of code within my program, I'm always craving the fluid freedom of dynamic typing because I use high-level abstraction, and 3% of the time I'm wanting strong typing. :sigh: Clearly, I'm at odds with the approved approaches for programming! :-D Marc

                                  Thyme In The Country
                                  Interacx

                                  People are just notoriously impossible. --DavidCrow
                                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                  S Offline
                                  S Offline
                                  Stuart Dootson
                                  wrote on last edited by
                                  #24

                                  Marc Clifton wrote:

                                  I'm always craving the fluid freedom of dynamic typing because I use high-level abstraction

                                  Or the freedom of type inferencing and parametric polymorphism - they can amount to similar things when static typing's done well.

                                  1 Reply Last reply
                                  0
                                  • C Chris Losinger

                                    Bassam Abdul-Baki wrote:

                                    No need to yell.

                                    you have to be forceful when casting the Spell of Explicitude. otherwise, the magic doesn't work, and you might turn your computer into a toaster. haven't you ever read a Harry Potter book?

                                    image processing toolkits | batch image processing | blogging

                                    B Offline
                                    B Offline
                                    Bassam Abdul Baki
                                    wrote on last edited by
                                    #25

                                    Chris Losinger wrote:

                                    haven't you ever read a Harry Potter book?

                                    I only see the pictures. :)


                                    "If only one person knows the truth, it is still the truth." - Mahatma Gandhi Web - Blog - RSS - Math - LinkedIn - BM

                                    1 Reply Last reply
                                    0
                                    • S Shog9 0

                                      Try to avoid scenarios where the code won't fail badly if you misspell a name. Then test. Everything. Repeatedly. That said... i've still been bitten by this once or twice. Expandos are the devil.

                                      ----

                                      It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.

                                      --Raymond Chen on MSDN

                                      A Offline
                                      A Offline
                                      Andy Brummer
                                      wrote on last edited by
                                      #26

                                      Shog9 wrote:

                                      Expandos are the devil.

                                      That's the one time I ever thought case insensitivity would be a help. One of the few cases where 2 wrongs would equal 2 and a half lefts.

                                      1 Reply Last reply
                                      0
                                      • N Nemanja Trifunovic

                                        For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...): how do you deal with typos? I misspelled a table name in a SQL query ("tranlsation" instead of "translation" :-O ) and spent almost 15 minutes trying to figure out why I get no results. If I do that in a statically typed language, the compiler just throws the syntax error right into my face.


                                        Programming Blog utf8-cpp

                                        B Offline
                                        B Offline
                                        Bradml
                                        wrote on last edited by
                                        #27

                                        What language were you using?


                                        Brad Australian - unknown PHP Developer on "Job Prospect" Requirement: * Experience working with XML, XSL, XPath Comment: and other things starting with X.

                                        1 Reply Last reply
                                        0
                                        • D Dario Solera

                                          Nemanja Trifunovic wrote:

                                          For the people who like dynamic programming languages (Python, Ruby, JavaScript, PHP, Perl...)

                                          I don't like them because they are not strongly typed.

                                          ________________________________________________ Personal Blog [ITA] - Tech Blog [ENG] - My Photos ScrewTurn Wiki 2.0.2

                                          B Offline
                                          B Offline
                                          Bradml
                                          wrote on last edited by
                                          #28

                                          You know that you can set a variable type in php right?


                                          Brad Australian - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.

                                          D 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups