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. Myopia, or why I can't C#

Myopia, or why I can't C#

Scheduled Pinned Locked Moved The Lounge
debuggingcsharpc++visual-studiojson
17 Posts 8 Posters 1 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.
  • J Jacquers

    Sounds like a situation where unit tests would work well.

    D Offline
    D Offline
    den2k88
    wrote on last edited by
    #8

    They wouldn't.

    GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

    J 1 Reply Last reply
    0
    • D den2k88

      They wouldn't.

      GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

      J Offline
      J Offline
      Jacquers
      wrote on last edited by
      #9

      Why not?

      D 1 Reply Last reply
      0
      • H honey the codewitch

        Rename Main(...) to Main2(...) Insert a Main() routine and make it call Main2 with your test cases.

        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

        D Offline
        D Offline
        den2k88
        wrote on last edited by
        #10

        Obviously, but it's not something I like to do because what's being tested and validated is Main2 and not Main. It did happen that seemingly harmless test code broke or unbroke some behavior in the test subject so I try to avoid it as much as possible.

        GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

        H 1 Reply Last reply
        0
        • 1 11917640 Member

          Time to move to WinDbg.

          D Offline
          D Offline
          den2k88
          wrote on last edited by
          #11

          If only I could install anything (I managed to install VS before they took away that privilege).

          GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

          1 Reply Last reply
          0
          • R Rage

            I like your thread subject :thumbsup: :laugh:

            Do not escape reality : improve reality !

            D Offline
            D Offline
            den2k88
            wrote on last edited by
            #12

            Thank you, frustration brings out the comedian in me :D

            GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

            1 Reply Last reply
            0
            • J Jacquers

              Why not?

              D Offline
              D Offline
              den2k88
              wrote on last edited by
              #13

              In this particular case it takes the same amount of code to visually inspect the relevant data structures + the test code + the validation code + the debug of the unit test. Considering that the user interface will not have any upgrade (it is to be inserted in an automated tool) the overhead is way too much for the scope of the project - I did terminate the whole software less than 2 hours after ranting. My gripe was not with the process I was using but by the fact that debugging a console application should naturally allow an easy way to pass arguments to said application. Also IT has to justify their paychecks so they :elephant: the group policies weekly, this week they messed up a the VS developer console (we don't use VS in house, we develop for ARM microcontrollers and our legit tools are uVision and Understand).

              GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

              E 1 Reply Last reply
              0
              • D den2k88

                Obviously, but it's not something I like to do because what's being tested and validated is Main2 and not Main. It did happen that seemingly harmless test code broke or unbroke some behavior in the test subject so I try to avoid it as much as possible.

                GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

                H Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #14

                Another option is to set the startup object in the project settings. That way you can have two mains, and call the second from the first. It doesn't entirely solve your problem, but it's an option.

                Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                1 Reply Last reply
                0
                • D den2k88

                  dandy72 wrote:

                  Well at least that one's easy to fix, get another monitor

                  No space, on my lab desk (the only place where I can debug) I have the specimen cage, and very large power supply (it has to provide up to 170 Amperes at 60V). I have barely enough space to cram the closed laptop between the power supply and the base of the monitor, especially because I also have a fixed drawer cabinet that forces the ergonomic position only barely where the monitor is. Plus the laptop has a single HDMI port anyway and the docking station is available only in the office desk, not le lab one.

                  GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

                  D Offline
                  D Offline
                  dandy72
                  wrote on last edited by
                  #15

                  den2k88 wrote:

                  Plus the laptop has a single HDMI port anyway and the docking station is available only in the office desk, not le lab one.

                  I was gonna say, there's USB to HDMI adapters, but I see you have bigger (physical) problems to deal with. I can sympathize. My desk is L-shaped; 5-feet long on the shorter end, and 8-feet long on the other. I couldn't find a spot to put a standard 8.5" x 11" sheet of paper to lay flat to write on.

                  1 Reply Last reply
                  0
                  • D den2k88

                    Another small rant, two-for-one. 1) Debugging console applications with parameters is painful. I need to test against all the possible combinations of arguments, can't do it properly though, need to pass through the debug options... which are persistent. And the console does not stay open (yes the checkbox is unchecked, also ignored by VS). And the breakpoint after the parsing moves the focus to the VS window hiding the Command prompt. Every test is a clickity-clickity-typety-clickity-clickity-clickity-clickity-clak. :elephant: you Microsoft. 2) Structures in watch window do not stay expanded. Add other clickity-clickity-claks to a simple test. Basically the best way to test this behavior is inserting test code and debug prints, as we used to do when we had to chisel bits one by one onto EEPROMS with tiny hammers and a lot of patience. Told you it was a rant.

                    GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

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

                    den2k88 wrote:

                    And the console does not stay open (yes the checkbox is unchecked, also ignored by VS).

                    You can run a command line tool in a Process. And then feed what ever you want to the command line and then collect the output. So build a testing harness. Alternatively I used 'AutoIt' to test console apps some years ago.

                    1 Reply Last reply
                    0
                    • D den2k88

                      In this particular case it takes the same amount of code to visually inspect the relevant data structures + the test code + the validation code + the debug of the unit test. Considering that the user interface will not have any upgrade (it is to be inserted in an automated tool) the overhead is way too much for the scope of the project - I did terminate the whole software less than 2 hours after ranting. My gripe was not with the process I was using but by the fact that debugging a console application should naturally allow an easy way to pass arguments to said application. Also IT has to justify their paychecks so they :elephant: the group policies weekly, this week they messed up a the VS developer console (we don't use VS in house, we develop for ARM microcontrollers and our legit tools are uVision and Understand).

                      GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

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

                      I have a general gripe with Visual Studio where you need a separate project per main(). I tend to code each entry point as a separate class in a DLL project with a myMain(). I have one Console app that just calls into the correct class. This also allows you to UnitTest the separate classes.

                      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