I started a new job today...



  • ...and now I feel like a complete programming novice :( . Is it usual to feel completely out of your depth when starting at a new company?


  • FoxDev

    While learning the company's existing software? Seems normal to me ;)



  • @RaceProUK said:

    While learning the company's existing software?

    Yup, and the large number of tools that I haven't used before. I'm going to have a difficult few weeks I think.


  • Fake News

    When I started at my current client... well, it was like a firehose, to quote my client-side manager. It still is, but I've figured out how to deal with it.



  • And you're here already? :wtf:

    Congratulations, tho, and good luck.



  • Thanks. I don't think there will be many WTFs coming from here. They have pretty solid processes in place and they're improving them all the time. It's just a bit of a shock going from knowing everything about all of the applications to not even being able to figure out how to check out code, or which code to look at.



  • Although I did manage both of those things by the end of the day. (Go me!)



  • Give it time. I was a little intimidated by the company that I started at late last year. They had 3600 unit tests. I'd never seen so many tests. Sounded good.

    Half the tests are crap like

    [TestMethod]
    void TestCtor()
    {
        var obj = new SomeClass();
        Assert.AreEqual(ExpectedDefaultValue, obj.Prop);
    }
    

    Great...

    Or only the happy path is getting tested and edge cases are not considered. So despite the huge pile of tests, bugs still get through with regularity.

    The database is full of incomplete data migrated from the old system. The cause of many of those bugs.

    No restore strategy for multi-million dollar system. Hasn't been a problem yet!

    People are running as many as 3 VMs on their consumer laptops while only working on the one project. I appreciate the use of VMs, but seriously, just put Office on the host and you can run 1 less VM.

    Someone decided to duplicate the entity framework data models/context between the web and the background worker process, so then all the DAOs got duplicated, all the business objects got duplicated, all the almost everything got duplicated including things that didn't need to be duplicated so a change has to be made in at least 2 or 3 different places.

    Lots of comments like this:

    /// <summary>Gets a customer by id.</summary>
    /// <param id="customerId">A customer id.</param>
    /// <return>A customer</return>
    Customer GetCustomerById(int customerId)
    {
    ...
    }
    

    Shit, is that what it does!?



  • Maybe for a week or two.


  • FoxDev

    @Bort said:

    Half the tests are crap like

    [TestMethod]
    void TestCtor()
    {
        var obj = new SomeClass();
        Assert.AreEqual(ExpectedDefaultValue, obj.Prop);
    }
    ```</blockquote>
    Testing the constructor assigns the correct default values is a crap test? :wtf::question:


  • That has been my experience. How long it takes to no longer feel that way depends on the abilities of my co-workers.



  • Yup. It'll probably take at least a few months of full-time work to really get to know everything in any kind of depth.

    But hey, what is the job of a software engineer if not to dive head-first into a pile of crap and figure everything out?



  • I've been here about two months, and I don't know if I'll ever get over hand editing XML that generates C# that generates XML.


  • FoxDev

    @Magus said:

    hand editing XML that generates C# that generates XML



  • I'd be afraid if anybody ever got used to that or thought that it was a good idea



  • The resulting XML has function calls, conditions, and the ability to apply to a collection.

    We have no XML schema, but we get told what we can update through XML pasted in word documents uploaded to sharepoint, which don't tell us what within the document changed unless someone feels like it.

    There are about 16 of these word documents, which all refer to different sections of the resulting message, and often overlap.


  • FoxDev

    @Magus said:

    The resulting XML has function calls, conditions, and the ability to apply to a collection.

    …why?
    @Magus said:
    We have no XML schema, but we get told what we can update through XML pasted in word documents uploaded to sharepoint, which don't tell us what within the document changed unless someone feels like it.

    …why??
    @Magus said:
    There are about 16 of these word documents, which all refer to different sections of the resulting message, and often overlap.

    …WHY‽‽‽



  • I started a new job today...

    Sucker.



  • That's what I want to know. They seem to have C# in parts of the application, and I'm hoping to get put on those parts before my mind melts. Still, I like the people and the environment.

    I figure a codebase thats been added to over three decades is going to be a mess anyway, but they're doing fairly well. They wrote a system to call C# from their in-house language so that they can do new development in C# where possible, which is fairly cool. But you still have to interact with the stringly-typed global table all the data is stored in.



  • Does anything about this seem odd to you?

    int Inc(int x)
    {
        return x + 1;
    }
    
    [Test]
    void TestInc()
    {
        const int x = 1;
        Assert.AreEqual(x + 1, Inc(x));
    }
    

    That's not taken from our code base, but it's a similar principle.

    This is like what I described earlier:

    class Point
    {
        Point(int x, int y) { X = x; Y = y; }
        Point() { X = 0; Y = 0; }
        int X { get; set; }
        int Y { get; set; }
    }
    
    [Test]
    void TestPointDefault()
    {
        var p = new Point();
        Assert.AreEqual(0, p.X);
        Assert.AreEqual(0, p.Y);
    }
    

    That's a crap test. If you're testing your code by just duplicating it and comparing the results, that's crap. It's crap that doesn't tell you anything useful, breaks when you make a necessary change, and worst of all, it doesn't break when it needs to.

    If you're going to have a test that only covers a single method, it would need to contain a fairly complicated algorithm.



  • I was looking through the Roslyn code and I'm not sure, but it looks like they too use XML to generate C#:

    And then there are a bunch of partial classes to add to the properties/methods generated from the XML:

    I bet the Roslyn team really wishes they had macros right about now... :trollface:



  • They do. I was reading about that on Eric Lippert's blog today, in fact. It's to do with how repetetive the visitor pattern is, apparently. But that C# doesn't then generate new XML, so it's fine.

    @Bort said:

    I bet the Roslyn team really wishes they had macros right about now...

    I do too.



  • Doesn't whatever shitty language you use have a QuickCheck library?



  • FsCheck is usable from C#.

    As usual, the holdup isn't technical, it's social.



  • Why are you still there?



  • @Magus said:

    It's to do with how repetetetetetetive the visitor pattern is, apparently.

    That's really a job for multimethods.


    The visitor pattern is especially despicable. I'm partial to the notion that these patterns are workarounds for language shortcomings.


  • Grade A Premium Asshole

    @Keith said:

    Is it usual to feel completely out of your depth when starting at a new company?

    New policies, new procedures, new technologies, new people, new management styles, new coding styles, new...everything.

    Yes, it is absolutely normal. You will recover more quickly this time around, and you will recover even more quickly the next time around.

    The fact that you feel so much like a fish out of water just proves that you were far overdue for a change. In our field, moving from company to company with a fair amount of regularity is good for you, and good for the businesses. You will learn new things from this company and they will learn things from you that you have picked up along the way in your travels. A technology company without turnover is dying and a tech worker that spends too much time working for one company becomes complacent and stops growing.

    In a week or two, you will either fall right in to place or realize that you cannot stand them and start your job hunt again. Let's hope for #1. Good luck. 😄



  • Oh, yeah... just last week, one of our resident gurus (a guy who is actually pretty smart) insisted that reference types are pass-by-reference by default in C#. *

    I immediately tried to shut him down lest this ignorance infest the rest of the crew, but I didn't have any references on hand. He was unconvinced and the rest of the team was left confused.

    *Well, then what are the ref and out keywords for when used with a reference type?

    I guess he'd never seen ref or out used with a non-value type before...


  • FoxDev

    @Bort said:

    Oh, yeah... just last week, one of our resident gurus (a guy who is actually pretty smart) insisted that reference types are pass-by-reference by default in C#.

    They are pass-by-reference; they're reference types.
    @Bort said:
    Well, then what are the ref and out keywords for when used with a reference type?

    out works the same way as with value types.
    ref is the oddball; if you assign a new object inside the method, then when you return, the variable you passed in refers to the new object, not the old one.



  • @RaceProUK said:

    They are pass-by-reference; they're reference types.

    Nope, but it is a common misconception. C# passes all things by value, but the value in this case is essentially a pointer.

    @RaceProUK said:

    ref is the oddball; if you assign a new object inside the method, then when you return, the variable you passed in refers to the new object, not the old one.

    That's not odd. You're changing the value of the reference.

    The distinction isn't usually important, but why be wrong if you don't have to be? Just because it's 'sort of like passing by reference'?


  • FoxDev

    @Magus said:

    C# passes all things by value, but the value in this case is essentially a pointerreference.

    Pointers are a separate thing in C#, and can only be used inside unsafe blocks 😛



  • Oh I know, but that's still how I feel like explaining it. Passing a reference by value is confusing wording to people who assume that that means pass by reference.



  • @RaceProUK said:

    They are pass-by-reference; they're reference types.

    FALSE.

    You're passing a reference, you're not passing by reference.

    You're passing a reference by value.

    List<String> is a reference type. By default, the pointer/reference to it is passed by value, so if I pass it to another method, that method can change the list that I'm also pointing to, but it can't change which list I'm pointing to. When passed using ref, it actually change the list my variable in the calling scope points/refers to. Only the latter is pass-by-reference.

    I know it's confusing.

    Consider:

    string x = "hello";
    Method(x);
    

    If x were passed by reference, it would be possible for x to refer to a different object after Method is complete. But it's not possible, so it's not pass by reference.

    x could end referring to a different object in this situation:

    string x = "hello";
    Method(ref x);
    

    Because that's pass by reference. But it requires the ref keyword, so pass by reference is not the default.

    Also consider that both value types and reference types can be passed by reference with ref.

    Also note that it's possible to write Method("hello"), which is the argument was being passed by reference, wouldn't make any sense.


    Actually, Ignore all that.

    I should just defer to Jon Skeet, who did a through write up on this. Spoiler warning: he disagrees with you. As does everyone who knows what they're talking about.



  • PROTIP:

    Use VB.NET when dealing with people who don't understand by value vs. by reference

    It has dedicated keywords. (ByVal / ByRef)



  • Christ! Why am I volunteering to have this argument all over again!? Did I think people would just get it and not spew ignorance all over the place!?! Look it up people, fuck! We're on the fucking internet already! Reliable sources are only a click away!



  • C# has a keyword for doing pass-by-ref, but people think it's still pass-by-ref even if you don't use the KEYOWR D QRGR AARGRGARRG AAAA!



  • It's probably just that in the general case, you can't tell the difference. But I'd say the majority of people don't know the difference.



  • Which is why they're able to go on writing functional code...

    Which is why I should not have brought it up...

    Where's the nearest liquor store?


  • FoxDev

    @Bort said:

    You're passing a reference by value.

    And passing the object by reference.



  • You're not passing the object at all.



  • But a reference to the object?


  • FoxDev

    @Bort said:

    You're not passing the object at all.

    I'm passing a reference to the object, ergo I'm passing the object by reference.

    In other words, I'm telling the callee 'this object is over there'.



  • Yes, and you're passing the reference (implemented as a pointer, but we're not supposed to know that) by value.

    I know that "passing a reference" sounds like "passing by reference" but the later phrase has a specific meaning that is being misused when...

    @RaceProUK said:

    I'm passing a reference to the object, ergo I'm passing the object by reference.

    Goodnight.



  • @RaceProUK said:

    I'm passing a reference to the object, ergo I'm passing the object by reference.
    As much as it would be nice if those were synonyms, they are not.

    See, for example, http://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value

    (I'm picking Java over C# for that so that ref and out don't confuse the issue.)

    The quick and simple test of "am I pass by reference" is whether

    void swap(Something a, Something b) {
        Something t = a;
        a = b;
        b = a;
    }
    
    void caller() {
        Something s1 = ...;
        Something s2 = ...;
        swap(s1, s2);
    }
    

    will result in caller's s1 and s2 being swapped. If it will not, then swap's parameters are not passed by reference.


  • FoxDev

    So, there's no such thing as passing an object by reference, because some Java die-hards have sand in their vaginas? Because that's what it reads like to me.



  • You can pass a reference type by reference if you use the ref keyword. But no, it's not done in Java to my knowledge. You could simulate it with a wrapper object, I suppose.

    And it's not just some Java dorks that disagree with you, it's the entire language design world. This terminology has had an established meaning for decades.

    Go find a reliable source that supports your use of the term and we'll have an actual debate.


  • FoxDev

    @Bort said:

    You can pass a reference type by reference if you use the ref keyword.

    I know I can pass a reference by reference. But what I don't see is the distinction between passing a reference by value, and passing an object by reference; to me, they're the same operation.



  • @RaceProUK said:

    But what I don't see is the distinction between passing a reference by value, and passing an object by reference; to me, they're the same operation.
    I edited my previous post with a swap example.

    @RaceProUK said:

    So, there's no such thing as passing an object by reference
    In Java, you can't pass an object by reference, that is correct, because you can never have an object in the first place -- only a reference to it. In C# the same is true of class types, but not struct types; when I have a variable of a struct type I have the actual object, not just a reference to it, so if I pass it to a function that takes a ref parameter I'm passing the actual object by reference.

    Here's a table, using C#ish syntax:

    struct SomeStruct {}
    class SomeClass {}
    
    foo(SomeStruct     struct_object_passed_by_value,
        SomeStruct ref struct_object_passed_by_reference,
        SomeClass      object_reference_passed_by_value,
        SomeClass  ref object_reference_passed_by_reference)
    

    And this isn't just pedantry for many languages because it matters: parameters that are passed by reference can change the actual argument in the caller (as in swap) and parameters that are passed by value can't. And just like repointing an object reference to a new object (a = b) and changing the pointed-to object are very different, so are passing a reference by value and passing by reference to something. swap(Something a, Something b) is very different than swap(Something ref a, Something ref b).



  • The same difference as having a function parameter be int* or int** in C.


  • FoxDev

    @EvanED said:

    you can never have an object in the first place -- only a reference to it

    So… I can have a reference to something I can't have… except I do have the thing I can't have, else what on Avalice is the reference referring to?


Log in to reply