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/

[Programming] Page overflow to new thread

11011131516101

Posts

  • OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    If they're counting braces, they're an asshole.

  • dporowskidporowski Registered User regular
    Orca wrote: »
    If they're counting braces, they're an asshole.

    I meant me! Things don't run well if you skipped one...

    Hell, in a sane world they'd all just be pseudocode anyway.

  • a5ehrena5ehren AtlantaRegistered User regular
    edited July 2019
    The ones I've had recently all use Coderpad or similar, which will do auto-braces and indents for you in the browser. Even a small bit of auto-complete if you're using the right languages.

    It made it marginally less terrible, but I still failed them all.

    I have an onsite tomorrow at a place that didn't do a code screen at all, but they don't really pay at Big Tech levels, either.

    a5ehren on
  • a5ehrena5ehren AtlantaRegistered User regular
    edited July 2019
    But yeah, if I end up trying that route again, I'm definitely going to have to spend a bunch of time learning a language that has all this data stuff built in. I got to a second code screen at one place by at least doing C++ and sitting there with http://www.cplusplus.com/reference/ open.

    Python/Java/C# or similar - trying to do these homework problems with a time limit in a language (C, in my case) that doesn't have them is pretty brutal, especially when the person on the other end doesn't know it.

    a5ehren on
  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    edited July 2019
    dporowski wrote: »
    Orca wrote: »
    If they're counting braces, they're an asshole.

    I meant me! Things don't run well if you skipped one...

    Hell, in a sane world they'd all just be pseudocode anyway.

    That's a great idea, actually. When I'm interviewing people, I care more about their thought process than I do the code they write.

    Ear3nd1l on
  • LD50LD50 Registered User regular
    ASimPerson wrote: »
    I did a phone screen today where the candidate straight-up admitted he learned Python to make coding interviews easier. While I hate coding interviews as much as the next guy, nothing about the job I'm hiring for involves Python on any way. That said, I also have to admit that the questions I ask are more about the algorithm and data structures used rather than implementing a hash table from scratch, but for some reason I still feel a bit torn between that seeming somewhat intellectually dishonest and learning Python myself to see if it'd help me with my own interviews.

    I guess at the end of the day coding interviews are still bullshit and we collectively need to think of something better.

    I think this is 100% ok/acceptable. Boilerplatey languages like Java or C are terrible for doing interviews, especially when you're forced into coding in a different environment without your computer and editor profiles or in a web browser or whatever.

    The point of the code interview is to test the applicants foundational understanding of programming as a concept, not to evaluate a specific language proficiency. If the candidate can express themselves more quickly in Python or something, it's a flat out better tool for that use case.

    I'd even say that his ability to recognize the need to switch tools is a plus.

  • vamenvamen Registered User regular
    edited July 2019
    Sorry for posting so much on this thread lately =).
    I'm tearing my hair out. I realize this coding stuff is a new skill, but I don't think I've ever felt so dumb while trying to tackle a problem in my entire life. Or maybe ever. any problem in my life that has been hard has always been, "well, I'll figure it out eventually" but man, with this I find myself saying, "....maybe I just don't have the right brain for this type of work."

    It's overwhelming being thrown into all this and trying to figure it out at once. If ALL I had to learn was VB or something, it'd be one thing. But I'm having to learn HTML, CSS, ASP, VB, and some JS all in one fell swoop plus figure out how they interact. It's frustrating =p.

    Anyhoo, maybe someone can spot my logic failing here. I have a listbox that is returning a value that I am trying to save to a db table. In a previously existing save function, I am able to save the data with no problem, but I need it in its own table due to how I need to tie it to other info. But I at least know the variable is getting the info at least. I know you can use msgbox to see that info, which sounds amazingly useful, but I sure haven't figured out how to actually make it initialize =p.

    So I have this in my ASP codebehind VB file:
    Dim saveconditions As Boolean = ufunc.SaveConditions(txtid, conditionLvl)
    Which passes over a unique ID and a condition ID (which is simply sequential starting at 1).

    And this big chunk is what I have in the dao.vb file:
    paaq44omlznz.jpg

    Quite frankly, I got 90% of this using existing code. There's no way I'd have figured it out from scratch.
    Right now I'm struggling because the delete portion works just fine; if it sees the same ID, it will remove that record from the table. It also worked in combination with the condID before I commented it out. Which is awesome.

    However, the insert portion doesn't work at all, and I don't get why. I've even tried to put the insert statement where the delete is and still nada.


    If anyone sees any obvious logic problems I am overlooking, I would worship the ground you walk on.

    The scary part is once I get this actually saving, I'm going to have to figure out how to loop through the data (which was all the commented out stuff I was messing with) so I can get the individual items. Oi
    But one step at a time.


    vamen on
  • EchoEcho ski-bap ba-dapModerator mod
    vamen wrote: »
    but I don't think I've ever felt so dumb while trying to tackle a problem in my entire life. Or maybe ever. any problem in my life that has been hard has always been, "well, I'll figure it out eventually" but man, with this I find myself saying, "....maybe I just don't have the right brain for this type of work."

    I can assure you most developers think that twice a week.

  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    First thing is to check the reference to the table. In your INSERT statement, you refer to it as:
    Events.dbo.tblEvent_Conditions
    

    but in the DELETE and SELECT statements, it is referred to as:
    dbEvents.dbo.tblEvent_Conditions
    

    Also, typically INSERT INTO statements need a list of columns to insert the data into:
    "INSERT INTO dbEvents.dbo.tblEvent_Conditions (event_id, condition_id) VALUES (" & iid & ",'" & condid & "')"
    

    I AM a bit rusty with SQL though, so take that with a grain of salt.

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    edited July 2019
    Echo wrote: »
    vamen wrote: »
    but I don't think I've ever felt so dumb while trying to tackle a problem in my entire life. Or maybe ever. any problem in my life that has been hard has always been, "well, I'll figure it out eventually" but man, with this I find myself saying, "....maybe I just don't have the right brain for this type of work."

    I can assure you most developers think that twice a week.

    Imposter syndrome is real. I'm a well respected lead/architect level engineer in my area. I feel imposter syndrome regularly, questioning whether I am good enough for the responsiblity people give me.

    GnomeTank on
    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • SpawnbrokerSpawnbroker Registered User regular
    @vamen I can barely read VB code, but I know a little bit about the .NET SQL interop classes.

    I know this sounds dumb, but could you try using SqlDataAdapter.InsertCommand instead of SqlDataAdapter.SelectCommand? Some of these old .NET classes are stupid like that. Since you want to insert data, it might be expecting the InsertCommand property to be set.

    Steam: Spawnbroker
  • kimekime Queen of Blades Registered User regular
    LD50 wrote: »
    ASimPerson wrote: »
    I did a phone screen today where the candidate straight-up admitted he learned Python to make coding interviews easier. While I hate coding interviews as much as the next guy, nothing about the job I'm hiring for involves Python on any way. That said, I also have to admit that the questions I ask are more about the algorithm and data structures used rather than implementing a hash table from scratch, but for some reason I still feel a bit torn between that seeming somewhat intellectually dishonest and learning Python myself to see if it'd help me with my own interviews.

    I guess at the end of the day coding interviews are still bullshit and we collectively need to think of something better.

    I think this is 100% ok/acceptable. Boilerplatey languages like Java or C are terrible for doing interviews, especially when you're forced into coding in a different environment without your computer and editor profiles or in a web browser or whatever.

    The point of the code interview is to test the applicants foundational understanding of programming as a concept, not to evaluate a specific language proficiency. If the candidate can express themselves more quickly in Python or something, it's a flat out better tool for that use case.

    I'd even say that his ability to recognize the need to switch tools is a plus.

    Yup! Coding interviews are dumb, but they are only more dumb if you have a specific language you require it to be in.

    The only reason I'm hesitating to recommend it in general (since you expressed interest, ASimPerson) is because some people expect you to be intimately familiar with the specific quirks and exact tools of whatever language you're using, so it is often best to just do what you use the most.

    Battle.net ID: kime#1822
    3DS Friend Code: 3110-5393-4113
    Steam profile
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Echo wrote: »
    vamen wrote: »
    but I don't think I've ever felt so dumb while trying to tackle a problem in my entire life. Or maybe ever. any problem in my life that has been hard has always been, "well, I'll figure it out eventually" but man, with this I find myself saying, "....maybe I just don't have the right brain for this type of work."

    I can assure you most developers think that twice a week.

    Also: what idiot wrote this code, it's terrible!

    Oh, that was me

  • vamenvamen Registered User regular
    edited August 2019
    Well you guys definitely made me feel better about how dumb I've been feeling, thanks for that. I can feel comforted in the camaraderie =).

    And OH MY GOD Ear3nd1l ... I left off the db part of dbEvents. I'm not at work to test it, but that's exactly the sort of small, silly thing that has defeated me in the past. I bet that's the ticket.
    It would help to have two pair of eyes for this sort of thing. I stared at that code all day and didn't see it but you probably noticed it right away.

    Spawnbroker - I'm only using the current command because I found an insert using it elsewhere in the code, but that will be worth a try!

    Phyphor - I have a feeling I'll be saying that to myself QUITE a bit.

    vamen on
  • dporowskidporowski Registered User regular
    a5ehren wrote: »
    The ones I've had recently all use Coderpad or similar, which will do auto-braces and indents for you in the browser. Even a small bit of auto-complete if you're using the right languages.

    It made it marginally less terrible, but I still failed them all.

    I have an onsite tomorrow at a place that didn't do a code screen at all, but they don't really pay at Big Tech levels, either.

    Fuck, last time I used Coderpad it most assuredly did not... ANY of it. It highlighted a few things, but with no real sense I could see.

  • TelMarineTelMarine Registered User regular
    I've been trying to come up with more real world-like scenarios for coding interviews or I ask simpler questions just to see if the person can do some coding or not. I agree with all of you, coding interviews suck.

    3ds: 4983-4935-4575
  • EchoEcho ski-bap ba-dapModerator mod
    In fact, I'd say that one of the most vital skills for a developer is to take an "oh shit I can never solve this" problem and be able to break it down into approachable chunks and figure out a good place to start. That's definitely something you get better at with time.

  • CampyCampy Registered User regular
    Phyphor wrote: »
    Echo wrote: »
    vamen wrote: »
    but I don't think I've ever felt so dumb while trying to tackle a problem in my entire life. Or maybe ever. any problem in my life that has been hard has always been, "well, I'll figure it out eventually" but man, with this I find myself saying, "....maybe I just don't have the right brain for this type of work."

    I can assure you most developers think that twice a week.

    Also: what idiot wrote this code, it's terrible!

    Oh, that was me

    If I'm lucky then I commented at the time that this was written fast due to being pushed through by management and it's not my fault I swear!

  • CampyCampy Registered User regular
    Echo wrote: »
    In fact, I'd say that one of the most vital skills for a developer is to take an "oh shit I can never solve this" problem and be able to break it down into approachable chunks and figure out a good place to start. That's definitely something you get better at with time.

    One good coding interview I had was very much based around this idea. It was to write code to find all possible solutions for a "Countdown Maths Puzzle" from a very popular long running TV show here, i.e. everyone will know the problem. On first glance it seems fairly solvable, but then you start working through the permutations and you realise that it's muuuuuch more complicated than it first seems. The whole point of the exercise was to see if you got through to the this-is-going-to-take-ages part and why it is that way. I think it helped that the interviewers were both super friendly and encouraging, so I didn't feel overwhelmed when going through it.

    The interview I had for my current role was pretty good too. It was for a C# dev role; for the code test itself they gave me a few basic classes and told me to refactor them so they were testable. The fact the classes were already there massively reduced the amount of boilerplate time wasting and got me straight to the meat of the problem.

  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    edited August 2019
    I had a coding interview a few years ago where the guy kept giving me these "challenges" and explained them in the most convoluted ways possible. Most of the time I had absolutely no idea what he was talking about. The guy was so ridiculously arrogant and nothing I said was right in his mind (even if I quoted documentation). I've been writing software for almost 25 years now, and this is the only time I have ended a job interview myself. I was completely humiliated and spent the next week thinking I was unemployable.

    That was not long after I was berated in another interview because in college I majored in Art rather than CS. Good times...

    Ear3nd1l on
  • vamenvamen Registered User regular
    Oh man, your good eye fixed my problem, Ear. I updated my table this morning and BOOM, everything saved.
    It saves like "1,2,3" instead of a record for 1, a record for 2, a record for 3, but hot damn, it's just nice to make SOME progress. At least I have a new problem to figure out and I'm one step closer to my goal.

    I can't believe how hard it has been for me to get a multi-select listbox to work =p. Hopefully I'll look back on this one day and laugh.

  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    edited August 2019
    You will. And some day you will do what all of us do, look back on old code and ask yourself what the $%^#$% you were thinking! lol

    Ear3nd1l on
  • SpawnbrokerSpawnbroker Registered User regular
    @vamen It gets easier. It gets a lot easier when you aren't thrown into the deep-end with no mentorship to build on top of already existing legacy code!

    Steam: Spawnbroker
  • vamenvamen Registered User regular
    In this case, I'll be thinking, "I just wanted to get it working so I could keep my job" =p.

  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    @vamen It gets easier. It gets a lot easier when you aren't thrown into the deep-end with no mentorship to build on top of already existing legacy code!

    Yeah, this is kind of a nightmare scenario.

    @vamen We're always here to help you. Not many of us learned in a vacuum, so I think we're all happy to provide advice.

  • vamenvamen Registered User regular
    Spawn - code that has NO comments, at that! =)

    Ear - Much appreciated! I was trying not to dominate the thread but I guess chatter is what it is for. Thanks!

  • vamenvamen Registered User regular
    I got it where it will cycle through my string and insert the individual items into a unique row in my table.
    Now I just need to figure out how to make the listbox items actually show up as selected when a record is loaded and I'll actually be done with this part.

    Woo!

  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    https://asp-net-example.blogspot.com/2013/12/aspnet-listbox-set-selected-items.html

    This should get you on the right track. It's in C#, but it will give you the general idea.

  • vamenvamen Registered User regular
    edited August 2019
    Ooo this site seems like it will be a great resource in general. I find it difficult to understand the Microsoft tech sites that explain coding stuff. Blog style works a lot better for me right now at my current level of understanding.
    Thanks!

    vamen on
  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    My pleasure. (No, I do not work for Chick-fil-a)

  • gavindelgavindel The reason all your software is brokenRegistered User regular
    Software documentation gets so neutered by the time it sees the outside world, half the time I don't recognize what I wrote!

    Unfortunately, all those omitted edge cases and points of failure are the part other developers want...

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    I had a project last year where they told me to remove the comments, because "good code should document itself..." :rollseyes:

  • OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    edited August 2019
    Ear3nd1l wrote: »
    I had a project last year where they told me to remove the comments, because "good code should document itself..." :rollseyes:

    I tell people to do this when it's something like:
    // add offset to base address
    reg_addr = BASE_ADDRESS + OFFSET
    

    Why would you add the comment

    why

    Orca on
  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    Well, yeah. I agree with that. But they didn't care what kind of comments they were, they wanted them all stripped. There's a reason every consultant before and after me eventually told them to fly a kite.

  • EchoEcho ski-bap ba-dapModerator mod
    edited August 2019
    There's some sort of point that good code is obvious in what it does... but I see comments as saying why it's doing it.

    (and it's still way easier to read a comment than parse a big chunk of code)

    Echo on
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    The real danger is when the code changes but the comments don't so the comments are wrong

  • Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    I will admit, I have been accused of "over-commenting", but I find that far more preferable to the alternative.

  • LD50LD50 Registered User regular
    life←{
        ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵
    }
    

  • GnomeTankGnomeTank What the what? Portland, OregonRegistered User regular
    I find over commenting to be really frustrating. You're making your code harder for me to read, not easier. I don't need the why of every detail of the code. Only put comments in places you think something is confusing, or in a block at the start of something. When I'm trying to read and grok a big chunk of code and seemingly every line has a comment it's distracting and unhelpful.

    Sagroth wrote: »
    Oh c'mon FyreWulff, no one's gonna pay to visit Uranus.
    Steam: Brainling, XBL / PSN: GnomeTank, NintendoID: Brainling, FF14: Zillius Rosh SFV: Brainling
  • DehumanizedDehumanized Registered User regular
    Comments are code that the parser and compiler can't verify for you, and therefore should be regarded with suspicion

This discussion has been closed.