371 karma · joined May 5, 2020 (6y ago) · 167 submissions
comment 6y ago · link · parent
1) The use of unit tests as the exclusive automated test type. ie; No functional tests, integration, etc.
2) Test doubles for most or every dependency, even purely functional dependencies like math libraries.
3) Not using the appropriate kind of test double for the test at hand. (Dummies vs Fakes, vs Spies, vs Stubs, vs Mocks)
4) The overuse of mocking libraries.
Mocking libraries have their place, but in opinion, are used approximately a hundred, perhaps even a thousand times more often than they should be. I use them to create test doubles in exactly three scenarios:
1) A dependency that does not have an interface, usually a third party library. This usually happens in one place only, and is used for writing the wrapper code test.
2) A dependency that has an incredibly large interface and/or dependency graph where building a set of stubs or spies is simply not worth the effort.
3) I want to test weird edge cases that's not available any other way, such as theoretically unreachable code.
These should not be the majority of your unit tests!
comment 6y ago · link · parent
> I have no idea what "better" is any more. Faster? Easier to read/maintain? More loosely coupled? All of these? "It depends." As a gross generalisation, most juniors optimise for their bug-bear of one of these at the expense of all of the others. Most mid level devs try to balance them out, and hopefully, most seniors pick which ever is appropriate for the task at hand, with an eye on the long term consequences of their design - if there even is a long term consequence.
Re webpack replacement; Given the amount of time I've wasted dealing with webpack and it's madness, I'd back you up and say it's probably a net win - as long as it's documented enough to avoid the bus factor. It's not like golang is some esoteric language where it's impossible to find devs for.
P.s: I want to clarify here that I'm not necessarily a good programmer, I've just spent enough time stuck as a niche programmer & probable expert beginner and fighting my way out of it that I recognise the patterns. I'm probably a better study of dev behaviour than actual dev.
comment 6y ago · link · parent
I look at code I wrote a couple of years ago, and not only can I identify how I would write it differently, I can identify /why/ I would write it differently - both what technique, concept, or methodology I have since learned, and how that would make the code better.
If you cannot, you have probably plateaued, like I did for a (far too long) while.
comment 6y ago · link · parent
Outside of your average copy/paste stack overflow Wordpress dev, most PHP programmers are very aware of it's flaws, and would probably welcome the chance to move on.
However, the frustrating thing about the prevailing attitude is that creates a stereotype that all PHP developers are incompetent, and this stops PHP devs moving on. I've been trying for the better part of a decade to move out of PHP as my main language. I have github projects in various other languages, submitted patches to open source projects, but the above attitude means that outside of existing PHP shops, no one is interested in hiring me.
I've literally had one potential job tell me that they liked my python code assignment, but they had a policy of not hiring PHP programmers. It was not an isolated incident.
Given those attitudes, are you surprised PHP devs bitterly defend the language?
comment 6y ago · link · parent
It used to be true, and was a valid criticism. It hasn't been true in so long, that claiming so says more about the claimer than the language.
comment 6y ago · link · parent
On one side, there is a depressing number of people out there applying for programming jobs who effectively can't code. Their "skills" range from mindlessly repeating previous patterns they were told to use elsewhere without considering their applicability to the current context, all the way down to literally copy/pasting code chunks till the program appears to be working. Many of this group either don't care, or are blissfully unaware of what they don't know, or how little they know about subjects they believe themselves to be experts in.
This group is the majority of applicants. This is where the take home coding tests come from (which frankly, I also loathe).
On the other side, interviews are usually conducted by who-ever has been at an organisation the longest, and/or is most willing to put up with the shenanigans of interviewing the group mentioned above. This often means they're the ones most likely to enjoy catching people out, or who have some particular thing they like to grill people on. This is where you get the twenty-questions bingo style interviewing. Your recent interview sounds like one of these.
To add to this, there's a variety of situations where the applicant _should_ get the job, but they don't for reasons outside of the interview room. A manager wants to hire someone they know. Due to reshuffling, the job requirements have changed between publishing the job ad and interviewing. The budget was curtailed after the interview. Chances are, you'll never know the true story.
In addition, a large portion of developers don't ever go through the normal recruitment process. They'll do interviews, but they're recommended by colleagues, members of their meetup, friends of the above, or their IRC / Slack / Discord / etc group, and their interview process will reflect that. This is currently the best way to get a job. Often these groups are invite-only, and effectively invisiable.
In the middle of this maelstrom, are the few reasonably competent applicants applying for a job that is right for them, with a reasonable and fair interviewer.
--
Based on all the above, without knowing a thing about you, I'd be forced to conclude one of three options: a) You've just been really unlucky. I've been there, it sucks. b) You're not actually as good as you think you are. Usually this is when a programmer hits a certain level of expertise and stops learning anything new for some reason. Sometimes this is down to ego, sometimes it's because they've become the biggest fish in a small pond. The symptom seems to be a lack of curiosity, if not hostility, about novel or unexplored concepts. c) The above observations are based on my incredibly biased view of my corner of the world, and don't match your reality at all.
comment 6y ago · link · parent
That's a large figure, but it's not as if New Zealand lacks any kind of other industry. There's a massive primary industries (dairy, meat, logging, wine, plus others) where the country hasn't yet fully exploited it's opportunities yet for secondary value-add processing.
As a completely anecdotal observation, most tourists go to the South Island, where roughly a fifth of the population lives. The North Island is four times as densely populated. This disparity sometimes leads people to believe that country is entirely dependant on tourism, with a few sheep thrown in.
[0] https://tia.org.nz/about-the-industry/quick-facts-and-figure...
comment 6y ago · link · parent
Arguably the same problem would exist in other languages, but at least there we would have had the option of using threads, and we could have executed multiple calls to SQS in parallel. Probably not something I'd want to do all the time, but it would be nice to have had that option in this case.
comment 6y ago · link · parent
The example was where each SQS call (there could be as many as five) was taking between 50ms-200ms, and logging took another 75ms. The rest of the request processing time was approx 50ms.
There's a bunch of other architecture options we could have looked at, but due to the share-nothing nature of PHP, they weren't an option.
comment 6y ago · link · parent
Just to be clear, my reasons stated above is why I'm moving to Kotlin. I make no claim that other people should or would want the same things. I've realised that I like languages with explicit strict typing, and that allow for a greater level of expressiveness at the cost of a higher intrinsic complexity and the comprehension that requires.
comment 6y ago · link · parent
If PHP hadn't made advances in it's type system with the 7.x series, I probably would not have stuck with it this long.
However, while PHP the language supports strict typing, it does it at run time (inherently a limitation of scripted languages, I know), rather than compile time.
comment 6y ago · link · parent
Requirements were strict typing, functional programming support, built-in concurrency, decent library support, and real support for both native and Javascript. It pretty much came down to Kotlin or Rust.
I really want to like Rust more, but the library support, and the jobs in my area just aren't there (yet?).
Picking up Kotlin feels like coming home.