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. Fed-up with strongly typing

Fed-up with strongly typing

Scheduled Pinned Locked Moved The Lounge
comhardwarequestion
61 Posts 29 Posters 3 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.
  • C Chris Maunder

    Strongly typing is the rubber treading that stops you sliding down that slippery slope of laziness. A more accurate comment is actually: Typing is a tool and needs to be used appropriately. It can save man-hours in finding bugs, and can cost man-hours in hacky work-arounds. We're moving more and more to web services for communication between our systems and to allow loose coupling we're relying extensively on JSON and C# dynamics. Untyped development makes the code simple, elegant and fast to write as well as robust to changes (as long as we catch exceptions), but it means an awful lot of referring to external documentation or external code to check properties and data types, so we lose the instant feedback that is intellisense.

    cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

    G Offline
    G Offline
    Guirec
    wrote on last edited by
    #39

    Chris Maunder wrote:

    it means an awful lot of referring to external documentation or external code

    1. it looks like an interesting feature to have devs reading some documentation 2. they will read it once or twice and then they will remember. At that point in time you will end-up with "the code simple, elegant and fast to write as well as robust to changes". Isn't it the point?

    Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

    J 1 Reply Last reply
    0
    • D Dave Calkins

      always testing your code is a good thing. it doesn't remove the benefit of compile time checking provided by strongly typed languages though. i.e. regardless of how much runtime testing you do, and/or how proficient you are, there's still a benefit to be had from also having compile time checking.

      G Offline
      G Offline
      Guirec
      wrote on last edited by
      #40

      I do agree with you but I am at a point where I don't think the benefit outweight the cost....

      Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

      1 Reply Last reply
      0
      • G Guirec

        Marc Clifton wrote:

        If you don't like typing, you shouldn't be a programmer.

        I am a programmer cause I never liked repetitive tasks, I believe that typing .net/java code is highly repetitive... You might think differently: fair enough. But with all respect I am not judging what you should or should not be or do.

        Marc Clifton wrote:

        Not to mention that I wouldn't write anything that requires performance in a dynamic language

        Many dynamic languages outperform statically typed languages... just have a go with LUA you should not be disappointed. And code is not all... the environment has a lot to do: run some compiled C# in IIS and compare performance with interpreted JS in node or run PHP within ligthy and you might end-up handling more than 3000 requests/sec http://redmine.lighttpd.net/projects/lighttpd/wiki/PoweredByLighttpd[^]... Drop me a note when you achieve the same with csharp :-D

        Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

        J Offline
        J Offline
        J Dunlap
        wrote on last edited by
        #41

        Guirec Le Bars wrote:

        Drop me a note when you achieve the same with csharp :-D

        Here I am, dropping you a note. C# typically has about 3x the performance of nodejs. But to get >3000 requests/sec you will need to tune both IIS and your ASP.NET settings - or drop to the bare metal like nodejs does anyway. I personally tested this using HttpListener and C#'s async features, but there are libraries out there as well to do this. I got over 10,000 requests per second on a good server machine.

        G 1 Reply Last reply
        0
        • G Guirec

          Matthew Faithfull wrote:

          the stability/lifetime/readability

          stability : hhmmmm... what's that? as soon as you change a line of code somewhere some sort of instability appears right? and if you don't change anything then dynamic is as stable as strongly typed... lifetime: with a new version of the .net framework every year which, each time, brings more syntactic sugar (anonymous delegate, initializers, linq, etc...) then the code written today is extremely different from the one wrote a few years ago. It seems to me that there is less of a trend/fashion style for dynamic languages devs. readability: once again this is related to your seniority level I think. It is pretty easy to write unredable code in .Net/Java.

          Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

          M Offline
          M Offline
          Matthew Faithfull
          wrote on last edited by
          #42

          Guirec Le Bars wrote:

          if you don't change anything then dynamic is as stable as strongly typed

          No because you don't need to change anything for a new version of Python to break your code because they tidied up vague rules for under the hood type conversion that you can't control through the language itself. As to .Net and Java what you say is true which is why I'll stick with a strong and statically typed language like C++ given the choice.

          "The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)

          1 Reply Last reply
          0
          • G Guirec

            I do actually :suss:

            Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #43

            Aah, never miss the times running into an "m_intFoosBar" that contained a string.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            1 Reply Last reply
            0
            • J J Dunlap

              Guirec Le Bars wrote:

              Drop me a note when you achieve the same with csharp :-D

              Here I am, dropping you a note. C# typically has about 3x the performance of nodejs. But to get >3000 requests/sec you will need to tune both IIS and your ASP.NET settings - or drop to the bare metal like nodejs does anyway. I personally tested this using HttpListener and C#'s async features, but there are libraries out there as well to do this. I got over 10,000 requests per second on a good server machine.

              G Offline
              G Offline
              Guirec
              wrote on last edited by
              #44

              Was that a test which was 'really' doing something like generate some content and write it to the response stream or was it just returning a ok/200 ? I might actually be interested in your codebase if you want to share. The 3000 req/sec I am talking about are real dynamic websites running on production, so they obviously have content.

              Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

              1 Reply Last reply
              0
              • G Guirec

                Easy? if you say so... IMHO, asp.net can't handle 3000 requests per second. Even if you remove every single HttpModule and just stick to a very basic HttpHandler....

                Andy Brummer wrote:

                Asp.net has had asyncronous handlers for years

                hopefully... at OS level everything is asynchronous by nature. Synchronicity has been brought to developpers to facilitate their lives but that is not the norm for any Win or posix computer.

                Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

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

                Anyway, it's the architectural change in node and nginx that lets it scale to really high levels. Any of the platforms these days can get that kind of performance if you know what you are doing. It's more about developer experience and knowing how to take advantage of the platform than the platform itself. If you wanted to, you could drop back down to straight C++ and hook into the same low level http apis that IIS uses and crush the performance of just about anything else out there. Or you could do the same in Linux and beat the pants off node. Anyway I've worked on a web service that saturated the network at 6000-7000 req/sec and used 18Gigs of memory to predict fraud in advertising clickstreams. The cut off response time was 200ms, the service averaged under 1ms even when it was getting hammered. That was over 3 years ago on a relatively low end 2 proc VM. I never really got to the point of really tuning it, but I'm sure there was a lot more it could have done.

                Curvature of the Mind now with 3D

                1 Reply Last reply
                0
                • G Guirec

                  Strongly typing has one big advantage: it will force you to grow from a jerk to a proficient programmer. Yes, many programmers never get proficient but then strongly typing is not the cause :-) But here we are: when you are proficient in your domain of expertise (eg: embedded, gaming, LOB apps, multi-million users websites or whatever is your mod) then strongly typing is just a pain... It only multiplies by X (I am curious here... anyone? ) the number of reserved keywords you have to type to get to an equivalent result that you would get with a dynamic language. What do you guys think?

                  Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #46

                  Guirec Le Bars wrote:

                  What do you guys think?

                  It isn't significant so it doesn't matter.

                  1 Reply Last reply
                  0
                  • F Freak30

                    And what if the proficient programmer misses one of the code paths during his tests? The compiler will surely check them all.

                    J Offline
                    J Offline
                    jschell
                    wrote on last edited by
                    #47

                    Freak30 wrote:

                    And what if the proficient programmer misses one of the code paths during his tests?

                    And thus they could have a logic error as well, which would be harder to diagnose in a production system - so what is your point?

                    1 Reply Last reply
                    0
                    • B BobJanova

                      The C# compiler, and any other compiler for a strongly- and statically-typed language, certainly will check the data type of variables through every possible code path. It may not know the value of a variable at a particular point or evaluate all possible paths through the code (that is impossible for anything which takes external input, after all), but it can check the type, and if you make a type related mistake anywhere in your code, it will be caught.

                      J Offline
                      J Offline
                      jschell
                      wrote on last edited by
                      #48

                      BobJanova wrote:

                      The C# compiler, and any other compiler for a strongly- and statically-typed language, certainly will check the data type of variables through every possible code path

                      Neither C# or any other compiler in that category will check dynamically loaded code paths. Where as unit testing would check that.

                      D 1 Reply Last reply
                      0
                      • M Marc Clifton

                        Guirec Le Bars wrote:

                        you have to type

                        I often hear complaints about how much typing someone has to do. If you don't like typing, you shouldn't be a programmer. As to dynamic typing, while it's cool and fun, in the long run, the number of problems that I've had to fix that simply wouldn't be there in a strongly typed language all but eliminates for me the benefits. Not to mention that I wouldn't write anything that requires performance in a dynamic language, as these usually cannot be compiled into native assembly code but are either interpreted or are run in a VM. So I'll say it again, but this time metaphorically: If you don't like typing, you shouldn't be a programmer. Marc

                        Testers Wanted!
                        Latest Article: User Authentication on Ruby on Rails - the definitive how to
                        My Blog

                        J Offline
                        J Offline
                        jschell
                        wrote on last edited by
                        #49

                        Marc Clifton wrote:

                        If you don't like typing, you shouldn't be a programmer.

                        Or write code that writes code for you.

                        M 1 Reply Last reply
                        0
                        • G Guirec

                          Chris Maunder wrote:

                          it means an awful lot of referring to external documentation or external code

                          1. it looks like an interesting feature to have devs reading some documentation 2. they will read it once or twice and then they will remember. At that point in time you will end-up with "the code simple, elegant and fast to write as well as robust to changes". Isn't it the point?

                          Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                          J Offline
                          J Offline
                          jschell
                          wrote on last edited by
                          #50

                          Guirec Le Bars wrote:

                          At that point in time you will end-up with "the code simple, elegant and fast to write as well as robust to changes".

                          You must either program by yourself or work with a very extraordinary group of programmers and an extraordinary company. The rest of us must work in the real world where the average programmer, by definition, is average. And some are below average. Thus over time larger systems are neither "robust" nor "elegant". And that even presumes that the business requirements and delivery times allowed for that in the first place.

                          Guirec Le Bars wrote:

                          Isn't it the point?

                          Might be the intent but that isn't what happens. What happens over time is that there is little to no documentation. One must look to the code to find out what is going on and one must often delve through multiple layers to understand it. Which becomes even more true when someone, previously, decided that some generic, meta data, multi-layered solution was appropriate to solve what would have been a trivially simple bit of code.

                          1 Reply Last reply
                          0
                          • G Guirec

                            Great. The compiler help me in making sure I don't mix-up class Person with class Country or int with Toto. Awesome... Do you really need a compiler for this? I mean, can't you just concentrate when writing code? Or adopt Hungarian Apps style which is definitely every programmer's friend? Anyway you are not answering the vey valid point of Freak30

                            Freak30 wrote:

                            And what if the proficient programmer misses one of the code paths during his tests

                            Answer: I don't know! But I am sure that csc does not help in any way for that! The .net platform gives too many facilities which make the posiible code paths just too numerous (infinite? at least overflowing...)

                            Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                            B Offline
                            B Offline
                            BobJanova
                            wrote on last edited by
                            #51

                            Well obviously you need to test and pay attention as well. Compile time type checking catches a few silly mistakes that would otherwise cause you trouble, though.

                            1 Reply Last reply
                            0
                            • J jschell

                              Marc Clifton wrote:

                              If you don't like typing, you shouldn't be a programmer.

                              Or write code that writes code for you.

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

                              jschell wrote:

                              Or write code that writes code for you.

                              Quite so. I haven't needed to write a line of SQL in a while now. :) Marc

                              Testers Wanted!
                              Latest Article: User Authentication on Ruby on Rails - the definitive how to
                              My Blog

                              1 Reply Last reply
                              0
                              • G Guirec

                                Freak30 wrote:

                                The compiler will surely check them all.

                                I want one of these! Please let me know which compiler as you are using. A compiler which checks all code path is priceless!

                                Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                                S Offline
                                S Offline
                                sashan govender
                                wrote on last edited by
                                #53

                                Compilers already check all paths because they have to. The 'art' of writing good code or being a proficient programmer is to write code such that the compiler can perform the checks itself. You essentially move what can be checked at runtime into something that is checked at compile time. This is what a strongly typed language will allow you to do. This requires more thought and effort from the programmer, which discourages them, as well as the fact that the majority of programmers don't understand this.

                                H 1 Reply Last reply
                                0
                                • G Guirec

                                  Strongly typing has one big advantage: it will force you to grow from a jerk to a proficient programmer. Yes, many programmers never get proficient but then strongly typing is not the cause :-) But here we are: when you are proficient in your domain of expertise (eg: embedded, gaming, LOB apps, multi-million users websites or whatever is your mod) then strongly typing is just a pain... It only multiplies by X (I am curious here... anyone? ) the number of reserved keywords you have to type to get to an equivalent result that you would get with a dynamic language. What do you guys think?

                                  Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #54

                                  [quote]But here we are: when you are proficient in your domain of expertise (eg: embedded, gaming, LOB apps, multi-million users websites or whatever is your mod) then strongly typing is just a pain... [/quote] Are you talking about yourself only? I don't always program multi-million users websites, but when I do, I use strongly typed languages.

                                  1 Reply Last reply
                                  0
                                  • G Guirec

                                    Strongly typing has one big advantage: it will force you to grow from a jerk to a proficient programmer. Yes, many programmers never get proficient but then strongly typing is not the cause :-) But here we are: when you are proficient in your domain of expertise (eg: embedded, gaming, LOB apps, multi-million users websites or whatever is your mod) then strongly typing is just a pain... It only multiplies by X (I am curious here... anyone? ) the number of reserved keywords you have to type to get to an equivalent result that you would get with a dynamic language. What do you guys think?

                                    Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                                    P Offline
                                    P Offline
                                    Patrick Fox
                                    wrote on last edited by
                                    #55

                                    IMO, if you can't handle strong typing, then you weren't completely sure what you were doing in the first place. Disabling strong typing, or using languages that don't feature it, are for the lazy in spirit and mind. Strong typing catches many simple, dumb little problems that can really bite you at runtime, when you may have already shipped the product. You can afford the compiler yelling at you for 5 seconds much more than you can afford a support call + an emergency patch.

                                    1 Reply Last reply
                                    0
                                    • G Guirec

                                      that is definitely not the case. but a proficient programmer is anyway testing is code and just don't rely on compilation, right?

                                      Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                                      H Offline
                                      H Offline
                                      Harley L Pebley
                                      wrote on last edited by
                                      #56

                                      In a strongly typed language, I don't have to write tests that check type safety. In a weakly typed language I do. Strongly typed languages let me focus on the domain and mostly ignore the types because I know the compiler (and more recently the IDE and plug-ins) will flag any issues. Weakly typed languages force me to pay attention to the plumbing more, leaving less energy for the more important things.

                                      1 Reply Last reply
                                      0
                                      • G Guirec

                                        Strongly typing has one big advantage: it will force you to grow from a jerk to a proficient programmer. Yes, many programmers never get proficient but then strongly typing is not the cause :-) But here we are: when you are proficient in your domain of expertise (eg: embedded, gaming, LOB apps, multi-million users websites or whatever is your mod) then strongly typing is just a pain... It only multiplies by X (I am curious here... anyone? ) the number of reserved keywords you have to type to get to an equivalent result that you would get with a dynamic language. What do you guys think?

                                        Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                                        R Offline
                                        R Offline
                                        RafagaX
                                        wrote on last edited by
                                        #57

                                        Strong typing is better down the road, with it the compiler catches many "dumb" errors that will pass unmarked otherwise (for example undeclared variables, type mismatch, redeclared of variables, etc.). If you want to put it like this it gives me peace of mind that my solution will not blow up at runtime with some obscure and untraceable bug caused by a redefined variable somewhere in a function.

                                        CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                        1 Reply Last reply
                                        0
                                        • G Guirec

                                          Strongly typing has one big advantage: it will force you to grow from a jerk to a proficient programmer. Yes, many programmers never get proficient but then strongly typing is not the cause :-) But here we are: when you are proficient in your domain of expertise (eg: embedded, gaming, LOB apps, multi-million users websites or whatever is your mod) then strongly typing is just a pain... It only multiplies by X (I am curious here... anyone? ) the number of reserved keywords you have to type to get to an equivalent result that you would get with a dynamic language. What do you guys think?

                                          Seulement, dans certains cas, n'est-ce pas, on n'entend guère que ce qu'on désire entendre et ce qui vous arrange le mieux... [^] Joe never complained of anything but ever did his duty in his way of life, with a strong hand, a quiet tongue, and a gentle heart [^]

                                          M Offline
                                          M Offline
                                          Member 4608898
                                          wrote on last edited by
                                          #58

                                          I use them both. When it matters, I use a typed language, when it doesn't I use untyped. It would drive me crazy if shell/batch scripting was strongly typed. It would also drive me crazy if highly complex programs were untyped. I developed programs in BCPL for body scanners two years. BCPL has only one type: a word. There were times when I really wished it was typeless.

                                          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