Better HN
topnewbestaskshowjobs
Log inSign up

solraph

371 karma · joined May 5, 2020 (6y ago) · 167 submissions

Submissions

comment 6y ago · link · parent

Per gallon. $1.30 / L => $5.85 / gallon.

Petrol is/was always more expensive in NZ though, around ~70c/L from memory. On the flip side, registration and insurance is much cheaper.

comment 6y ago · link · parent

I'm a massive fan of unit testing, but I mostly agree with the observations. However, I (mostly) disagree with the conclusion. The problems with unit testing I've seen to come from the following anti-patterns in various combinations.

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

To me, that sounds like you've hit a ceiling in your current stack, and probably workplace, and lack examples of people around you to learn from. What the solution to that is depends on your situation. Change of workplace? New career direction? New hobby?

> 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

From my personal experience, are you still writing things the same way you were six months, a a year, two years ago?

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

> Many people haven't moved outside of "enterprise" programming languages, so they don't even realize how bad stuff like PHP is at converting business logic into code. Try doing a real project in Kotlin if you like static types. Try Clojure or Elixir if you like dynamic types.

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

Analogies are by their nature imperfect. The analogy here is that <item> is being criticised in ways that are no longer true, where <item> in the case of PHP is specfically "insecure by default", regardless of it's many other flaws. Seems fair to me.

comment 6y ago · link · parent

Principally, the Register Globals change that turned every POST & GET entry into a variable was removed entirely in PHP 5.4 (1st of March, 2012), and the was old Mysql API was removed in PHP 7.0 (3rd of December, 2015).

comment 6y ago · link · parent

It's insecure by default, in the same way that Windows is a 32 bit shell over a 16 bit DOS core, and doesn't have real memory protection.

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

In the last few years, I've sat on both sides of the interview table several times. Recruitment in software engineering is a disaster from start to finish for all involved. As salaries have risen, it's only gotten worse.

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

It's 5.8% of GDP, 20.4% of exports. [0]

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

I do. However, the process would have stuck around until it finished. It wouldn't have changed our overall RPS at all.

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

Ironically, the root cause that made me think of that example was AWS.

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

No garbage collection, doesn't compile to Javascript[0] and everything on Android is moving to Kotlin anyway.

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.

[0] https://kotlinlang.org/docs/reference/js-overview.html

comment 6y ago · link · parent

It does, and using PHP in strict mode, in combination with tools like phpstan is what led me to looking for a language that is even better in that regard.

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

Compile to Javascript, and compile to native binaries supported by the core language team.

comment 6y ago · link · parent

Not the parent, but it would be nice to have separate thread for things like logging and firing events into a queue.

comment 6y ago · link · parent

Alas, I feel the same way. After much thought this weekend, I concluded that it was time to move on from PHP. I decided against the any other scripted language (Ruby, Python), as it felt like more of the same.

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.

123456