• (cs) in reply to Bald Rick
    Bald Rick:
    Detritus:
    Cunning Linguist:
    Kempeth:
    2: The whole point of Hungarian Notation was to add information on what a variable is supposed to contain when the type system cannot tell you. Which makes Javascript one of the best possible candidates for it.

    Close, but not quite. Hungarian Notation is poor man's type checking.

    Surely it's simply mans type checking. As opposed to type checking done by a machine.

    What he said.

    It's also called 'being nice to your colleagues' like leaving little visual cues for their 'developer subconscious' as to what that variable buried within several lines of code might hold.

    But hey, why even try to make live a little easier?

    (here come the "if people can't do a simple thing like check the type then they shouldn't be programming" BS comments sighs)

    If it matters that you communicate what type the variable is, then give us a clue by suggesting its type in its name. If it's important that all your variables in your routine need to be immediately transparently clear as to their type, your encapsulation isn't working.

  • anon (unregistered) in reply to genitus
    genitus:
    I don't know VB, so I don't understand this post. I'm not going to contaminate my mind trying to understand it, either.

    One day you will achive mental purity.

  • Bald Rick (unregistered) in reply to Matt Westwood
    Matt Westwood:
    If it matters that you communicate what type the variable is, then give us a clue by suggesting its type in its name.
    er, yeeeesss, that's what Hungarian does.
    Matt Westwood:
    If it's important that *all* your variables in your routine need to be immediately transparently clear as to their type, your encapsulation isn't working.
    Do you want to expand/troll on that?

    Like I said, since it costs nothing to do, it's no bad thing to have helpful hints, especially when looking at someone else's code.

  • ted (unregistered) in reply to dude
    dude:
    Python is pretty awesome because it includes the best of both worlds. It is a dynamic language, but also strongly typed. There is no such thing as a 'cast' in Python. An int is always an int. After using Python, coding in a dynamic language with implicit/automatic casting like PHP or Javascript is like a slap in the face. I've spent much time debugging a problem only to find out it was an incorrect type being automatically casted, where Python would have thrown an exception instead.

    I really wish Javascript had a strongly-typed variant. Dynamic, strongly-typed, closures, prototype inheritance == perfect language for me.

    Strongly-typed. You keep using that word, but I don't think it means what you think it means

  • Ben (unregistered) in reply to Dr Unicorn
    Dr Unicorn:
    But I don't want to "Power Troll" your arse . . .

    Made me laugh out loud when I read that as "power TROWEL". Now reading it as troll just isn't as funny.

  • (cs) in reply to dude
    dude:
    Python is pretty awesome because it includes the best of both worlds. It is a dynamic language, but also strongly typed. There is no such thing as a 'cast' in Python. An int is always an int. After using Python, coding in a dynamic language with implicit/automatic casting like PHP or Javascript is like a slap in the face. I've spent much time debugging a problem only to find out it was an incorrect type being automatically casted, where Python would have thrown an exception instead.

    That's not what "strong typing" means. Your example is about the absolute minimum to count as a "typed" language. Strength, with respect to typing, refers to the expressiveness of the typing language. You see, a "strongly-typed" language is actually two languages: a term language for dealing with values, and a "type language" for expressing types, together with a nice type inference algorithm to let the two languages play together nicely.

    The Howard-Curry isomorphism theorem is worth mentioning here. A typed lambda calculus has two components: the typing language, and a value/term language. The theorem says that for each typed lambda calculus there is an isomorphism between it and some constructive logic, where the type language expressions correspond to theorems in the constructive logic, and value expressions correspond to proofs of these theorems in the logic. So if you can express a property in a type system, you are absolutely guaranteed that any implementation that type checks is correct. Stronger type systems allow you to express more property than "weaker" type systems.

    Some type languages (like Haskell with the UndecidableInstances extension) are Turing complete, so type inference can diverge (not halt). Some (like Haskell without extensions) are decidable, and type inference is guaranteed to terminate at compile time.

  • Bald Rick (unregistered) in reply to dude
    dude:
    Python is pretty awesome because it includes the best of both worlds. It is a dynamic language, but also strongly typed. There is no such thing as a 'cast' in Python. An int is always an int.
    hmmmm, yeah, you see, you don't understand the terms that you're using....
  • FUAnon (unregistered) in reply to Captain Oblivious
    Captain Oblivious:
    dude:
    Python is pretty awesome because it includes the best of both worlds. It is a dynamic language, but also strongly typed. There is no such thing as a 'cast' in Python. An int is always an int. After using Python, coding in a dynamic language with implicit/automatic casting like PHP or Javascript is like a slap in the face. I've spent much time debugging a problem only to find out it was an incorrect type being automatically casted, where Python would have thrown an exception instead.

    That's not what "strong typing" means. Your example is about the absolute minimum to count as a "typed" language. Strength, with respect to typing, refers to the expressiveness of the typing language. You see, a "strongly-typed" language is actually two languages: a term language for dealing with values, and a "type language" for expressing types, together with a nice type inference algorithm to let the two languages play together nicely.

    The Howard-Curry isomorphism theorem is worth mentioning here. A typed lambda calculus has two components: the typing language, and a value/term language. The theorem says that for each typed lambda calculus there is an isomorphism between it and some constructive logic, where the type language expressions correspond to theorems in the constructive logic, and value expressions correspond to proofs of these theorems in the logic. So if you can express a property in a type system, you are absolutely guaranteed that any implementation that type checks is correct. Stronger type systems allow you to express more property than "weaker" type systems.

    Some type languages (like Haskell with the UndecidableInstances extension) are Turing complete, so type inference can diverge (not halt). Some (like Haskell without extensions) are decidable, and type inference is guaranteed to terminate at compile time.

    I bet all the kids flock to your classes.

  • Nick Saika (unregistered)

    When I read this, I just about started to cry...

    I have the same thing to deal with, except it is all PHP.

  • Bald Rick (unregistered) in reply to FUAnon
    FUAnon:
    Captain Oblivious:
    dude:
    Python is pretty awesome because it includes the best of both worlds. It is a dynamic language, but also strongly typed. There is no such thing as a 'cast' in Python. An int is always an int. After using Python, coding in a dynamic language with implicit/automatic casting like PHP or Javascript is like a slap in the face. I've spent much time debugging a problem only to find out it was an incorrect type being automatically casted, where Python would have thrown an exception instead.

    That's not what "strong typing" means. Your example is about the absolute minimum to count as a "typed" language. Strength, with respect to typing, refers to the expressiveness of the typing language. You see, a "strongly-typed" language is actually two languages: a term language for dealing with values, and a "type language" for expressing types, together with a nice type inference algorithm to let the two languages play together nicely.

    The Howard-Curry isomorphism theorem is worth mentioning here. A typed lambda calculus has two components: the typing language, and a value/term language. The theorem says that for each typed lambda calculus there is an isomorphism between it and some constructive logic, where the type language expressions correspond to theorems in the constructive logic, and value expressions correspond to proofs of these theorems in the logic. So if you can express a property in a type system, you are absolutely guaranteed that any implementation that type checks is correct. Stronger type systems allow you to express more property than "weaker" type systems.

    Some type languages (like Haskell with the UndecidableInstances extension) are Turing complete, so type inference can diverge (not halt). Some (like Haskell without extensions) are decidable, and type inference is guaranteed to terminate at compile time.

    I bet all the kids flock to your classes.

    Better like this than those classes that teach people how to be 'Web Developers' by dragging/dropping in FrontPage!
  • Zed (unregistered)

    This is retarted. If you just had one js file the browser downloads it once (i.e use etag?) and that it. With this setup you are downloading junk on each page

  • Zed (unregistered) in reply to Zed

    Errr i mean I think IIS use etags for static files.

Leave a comment on “Functionally Functional”

Log In or post as a guest

Replying to comment #:

« Return to Article