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. Programmers that think they're smart

Programmers that think they're smart

Scheduled Pinned Locked Moved The Lounge
pythoncomjsonhelpquestion
33 Posts 23 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.
  • L Lost User

    :confused:

    B Offline
    B Offline
    BryanFazekas
    wrote on last edited by
    #24

    Richard, I'm guessing you never had to deal with code that was complex enough that, some 3 months after writing it, the author had to figure out what he wrote? If so, count your blessings.

    L 1 Reply Last reply
    0
    • A Andre Pereira

      Web developers working on a 80 char terminal, trying to be "efficient" and clever: "Less lines means it's faster, right?" - every noob web developer "Who cares about indentation, we save 2 lines here this way!" - Apple before the SSL fiasco.

      M Offline
      M Offline
      Martin ISDN
      wrote on last edited by
      #25

      the y2k bug come to my mind. on a 8bit computer one byte per date is a huge space optimization, but i don't believe that mainframe COBOL programmers had to be that careful. also, i remember reading about an "optimization" of the old day ms-dos assembly programmers using the inability of i8086 to address more than 1MB so they wouldn't mind generating segment:offset addresses that past the megabyte barrier, because it will roll over and map into the address space of the zeroth+ segment. this of course caused latter compatibility issues. there was a similar man made "optimization" problem on the first mc68000 Amiga's, but i don't recall enough info to check what was the trick there.

      A 1 Reply Last reply
      0
      • C CPallini

        Quote:

        or even to you in a couple of years

        E A R L I E R :laugh:

        M Offline
        M Offline
        Martin ISDN
        wrote on last edited by
        #26

        earlier indeed "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" Brian Kernighan

        1 Reply Last reply
        0
        • B BryanFazekas

          Richard, I'm guessing you never had to deal with code that was complex enough that, some 3 months after writing it, the author had to figure out what he wrote? If so, count your blessings.

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

          BryanFazekas wrote:

          the author

          Are you talking about yourself? And I am not sure how this relates to my original comment.

          1 Reply Last reply
          0
          • M Marc Clifton

            return JsonConvert.SerializeObject(Process(JsonConvert.Deserialize(inputStream.ReadToEnd())));

            Such a PITA to inspect the intermediate results when debugging a problem. Is it bad data in the input? Is it bad data being produced by Process? Does the output JSON look like what the client is expecting? Wouldn't you want to do some validation before handing off to Process? What about a try-catch if the deserialization fails? What about a try-catch if Process fails? :sigh:

            Latest Article - Slack-Chatting with you rPi Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

            E Offline
            E Offline
            englebart
            wrote on last edited by
            #28

            Some IDE's have options to remove local variables. Don't ask me why! I like them for debug STOP locations as the poster prefers. I also like them for readability and documentation. Boolean summaryDescription = (super nasty Boolean expression with 4-8 components); if (summaryDescription) { handleIt(); } An ex-team member used to have their IDE preference to collapse these out of existence. I hated looking at my code after they had performed some minor tweak on my code along with a "reformat".

            1 Reply Last reply
            0
            • M Martin ISDN

              the y2k bug come to my mind. on a 8bit computer one byte per date is a huge space optimization, but i don't believe that mainframe COBOL programmers had to be that careful. also, i remember reading about an "optimization" of the old day ms-dos assembly programmers using the inability of i8086 to address more than 1MB so they wouldn't mind generating segment:offset addresses that past the megabyte barrier, because it will roll over and map into the address space of the zeroth+ segment. this of course caused latter compatibility issues. there was a similar man made "optimization" problem on the first mc68000 Amiga's, but i don't recall enough info to check what was the trick there.

              A Offline
              A Offline
              Andre Pereira
              wrote on last edited by
              #29

              Quote:

              hey wouldn't mind generating segment:offset addresses that past the megabyte barrier, because it will roll over and map into the address space of the zeroth+ segment

              Absolutely disgusting, this is the recipe CREATE legacy shit right from the start. I can't even imagine the hacks Microsoft must have had to do keep old Win32 apps working in a modern OS.

              1 Reply Last reply
              0
              • C CPallini

                I feel your pain. I find always difficult to understand others code, even well written one (a former workmate wrote a C++ library without comments, because 'clean code explains itself'. Well 'clean code' doesn't explain its rationale at all). Hence byzantine statements are the last thing I need. Anyway, I suppose my code might look byzantine to other people.

                S Offline
                S Offline
                Steve Naidamast
                wrote on last edited by
                #30

                Actually that C++ developer was correct in his belief in clean code explaining itself. However, "clean code" is only truly clean when a less experienced person can easily understand it. If you are a competent developer and found difficulties with understanding this person's code, than it is that developer who did not understand that his code was not as "clean" as he believed. Obviously, it was clean to him because he could easily understand it but he didn't take into account that someone else may not. Truly clean code means that the code is written with the most basic syntax available that will process the task efficiently. However, many developers believe their code is clean today simply because they wrote it in a legible manner while still using a lot of syntax sugar that vendors come up with in their compilers to make things simpler. Surprise, surprise! The result is exactly what you are complaining about... And with good reason...

                Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

                1 Reply Last reply
                0
                • M Marc Clifton

                  return JsonConvert.SerializeObject(Process(JsonConvert.Deserialize(inputStream.ReadToEnd())));

                  Such a PITA to inspect the intermediate results when debugging a problem. Is it bad data in the input? Is it bad data being produced by Process? Does the output JSON look like what the client is expecting? Wouldn't you want to do some validation before handing off to Process? What about a try-catch if the deserialization fails? What about a try-catch if Process fails? :sigh:

                  Latest Article - Slack-Chatting with you rPi Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                  O Offline
                  O Offline
                  ormonds
                  wrote on last edited by
                  #31

                  If you can't explain something to a five year old you don't understand it yourself. (Einstein, I think). Same goes for writing clear code.

                  1 Reply Last reply
                  0
                  • M Marc Clifton

                    return JsonConvert.SerializeObject(Process(JsonConvert.Deserialize(inputStream.ReadToEnd())));

                    Such a PITA to inspect the intermediate results when debugging a problem. Is it bad data in the input? Is it bad data being produced by Process? Does the output JSON look like what the client is expecting? Wouldn't you want to do some validation before handing off to Process? What about a try-catch if the deserialization fails? What about a try-catch if Process fails? :sigh:

                    Latest Article - Slack-Chatting with you rPi Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

                    J Offline
                    J Offline
                    James Lonero
                    wrote on last edited by
                    #32

                    Looks like something that older Unix C programmers would write. Easy to code, difficult to read.

                    1 Reply Last reply
                    0
                    • N Nelek

                      CPallini wrote:

                      Anyway, I suppose my code might look byzantine to other people.

                      or even to you in a couple of years

                      M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                      M Offline
                      M Offline
                      Mark H2
                      wrote on last edited by
                      #33

                      Absolutely. I look back at some of my earlier stuff and immediately think "what the hell was I thinking!?" :laugh:

                      If your neighbours don't listen to The Ramones, turn it up real loud so they can. “We didn't have a positive song until we wrote 'Now I Wanna Sniff Some Glue!'” ― Dee Dee Ramone "The Democrats want my guns and the Republicans want my porno mags and I ain't giving up either" - Joey Ramone

                      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