Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

OT protection??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by Steve Conner View Post
    If you need maximum performance, minimum code size, and you don't mind suffering horribly for it, you can fling all of this stuff out of the window and hand-code everything in assembler, like one of those old "Real Programmers". But nowadays you're advised to program in C and let an optimizing compiler fling it out of the window for you.
    Suffering horribly! I started out programming in assembler for the old IBM370. Now, that was suffering! I also did my time on Fortran with punch-cards (ever drop a deck and have to spend an hour trying to get it back in order? aughhhh!!!). More suffering! Then there was the old teletypes and paper-tape readers and "microcomputers" like the Atair IMSAI 8080. Now that was sort of suffering, although those little oiled paper dots were great fun to collect and dump on people at football games or drunken brawls. Then Pascal came along and saved us, and was useful for writing PROM code, and fortunately, C came along and put Pascal to bed.

    Now, I think modern assembly for ARM's and 8051's is not that bad, but in my lazy older years, I'll take C any day! Now, C++, that's back to suffering!!! I think there must be a point where, as you age, you can no longer comprehend any new concepts, and I think object-oriented programming is where this old dog quit learning new tricks.

    RA
    Last edited by raiken; 05-29-2010, 10:44 PM.

    Comment


    • #32
      Now, C++, that's back to suffering!!!
      I quite agree. Learning C++ was the biggest head f**k I've had in my entire career.

      And then there was the disappointment of realising that there's actually nothing magic about object-oriented programming. It's not a silver bullet for all programming problems, like the OO pioneers would have you believe. It's very handy in some cases, but if you try to use it all the time, things can get horribly over-complicated, worse than if you'd done it in old-fashioned procedural style.

      Straight C can do everything that C++ can, but it's more work. You can make your own classes out of structs, function pointers and the like. If you've got a lot of experience in programming, and you start to learn OO, you might eventually go: "Oh, is that all OO is? I've been doing that for 25 years."

      At work I use a mixture of C and C++, and try to go as light as I can on the "++" features. I've come to appreciate the C++ String, and STL things like the Map and Queue. They save a lot of effort by replacing things that you'd have to code yourself in straight C.
      "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

      Comment


      • #33
        Originally posted by Steve Conner View Post
        I quite agree. Learning C++ was the biggest head f**k I've had in my entire career.
        I do mainly embedded applications, bare metal. I've only done a few small Windows apps in C++, and Visual C++ (or .net, or whatever they are calling it these days) made things rather easy, but I could tell there was no way I would ever understand what was going on underneath all the generated code. At least C is understandable, even if there are a zillion ways to do the same thing! The other nice thing is that Verilog is a lot like C, so it makes programming Xilinx's and other FPGAs a breeze. If some fool comes up with OO Verilog, or V++, I'm going to retire.


        RA

        Comment


        • #34
          Originally posted by raiken View Post
          I could tell there was no way I would ever understand what was going on underneath all the generated code.
          Isn't that the whole point of generated code? You don't need to know.

          I remember trying to single-step through some disassembly code for a TI DSP library routine. In the usual IDE you get a little green arrow that shows what instruction is currently getting executed. Except this DSP could execute up to 6 instructions simultaneously, so 6 arrows appeared and jumped frantically about the code.

          I did find the bug that time (the library writer forgot to mention that it only worked with buffer sizes divisible by 3) but it was mostly by luck. I'm committed to this chip for an upcoming product, but I have no idea how to program it in assembler, and I'm grateful for the optimizing C compiler.

          I also work in the embedded field, my latest project was the firmware for this thing. It's about 9,000 lines of C++ so far.
          http://www.gcu.ac.uk/media/cs18_doble_PDS.pdf
          Almost relevant to the original subject of transformer protection, I guess :-)

          You mentioned FPGAs, I'm currently struggling with those too :-(
          "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

          Comment


          • #35
            Originally posted by Steve Conner View Post
            I also work in the embedded field, my latest project was the firmware for this thing. It's about 9,000 lines of C++ so far.
            http://www.gcu.ac.uk/media/cs18_doble_PDS.pdf
            Almost relevant to the original subject of transformer protection, I guess :-)
            Very cool! I spent most of my life designing hardware for the broadcast television world (time base correctors, frame syncs, digital audio, etc.), but for the last five or ten years I have been doing contract design work in the military and law-enforcement avionics industry, designing LCD displays, video recorders, etc. I do hardware, software, firmware, PC layouts, etc. These are some of my designs:

            Rugged Landscape Avionics Displays - Avalex Technologies

            Rugged and Mobile Digital Video Recorder - Avalex Technologies

            It does take away from my amp building time, though.

            RA
            Last edited by raiken; 05-29-2010, 10:54 PM.

            Comment


            • #36
              Originally posted by Steve Conner View Post
              Isn't that the whole point of generated code? You don't need to know.
              Until it crashes and you have no idea why, and it just sits there and looks at you...

              To the OP: Sorry to hijack your thread with war stories!

              RA

              Comment


              • #37
                Ooh ooh, darn, I was about to cheer for punch-card confetti. We used to dump all the bins from the card punch machines at the computer lab at Michigan State and take bags of it to the football games. That is hard to comb out of your hair. Or WAS when I had hair.
                Education is what you're left with after you have forgotten what you have learned.

                Comment


                • #38
                  Originally posted by Enzo View Post
                  Or WAS when I had hair.
                  I still have hair, but strangely enough, it's not all brown anymore, and I think my forehead is getting a bit taller as I get older...

                  Comment


                  • #39
                    My forehead can read the label on my shirt.
                    Education is what you're left with after you have forgotten what you have learned.

                    Comment

                    Working...
                    X