Dynamic typing
-
I'm still trying to figure out how the "pubic" attribute affects method access. Marc
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#define private public my favorite C++ hack
Todd Smith
-
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.
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
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 -
Snytax Errors, that's VB and gay.
.net is a box of never ending treasures, every day I get find another gem.
:laugh:
"there is no spoon" {me}
-
#define private public my favorite C++ hack
Todd Smith
I think Mr. Mackay[^] best summarises my thoughts on this.
Sunrise Wallpaper Project | The StartPage Randomizer | A Random Web Page
-
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
-
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.
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!
-
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
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: -
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
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 SmithMarc 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?
-
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.
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
-
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
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 SmithMarc 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.
-
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
-
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
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.
-
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.
-
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
-
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.
I didn't know, but I actually don't care.
________________________________________________ Personal Blog [ITA] - Tech Blog [ENG] - My Photos ScrewTurn Wiki 2.0.2
-
:laugh:
"there is no spoon" {me}