As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

[Programming] Page overflow to new thread

14445474950101

Posts

  • Options
    NaphtaliNaphtali Hazy + Flow SeaRegistered User regular
    BlazeFire wrote: »
    I think a certification process makes sense when the potential consequences of incompetence are severe. Incompetent doctors or engineers (at least some, depending on their scope of work) can get people killed Software development/engineering/etc does not typically have those kind of consequences, does it?

    I work in industrial automation, so it absolutely can from safety perspectives at times.

    Steam | Nintendo ID: Naphtali | Wish List
  • Options
    SoggybiscuitSoggybiscuit Tandem Electrostatic Accelerator Registered User regular
    edited August 2020
    Naphtali wrote: »
    BlazeFire wrote: »
    I think a certification process makes sense when the potential consequences of incompetence are severe. Incompetent doctors or engineers (at least some, depending on their scope of work) can get people killed Software development/engineering/etc does not typically have those kind of consequences, does it?

    I work in industrial automation, so it absolutely can from safety perspectives at times.

    I used too as well, and when things go wrong the can really GO WRONG.

    For example, one of our programmers forgot a safety interlock on a centrifuge, so that in one scenario when it was being bypassed, material kept feeding it instead with no outlet. So material just built up and up and until 5 tons of rotating steel at a few hundred RPMs jammed quite suddenly. Not a good day.

    Soggybiscuit on
    Steam - Synthetic Violence | XBOX Live - Cannonfuse | PSN - CastleBravo | Twitch - SoggybiscuitPA
  • Options
    schussschuss Registered User regular
    Just look at the varying answers to null =null
    dporowski wrote: »
    A compounding issue is that unlike concrete, or construction, where materials science, structural integrity, and testing methodologies are rigorous, established, and based entirely in empirical fact, the software equivalent is... Less so. In rather the manner that bricks float less well than a duck.

    Not only is making the thing subject to fits of "Well, Sue found this great blog post about wood...", but the people inspecting the concrete all have a different definition of "structural integrity", in some cases involving "well it's cool, we can just pour more!"

    The thing is - we know how to make good software, but it's hard and expensive, so no one does it. This is what good looks like: https://www.fastcompany.com/28121/they-write-right-stuff
    It would likely double the software staff needed.

  • Options
    BlazeFireBlazeFire Registered User regular
    I lump industrial automation in with engineering because that is who I have seen does that programming (or has oversight).

  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    schuss wrote: »
    Just look at the varying answers to null =null
    dporowski wrote: »
    A compounding issue is that unlike concrete, or construction, where materials science, structural integrity, and testing methodologies are rigorous, established, and based entirely in empirical fact, the software equivalent is... Less so. In rather the manner that bricks float less well than a duck.

    Not only is making the thing subject to fits of "Well, Sue found this great blog post about wood...", but the people inspecting the concrete all have a different definition of "structural integrity", in some cases involving "well it's cool, we can just pour more!"

    The thing is - we know how to make good software, but it's hard and expensive, so no one does it. This is what good looks like: https://www.fastcompany.com/28121/they-write-right-stuff
    It would likely double the software staff needed.

    More than double and vastly inflate timelines. They have one product, practically unlimited budget and are able to specify in excruciating detail what it does years in advance and can develop a page of specs for each few lines of code. They don't have to run on arbitrary hardware and they probably got to pick the specs of the hardware too

    The TCP spec is 80 pages long and would document a moderately sized function with their process

  • Options
    vamenvamen Registered User regular
    edited August 2020
    There's no reason a JS function wouldn't work on an ASP dropdown, right?

    I am trying to fumble my way through making a dropdown box on a page disable/enable based on the selection(s) in a previous dropdown. I thought I had it figured out based on some researching via google, but no dice. I'm probably simply calling something wrong or using the wrong command due to my lack of experience.
    Nothing BROKE at least, just nothing...happened.

    I have ASP drop down ddSurvType and ddComplaints.
    I want ddComplaints to only be enable if someone selects 1 of 3 specific options in ddSurvType.

    I made this JS function (I don't started with one ddSurvType value until I get it working)
    function toggleComplaint() {
    if (document.getElementById('ddSurvType').value = '14')
    document.getElementById('ddComplaint').disabled = false;
    else
    document.getElementById('ddComplaint').disable = true;
    }


    And then in the inline for ddSurvType I put in: OnChange="toggleComplaint()"


    Anything obvious I'm overlooking or I'm just going completely down the wrong path?


    Thanks!

    vamen on
  • Options
    InfidelInfidel Heretic Registered User regular
    You check it values are equal to each other with == not =

    OrokosPA.png
  • Options
    InfidelInfidel Heretic Registered User regular
    Also disabled versus disable, only one of those would be correct yeah?

    OrokosPA.png
  • Options
    vamenvamen Registered User regular
    Yeesh! Good eyes, I have been looking at this too long maybe. I overlooked all of that. I'll give that a whirl.

    I think I need to take a break =).

  • Options
    vamenvamen Registered User regular
    edited August 2020
    Infidel - you're a hero. It was just me being careless, it worked after fixing those typos. I needed another pair of eyes, clearly. Much appreciated.

    vamen on
  • Options
    DrovekDrovek Registered User regular
    schuss wrote: »
    Just look at the varying answers to null =null
    dporowski wrote: »
    A compounding issue is that unlike concrete, or construction, where materials science, structural integrity, and testing methodologies are rigorous, established, and based entirely in empirical fact, the software equivalent is... Less so. In rather the manner that bricks float less well than a duck.

    Not only is making the thing subject to fits of "Well, Sue found this great blog post about wood...", but the people inspecting the concrete all have a different definition of "structural integrity", in some cases involving "well it's cool, we can just pour more!"

    The thing is - we know how to make good software, but it's hard and expensive, so no one does it. This is what good looks like: https://www.fastcompany.com/28121/they-write-right-stuff
    It would likely double the software staff needed.

    I kind of want to know what that article would look like for SpaceX now.

    steam_sig.png( < . . .
  • Options
    thatassemblyguythatassemblyguy Janitor of Technical Debt .Registered User regular
    Drovek wrote: »
    schuss wrote: »
    Just look at the varying answers to null =null
    dporowski wrote: »
    A compounding issue is that unlike concrete, or construction, where materials science, structural integrity, and testing methodologies are rigorous, established, and based entirely in empirical fact, the software equivalent is... Less so. In rather the manner that bricks float less well than a duck.

    Not only is making the thing subject to fits of "Well, Sue found this great blog post about wood...", but the people inspecting the concrete all have a different definition of "structural integrity", in some cases involving "well it's cool, we can just pour more!"

    The thing is - we know how to make good software, but it's hard and expensive, so no one does it. This is what good looks like: https://www.fastcompany.com/28121/they-write-right-stuff
    It would likely double the software staff needed.

    I kind of want to know what that article would look like for SpaceX now.

    Something something mandatory nights and weekends.

  • Options
    CarpyCarpy Registered User regular
    With 4 identical control applications being given the same inputs I wonder how often they disagree. I'd always heard that the control programs were written by different teams without any code shared between them but to the same exacting spec.

    I did get a kick out of the reverent descriptions of git and bugzilla.

  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Oh dear. I appear to have summoned the demon of Multi-thread Cache Management. Someone call the exorcist.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    xraydogxraydog Registered User regular
    edited August 2020
    Drovek wrote: »
    schuss wrote: »
    Just look at the varying answers to null =null
    dporowski wrote: »
    A compounding issue is that unlike concrete, or construction, where materials science, structural integrity, and testing methodologies are rigorous, established, and based entirely in empirical fact, the software equivalent is... Less so. In rather the manner that bricks float less well than a duck.

    Not only is making the thing subject to fits of "Well, Sue found this great blog post about wood...", but the people inspecting the concrete all have a different definition of "structural integrity", in some cases involving "well it's cool, we can just pour more!"

    The thing is - we know how to make good software, but it's hard and expensive, so no one does it. This is what good looks like: https://www.fastcompany.com/28121/they-write-right-stuff
    It would likely double the software staff needed.

    I kind of want to know what that article would look like for SpaceX now.

    Some good insights here: https://www.reddit.com/r/spacex/comments/gxb7j1/we_are_the_spacex_software_team_ask_us_anything/

    xraydog on
  • Options
    vamenvamen Registered User regular
    edited August 2020
    I'm sure you pros run into this all the time, but this is a first for me. I was tearing my hair out with that issue I posted a few days ago but got it working nicely and was SO pleased about it.
    Today the user emailed me to ask me to change it, even though I'd had her confirm exactly how she wanted it to work before hand. Argh!
    I should point out I am not at ALL a programmer, I only do SQL...this site just got dropped in my lap because no one else in my department does ANY tech stuff =p. So it's a huge time commitment away from my regular responsibilities to mess with this, even though I like learning it.

    All they wanted to change was to turn a single-select drop down into a multi-select listbox. Which I managed to get working a lot faster than I expected. I only ran into one MINOR setback and it's all that is keeping me from finishing (I think/hope).

    The listbox pulls the possible selection options from a tblComplaint_Master.
    When I had it as the dropdown, it default to value 0 which was for None/NA (complaint_id 0, complaint_desc "None/NA"). But now with the listbox, it defaults to no value selected when I load the page initially. If they save the record with no value and then try to reopen it, it gives them an error that the "selectedvalue is invalid because it doesn't exist". Which makes sense since there is no NULL or blank value in the master definitions table.
    My question is what is a good way to get around this? I was trying to find a way to make it simply default to the None/NA selection, or to automatically insert 0 for the value into the record table if they didn't select anything but
    1) I've not managed to get either working.
    2) I'm not sure if this is a bad way to go about it. I'd like to do it the best way possible just so I can learn good habits.

    EDIT - I also have this little section and I thought I could do a "else if it's blank/isnothing, set it to 0" but I haven't managed to write the code correctly so far.
    If Not IsDBNull(survinfo.Rows(0)("complaint_id")) Then
      'Loop through ddComplaint2 listbox and select every item that is saved in the database.
      Dim selectedItems As String() = Split(survinfo.Rows(0)("complaint_id"), ",")
        For Each item In ddComplaint2.Items
          If selectedItems.Contains(item.Value) Then
            item.Selected = True
          End If
      Next
    End If
    

    Thoughts?

    vamen on
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    You're already in territory that would be considered... alternative design as normally when you have a one-to-many relationship like that the correct value for no items is an empty list, but I'm assuming these data models are (at least effectively) immutable, so we're in workaround territory.

    And with that said I think automatically inserting 0 if no values are selected is the correct behavior. You don't want to shown "None" in a multi-select because it'll confuse users when they have None + options selected. "None" in this case is purely a back-end concept, so it should be handled on the backend.

    That block of code looks like the code that sets up the listbox on load rather than the block for saving the results... right?

  • Options
    vamenvamen Registered User regular
    edited August 2020
    er yea you are correct, I mis-typed what I meant. But yes, absolutely for setting up the listbox on load.

    I'm sure there is a lot I'm doing that is not ideal, which is why I bug you folks so much. I don't want to develop bad habits when I can avoid it, but when you're just frantically trying to get something to work and have no real foundation, it's so easy to do, as I'm sure you know. And let me tell you, as little as I know, I can tell you the original design for this site has ALL KINDS of bad problems.

    Good point about the "None" business, I hadn't even thought about it confusing the users.

    vamen on
  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    It's never about making the best design decisions, it's about making the best design decisions you can make.

  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    admanb wrote: »
    It's never about making the best design decisions, it's about making the best design decisions you can make.

    I think it's more accurate to call it "least bad" ;)

  • Options
    vamenvamen Registered User regular
    I'm doing the least bad I can! =)

    In good news, it turns out "None" needs to be an actual valid selection, so they need to select SOMETHING from the listbox. That probably makes me life easier as I imagine there is a way to set a default value. The only trick would likely be if someone decided to CTRL unselect everything, but in all honest 99% of my users don't even know how to CTRL click to add to a selection. I still want to account for it though, of course. =)

  • Options
    InfidelInfidel Heretic Registered User regular
    Yeah data model wise you should be looking at this as "an empty list" conceptually as much as you can, it saves you the most grief.

    An empty list is not null in programming land. Null would mean "no list at all" not "an empty one" and the concept of a None/nil/0 list is inappropriate for the model and view both.

    OrokosPA.png
  • Options
    vamenvamen Registered User regular
    edited August 2020
    I am new enough that I can only BARELY grasp what you mean by that =). But I have made a note to read up!
    EDIT - I was actually recently doing a tutorial in Python about lists and dictionaries and such, but there is a big disconnect for me right now with what I did there vs what I am fumbling around with in this VB.net code.

    I did learn the hard way that trying to evaluate to NULL doesn't work though! Which makes sense but it really threw me for a loop at first.

    vamen on
  • Options
    thatassemblyguythatassemblyguy Janitor of Technical Debt .Registered User regular
    *takes a long drag on a cigarette*

    Least bad? Those were the days.
    vamen wrote: »
    I am new enough that I can only BARELY grasp what you mean by that =). But I have made a note to read up!
    EDIT - I was actually recently doing a tutorial in Python about lists and dictionaries and such, but there is a big disconnect for me right now with what I did there vs what I am fumbling around with in this VB.net code.

    I did learn the hard way that trying to evaluate to NULL doesn't work though! Which makes sense but it really threw me for a loop at first.

    Think about it like a bucket. None/Null/nil/0 mean there is no bucket. Empty means the bucket exists, but there's nothing in the bucket.

  • Options
    InfidelInfidel Heretic Registered User regular
    Also don't feel bad or discouraged by this, some of us have to deal with coworkers and explain this distinction over and over again in real-world jobs blererrrrrrrgh.

    "What? Why the fuck is it returning NULL for no items? WHY DO YOU DO THIS TO ME??"

    In general, when you're working with your data, "sometimes a list sometimes not" is a code smell that you probably have something wrong with your design. It's just like "this is sometimes a string sometimes an integer" with similar implications, it's not necessarily wrong but if you don't have a good reason for it you best fix that shit.

    OrokosPA.png
  • Options
    bowenbowen How you doin'? Registered User regular
    Though this is why almost every time I check for empty, I check for null first, because what will it return? Who knows!

    Doing both takes me almost no extra time and saves my grief from having to fix it later too.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    InfidelInfidel Heretic Registered User regular
    bowen wrote: »
    Though this is why almost every time I check for empty, I check for null first, because what will it return? Who knows!

    Doing both takes me almost no extra time and saves my grief from having to fix it later too.

    That's the "be strict in what you output and lenient in what you input" principle which is good defensive practice.

    If you're the one making the output, stop shitting it up with null!

    If you're the one parsing the output, well, better check cause shitters be shitting rite?

    OrokosPA.png
  • Options
    thatassemblyguythatassemblyguy Janitor of Technical Debt .Registered User regular
    I like the truthy/falsey kinds of evaluations in some languages. It's been a while since I've fired up my androidstudio, but Kotlin was adopting some syntax sugar to enforce things like, null, null+empty, etc.

  • Options
    InfidelInfidel Heretic Registered User regular
    This is especially important in the web land of RFCs and "standards" being decades of convention underpinning them.

    OrokosPA.png
  • Options
    vamenvamen Registered User regular
    I got into the habit of doing that when I started SQL. The db I took over at first was a bit of a mess. A lot of values that had blanks or that should have been trimmed and weren't, etc. So I got into the habit of pretty much always doing WHERE field IS NOT NULL and field <> '' etc etc.
    Good times.

    Heck, just the other day I fell for it in SQL even though I know better. I was trying to find any results where a field wasn't Y so I did WHERE field <> 'Y' and only got one result, which I knew was wrong, but for a bit it stumped me until I realized, oh right, the other values aren't 'N' but they are NULL instead.

  • Options
    thatassemblyguythatassemblyguy Janitor of Technical Debt .Registered User regular
    Infidel wrote: »
    bowen wrote: »
    Though this is why almost every time I check for empty, I check for null first, because what will it return? Who knows!

    Doing both takes me almost no extra time and saves my grief from having to fix it later too.

    That's the "be strict in what you output and lenient in what you input" principle which is good defensive practice.

    If you're the one making the output, stop shitting it up with null!

    If you're the one parsing the output, well, better check cause shitters be shitting rite?

    This is a good heuristic but less useful in some embedded stuff - NULL as a return value tends to be efficient for things like, "When I asked for that CPU resource, did I get it? NULL is no, pointer to somewhere in the memory map is yes."

  • Options
    InfidelInfidel Heretic Registered User regular
    Infidel wrote: »
    bowen wrote: »
    Though this is why almost every time I check for empty, I check for null first, because what will it return? Who knows!

    Doing both takes me almost no extra time and saves my grief from having to fix it later too.

    That's the "be strict in what you output and lenient in what you input" principle which is good defensive practice.

    If you're the one making the output, stop shitting it up with null!

    If you're the one parsing the output, well, better check cause shitters be shitting rite?

    This is a good heuristic but less useful in some embedded stuff - NULL as a return value tends to be efficient for things like, "When I asked for that CPU resource, did I get it? NULL is no, pointer to somewhere in the memory map is yes."

    Just talking about empty vs existing, and using null for empty still.

    Null absolutely has a place and I hate it when I don't have a proper null type.

    OrokosPA.png
  • Options
    bowenbowen How you doin'? Registered User regular
    Yeah if I'm using someone else's api, I trust them 0%.

    If I'm making my own, that shit's gonna be waterproof.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    I hate null, but when you're operating in C++ and Python land...there's no getting around it.

    But wherever possible I try to make it impossible to either accept or return null because those checks are stupid boilerplate.

  • Options
    CampyCampy Registered User regular
    edited August 2020
    I love MS' decision to introduce nullable reference types into C# 8, truly the best of both worlds!

    Campy on
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    Oh no

  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    It's named poorly. Reference types can be null in C# already, the new stuff is optional checks to ensure not null.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    vamenvamen Registered User regular
    Ugh. I got this working the WRONG way. And I'm not proud of it. But I think I've been looking at it too long. I'm going to call it a day and come back to it Monday and hopefully make a breakthrough.

  • Options
    CampyCampy Registered User regular
    edited August 2020
    It's named poorly. Reference types can be null in C# already, the new stuff is optional checks to ensure not null.

    Exactly this. Means that things you want nullable can actually be nullable, while removing the accidental ones which cause approximately 1 million exceptions to be thrown per second around the world.

    Edit: It is a spectacularly bad name though, yes.

    Campy on
  • Options
    dporowskidporowski Registered User regular
    Optionals (Swift's name) are so so beautiful. Is it nil? No, it's got no bloody ? in the type annotation. Done.

This discussion has been closed.