I think I know what makes a truly competent programmer



  • After some recent experiences, I think I came to a conclusion on what to expect from a senior programmer.

    If you call yourself a senior programmer but your software has problems working in different timezones, across timezones, and on leap years, or if your software has problems working with charsets other than ASCII or Latin-1, or you don't quite understand how rounding errors accumulate, you should hand your "senior developer" badge over immediately.

    It's worth jack shit how many technology stacks you know if you develop for real world and don't know how it works.


  • I survived the hour long Uno hand

    @wft "Use JodaTime". Am I a 1/3 of a senior Java developer now?


  • area_can

    @Yamikuronue I tried npm install joda-time but that didn't work :(

    Edit: has anyone written a java-to-js transpiler on npm ??


    Filed under: ugh I feel gross for using the word 'transpiler' even ironically



  • @Yamikuronue I don't know what "JodaTime" is. I know developers on my projects keep "fixing" timezone problems all the time and there's no end to it. Apparently, these developers have gobs of experience each. Very seniorish developers, may I say.

    I sincerely hope they won't need to work in locales other than en-US. Which may be the case. Which the product is totally unprepared to handle.



  • @Yamikuronue also, the most recent and very hilarious bug in iOS which makes the clock go backwards if you set it to 1970-01-01. Which is what you can't do via UI, but is totally possible via NTP.



  • I've worked on a system before where the lead senior developer has constructed such a jenga tower of baklava code that even his own juniors sometimes complain about how difficult any given task has become.

    The jenga tower description is because when he was asked to add another bit of logic to a specific business rules engine, his response was "It's already so complex, I'm afraid that any changes we add here might break the whole engine."

    We were stunned. Good senior developers don't code themselves onto such a precariously placed tower where one change threatens to topple the tower. And this is just one of the instances where he's outright tried to convince the customer into a more complex method because his code can't handle the (relatively) simple request. In this instance, we had complex building blocks for a relatively simple problem.

    There's also the problem about how the schema of the database doesn't allow for optimized queries, or even storage of data.

    And none of this has even the slightly forgivable result of a good UX. Users constantly tell us that it's hard to find some data, or that the system is slow, or that the system is just wrong (as plainly as that).

    And then the worst of it all is that the system is so reliant on practises from one country in this international firm. From things like currencies, to business processes for similar entities, to the fact that the system will eventually be rolled to countries where English isn't the preferred language. The bigwigs are oblivious to the amount of effort this will take to take it to the other localisations, but it's the kind of effort that almost justifies a complete rewrite...

    Wow, I was wondering whether or not to post, because this system has traumatized me so much that I go on a huge rant every time I think about it... I sure am glad I left that system a while ago :sweat_smile:


  • sockdevs

    @wft said in I think I know what makes a truly competent programmer:

    software has problems working in different timezones, across timezones, and on leap years

    Sockbot does everything in UTC and lets you convert to local if you care.

    my other projects... well the ones from work are getting better. all the new dev handles timezones just fine and the old, inherited code is slowly getting rewritten or updated so it does. I was handed a steaming pile of shite so it's taking time. As for my other personal ones. they either do everything in UTC or just care about one thing happening after the next and use the Unix Timestamp

    @wft said in I think I know what makes a truly competent programmer:

    your software has problems working with charsets other than ASCII or Latin-1

    Sockbot does everything in UCS2 (which is like unicode, only not) so... it'll have some problems if you try to give it codepoints off the BMP, but then so will most implementations of UTF8 and UTF16

    my other projects are in .NET so i'd have to work to make them non compatible with unicode. there are a few placed i made the effort, and for good reason.... I'm not about to let you put unicode in a domain name.Yes, i am aware of RFC 5890 and my response is you can convert your internationalized domain name into its xn-- form if you need an internationalized domain, because i've been bitten to many times by DNS servers who go "lol, wut iz nicode?". If someone eventually complains enough i'll "fix" this by adding a display filter that internationalized the domain on display and deinternationalizes it to its xn-- form on save. so far no one has complained

    @wft said in I think I know what makes a truly competent programmer:

    you don't quite understand how rounding errors accumulate

    they accumulate the same as they do in base 10 when you math with a fixed number of decimal places at every step, the only difference is that in base 2 any fraction that is not a power of 2* in the denominator is non terminating and will cause rounding errors

    * well.... not exactly. there are some fractions that are not powers of 2 for the denominator that terminate, because you can decompose it into a addition series of fractions with denominators that are powers of 2, and there are some powers of two fractions that will cause rounding error because the denominator is too big to store in an IEEE double


    ... i'm not sure where i was going with this... better put on the kettle for another cup of tea


  • sockdevs

    @AgentDenton said in I think I know what makes a truly competent programmer:

    baklava code

    huh. i don't think i've heard this term before.... I LIKE IT!

    /me wanders off to find away to use it in a report she's writing arguing for a complete rewrite of their CRM integration with their Billing system


  • :belt_onion:

    @bb36e did you try sudo? I heard sudo is the magic word!


  • sockdevs

    @Onyx sudo make me a sandwich


  • :belt_onion:

    @RaceProUK Ah-ah-aaah, you didn't say hunter2!



  • @accalia said in I think I know what makes a truly competent programmer:

    they accumulate the same as they do in base 10 when you math with a fixed number of decimal places at every step, the only difference is that in base 2 any fraction that is not a power of 2* in the denominator is non terminating and will cause rounding errors

    Not these errors. More of our decimal rounding errors.

    Imagine you have 10 fucktons of shit to recycle. You contract that to a company, they have a price of 102.40 Altarian dollars per fuckton, and it will take them 7 months to complete. And they demand monthly invoicing and payment. The total is 1024.00 Altarian dollars, right?

    So they work their asses in even chunks (reporting 1.42857142 fkt every month), and because it's impossible to pay the exact monthly amount (1024/7), you pay them 146.29, because that's how you round to pennies if you are a mathematician, or you pay them 146.28 if you use banker's rounding.

    In the first case, you end up overpaying 3 pennies, and underpaying 4 in the second case.

    You may bicker for pennies or not, but you have signed your contract for 1024.00 Alt$ exactly, and the point is that your monthly payments don't add up to that.

    Multiply this case by ~5000 (that's how many items you usually get in an engineering estimate to build something ambitious, like a piece of road complete with lighting, sidewalks, and crossings, an opera house, or a stadium), and these pennies might add up to a noticeable sum.


  • area_can

    @accalia what about leap seconds?



  • @accalia said in I think I know what makes a truly competent programmer:

    Sockbot does everything in UTC and lets you convert to local if you care.

    UTC has leap seconds! IAT is much better for actually measuring time.

    That's why some people are trying to get UTC redefined to be exactly the same as IAT (instead of, you know, actually switching to IAT).



  • @accalia said in I think I know what makes a truly competent programmer:

    Sockbot does everything in UCS2

    Really? How did that come about? I thought javascript used UTF-16.


  • sockdevs

    @wft said in I think I know what makes a truly competent programmer:

    Not these errors. More of our decimal rounding errors.

    yes.... those are the errors i described.

    they're the same error, it's just that the errors a lot less common in decimal because we tend to deal with decimals (also known as fancy fractions) that play nice and terminate early in decimal


  • sockdevs

    @boomzilla said in I think I know what makes a truly competent programmer:

    I thought javascript used UTF-16

    Nope, UCS-2


  • sockdevs

    @bb36e said in I think I know what makes a truly competent programmer:

    @accalia what about leap seconds?

    what about them? I'm either using dates in UTC for "this happened here as human readable" of i'm using timestamps for "this happened before that" and leapseconds leap forward so there's no issue there.

    @boomzilla said in I think I know what makes a truly competent programmer:

    I thought javascript used UTF-16.

    nope. it's UCS2, which is almost UTF16, but not quite.



  • @accalia said in I think I know what makes a truly competent programmer:

    nope. it's UCS2, which is almost UTF16, but not quite.

    Yeah, I know the difference, I guess wherever I heard the UTF-16 nugget from didn't, though.



  • You're a senior programmer when:

    • understand and trust others' work
    • don't reinvent the wheel
    • can argue why the newest tech stack is not the best solution
    • can argue why the newest tech stack is the best solution
    • you look at your earlier code and are ashamed of it

  • sockdevs

    @boomzilla said in I think I know what makes a truly competent programmer:

    Yeah, I know the difference,

    huh. interesting. not many people do know that.

    :tada:

    @boomzilla said in I think I know what makes a truly competent programmer:

    I guess wherever I heard the UTF-16 nugget from didn't, though.

    probably. :-D


  • sockdevs

    @presidentsdaughter said in I think I know what makes a truly competent programmer:

    understand and trust others' work
    don't reinvent the wheel
    can argue why the newest tech stack is not the best solution
    can argue why the newest tech stack is the best solution
    you look at your earlier code and are ashamed of it

    • Check.
    • Does doing it for fun in toy projects count? I'll use the reference implementation in actual projects, but implementing a new version is fun to do and aids understanding what it does under the hood, so i like to do it for fun.
    • Check
    • Check.... even if they are shiny shiny (psst... new tech. meet me out back after work and i'll take you back to my place where we can play)
    • BIIIIIIIIIIG Check! :-(


  • in a previous wtf job they had a table with state and the difference in hours from the timezone of that state and HQ local time. they update the table everytime some states enter in daylight saving time.



  • Seems to me like what makes a programmer competent is pretty much the same that makes a person good:

    • Being willing to listen to others
    • Being willing to fully understand things before dismissing them as bad
    • Always being willing to admit your own mistakes
    • Being aware of your own lack of knowledge in some areas
    • Not just being willing, but actively working to learn new things

    etc.



  • @presidentsdaughter said in I think I know what makes a truly competent programmer:

    You're a senior programmer when:

    • understand and trust others' work
    • don't reinvent the wheel
    • can argue why the newest tech stack is not the best solution
    • can argue why the newest tech stack is the best solution
    • you look at your earlier code and are ashamed of it
    • Can explain the difference between good code and bad code without using the word "performance"
    • Understand the tools and processes in a Software Development Lifecycle


  • @accalia said in I think I know what makes a truly competent programmer:

    nope. it's UCS2, which is almost UTF16, but not quite.

    Shocking that Javascript does something that's mostly like what you expect, but a bit different for some reason.


  • sockdevs

    @hungrier said in I think I know what makes a truly competent programmer:

    @accalia said in I think I know what makes a truly competent programmer:

    nope. it's UCS2, which is almost UTF16, but not quite.

    Shocking that Javascript does something that's mostly like what you expect, but a bit different for some reason.

    IKR?!



  • @presidentsdaughter said in I think I know what makes a truly competent programmer:

    understand and trust others' work

    Hmm. I often find that the more I understand, the less I trust.


  • sockdevs

    @Jaime said in I think I know what makes a truly competent programmer:

    Can explain the difference between good code and bad code without using the word "performance"

    Perfect code is code that i can explain to my ludite grand mother and have her understand HOW it works WHY it is behaving correctly

    Good code is code that i can explain to my ludite grand mother and have her understand HOW its works and that it is correct

    Okay code is code that i can explain to my ludite grand mother and have her understand WHAT it is accomplishing



  • @accalia said in I think I know what makes a truly competent programmer:

    Perfect code is code that i can explain to my ludite grand mother and have her understand HOW it works WHY it is behaving correctly

    Good code is code that i can explain to my ludite grand mother and have her understand HOW its works and that it is correct

    Okay code is code that i can explain to my ludite grand mother and have her understand WHAT it is accomplishing

    This. 100%


  • sockdevs

    @hungrier said in I think I know what makes a truly competent programmer:

    @accalia said in I think I know what makes a truly competent programmer:

    nope. it's UCS2, which is almost UTF16, but not quite.

    Shocking that Javascript does something that's mostly like what you expect, but a bit different for some reason.

    Coincidentally, Windows does the same thing; it also uses UCS-2 internally, although IIRC a lot of the APIs do automagically treat UTF-16 correctly as well (don't quote me on that last bit though)


  • I survived the hour long Uno hand

    Sitting in an operational meeting looking over priority 1-3 incidents over the past month. A P3 on 03/01 because the leap year caused a scheduling conflict with our end of month jobs.



  • @fbmac Isn't part of Unix operating systems a database of this bullshit?



  • @Yamikuronue said in I think I know what makes a truly competent programmer:

    @wft "Use JodaTime". Am I a 1/3 of a senior Java developer now?

    Wow, if I use .Net and DateTimeOffset at all times, that must make me God of all Programmers.

    BOW BEFORE ME PEONS!



  • @accalia said in I think I know what makes a truly competent programmer:

    they're the same error, it's just that the errors a lot less common in decimal because we tend to deal with decimals (also known as fancy fractions) that play nice and terminate early in decimal

    They are "not common" until you work with lots of monetary data which you need to chop into percentages.

    Programmers are usually aware that floats suck because of precision issues; then they are taught a mantra "just use Decimal" or what have you, fixed point, integers, and then they develop a blind eye towards exactly the same problems in decimal. Of which there is plenty.

    Also, you know this entire class of fuckups when a new accounting department adopts a new rounding approach, and the historical data is recalculated for any stupid reason (or it is always recalculated on the fly), and there is a substantial mismatch between actual numbers invoiced and the recalculated ones?



  • @presidentsdaughter said in I think I know what makes a truly competent programmer:

    don't reinvent the wheel

    ... as long as you don't take that to the extreme and create a product that fails to build because you were using a library that did only left-padding of strings.


  • I survived the hour long Uno hand

    @blakeyrat said in I think I know what makes a truly competent programmer:

    BOW BEFORE ME PEONS!

    We are not worthy! We are not worthy! :bow:



  • @AyGeePlus loop that was .NET, Windows and SQL Server. All of them have excellent support for timezones on dates AFAIK.

    Maybe this table was created before they moved to .NET, I don't know if there was a good excuse for it.

    IMO the overall definition of a senior dev is someone that can get the job done. While jr would need help to do more advanced stuff. It's not related to code quality or anything else.

    There is something very few of my employers ever cared for was code quality.

    Come to the corner cutting side, it's a better life. You get PHB happy with your performance, worry less with refactoring and everything, etc.

    There is no happyness for the one that wants to be proud of his code.


  • Discourse touched me in a no-no place

    @wft said in I think I know what makes a truly competent programmer:

    Multiply this case by ~5000 (that's how many items you usually get in an engineering estimate to build something ambitious, like a piece of road complete with lighting, sidewalks, and crossings, an opera house, or a stadium), and these pennies might add up to a noticeable sum.

    There used to a be a problem with some font renderers when drawing text at an angle (e.g., 5° off horizontal); the problem was this: if you computed the unrotated bounding box of a sentence, rotated the text and the bounding box (now a general bounding rectangle, but bear with me) and then drew the text, some of the text would appear outside the bounding rectangle. Indeed, in some cases the text would also appear outside the supposed bounding box of the rotated text. This was a problem that was present in the WinXP font renderer and the Xft font renderer with identical symptoms: the failure was visually identical. A particularly good test was to animate the text by changing its angle by degree increments, sweeping it around and removing the old version by painting a background-coloured box over it (i.e., the usual technique). The text would lurch around like a drunken sailor while leaving lots of odd artefacts behind it. U. G. L. Y.

    This was a rounding bug. (Or at least the Xft version was, and since Windows had the same bad behaviour, it certainly looked like it was the same issue.) The problem was that the size of each glyph would be calculated — typically by lookup into the font description — and then the resulting size would be added to the current location in the string to get the location of the next glyph, with this addition being done using integer arithmetic. That works for horizontal or vertical text, but introduces systematic cumulative errors for some angles and those can end up mispositioning glyphs so completely that they could appear outside the bounding box. The fix was for my code to do the glyph positioning itself, and to keep the “cursor” location information in floating-point values so that errors didn't appreciably accumulate over the sort of length of line of text usually rendered in a GUI; then such rounding as is done does not move the character by more than one pixel. (It was also an imperfect fix, since it destroyed any subpixel rendering capabilities that were present.)

    Rounding matters for all sorts of things.



  • @blakeyrat It helps if you know that your product needs a blade instead of a wheel (it would be used for ice hockey?)


  • sockdevs

    @wft said in I think I know what makes a truly competent programmer:

    Programmers are usually aware that floats suck because of precision issues; then they are taught a mantra "just use Decimal" or what have you, fixed point, integers, and then they develop a blind eye towards exactly the same problems in decimal.

    Only if they calculate using 2dp; any decent (and probably some shit) finance packages will work in 4dp specifically to avoid these issues, and only convert to 2dp in display



  • @RaceProUK said in I think I know what makes a truly competent programmer:

    Only if they calculate using 2dp; any decent (and probably some shit) finance packages will work in 4dp specifically to avoid these issues, and only convert to 2dp in display

    That's when the displayed total is off by a small amount from the total-as-calculated-by-hand, which drives accountants mad because the invoice receivers won't see the 3rd and 4rd digits that contributed to the rounding errors?

    All in all, round(x0) + round(x1) + ... + round(xN) vs round(x0 + x1 + ... + xN) is a major WTF, given there are no established standards for that (there is a regulation on how you calculate VAT in EU, namely, you always calculate it from the total amount and not from each separate item, but that's probably where it stops; and I've seen it violated because of reasons).



  • @presidentsdaughter said in I think I know what makes a truly competent programmer:

    It helps if you know that your product needs a blade instead of a wheel (it would be used for ice hockey?)

    All my products have blades. They need to defend themselves against the zombies.



  • @RaceProUK said in I think I know what makes a truly competent programmer:

    any decent (and probably some shit) finance packages will work in 4dpan arbitrary precision decimal type specifically to avoid these issues

    Don't ever store money in a floating point number.



  • @NedFodder as I told: it doesn't magically solve your problems. Also, there are kilograms, meters, tons, millimeters, pieces, and whatever other units that go into the "Qty" field, and it's a lousy idea to store those as floats either.


  • sockdevs

    @wft said in I think I know what makes a truly competent programmer:

    That's when the displayed total is off by a small amount from the total-as-calculated-by-hand, which drives accountants mad because the invoice receivers won't see the 3rd and 4rd digits that contributed to the rounding errors?

    Display the line item prices to 4dp then, using 2dp only for the total


  • sockdevs

    @wft said in I think I know what makes a truly competent programmer:

    then they are taught a mantra

    and that's where they were taught wrong.

    teach them WHY to use Decimal over Double, because otherwise they'll not know what problem they are solving when using Decimal and therefore be cargocult programming.

    and cargocults always get important things wrong.

    Programming is about thinking more than it is about getting the computer to do things. getting the computer to do things is EASY what you need to do as a programmer is figure out what things need to be done to solve the problem in front of you. "just use Decimal" doesn't help you're not thinking of the WHY, you're not thinking about what Decimal solves and what it doesn't so you don't know if you need to use Decimal or if Float is correct. you don't know if you need to store the calculated value or if you can materialize it on the fly? you don't think about the future, you don't think about pathological data entry.

    If you don't think, you fail.


  • Discourse touched me in a no-no place

    @RaceProUK said in I think I know what makes a truly competent programmer:

    Display the line item prices to 4dp then, using 2dp only for the total

    Accountants don't like that either. I remember having a blazing argument with one auditor over what turned out to be about 30 seconds worth of time in our timesheet application…



  • @wft When you're dealing with those other things, how much precision you need determines how much rounding you can tolerate, so you can choose float, double, or some decimal type as appropriate to the problem at hand. Financial systems almost always need a decimal type, so it's a good rule to just always use one there.



  • @RaceProUK said in I think I know what makes a truly competent programmer:

    Display the line item prices to 4dp then, using 2dp only for the total

    Ever tried billing to a contractor who uses subcontractors each of whom use subcontractors of their own?

    Turns out it's your problem if anyone down the chain ends up owing fractions of a penny. And accountants are the kind of people you better avoid fucking with, trust me.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.