Better HN
topnewbestaskshowjobs
Log inSign up

peterangular

2,869 karma · joined Dec 7, 2017 (8y ago) · 728 submissions

Submissions

comment 7y ago · link · parent

> The apparent simplicity of some code has absolutely no impact whatsoever on the amount you should charge for it.

Yes it should. If I know someone w/my same talents can come along and knock the same functionality out in a few hours it's going to make me push the price-barrier down so someone does't just come along and eat my lunch.

As an engineer my value is VERY tied to my time, and when I'm doing dev on my own business/products I am fully cognizant of this.

Anecdotal I know - but the word "undercut" is popular in pricing conversations for a reason... aaand I've been undercut by another engineer copying my product for a cheaper price before.

comment 7y ago · link · parent

You're not handling input elements correctly. Using CSS to hide things like CC number fields etc via blurring is a fool's errand. You're going to have split-second rendering issues that still display info in cleartext on the screen (I get this is for an "already loaded page" but still - I would hope blurring persists from page to page). Sometimes Chromium gets buggy and can display stuff for seconds at a time before a CSS3 blur is drawn (trust me - I've tested this at scale).

As someone who's had to do this for automation purposes (can't get a CC/SSN in a screenshot due to compliance) you first set sensitive fields to "password" on the input element, query the DOM to ensure a "safe state", and THEN you fill then input.

Also - other comments on blurring being reversible are correct as well.

TLDR: Replace attributes/characters to do properly censor text on a webpage. Source - 10+ years of automation (same logic still applies to vanilla front-end dev). Not a very useful tool.

comment 7y ago · link · parent

Most extension devs can knock something like this out in a weekend. It's steep.

comment 7y ago · link · parent

Amen to this. The new Reddit interface is a step backwards in functionality due to this sorta stuff and effectively breaks user experience.

Just to give an idea how bad it is: loading the front page cold of new reddit = 9685KB. Loading the front page on the old reddit (also cold) = 737KB. The compute profile is literally half for old.reddit.com (new peak 16%, old peak 7.5% - both metrics core-distributed over an 8c system; 1s sample rate).

I LOVE all of this talk that front-end devs like to have on optimization/state stability. Talk to an browser automation expert, esp. one that does it at scale. Almost 100% of the time older/simpler front-end tooling/development is faster and less error prone. Older also takes a FRACTION of the compute/memory/proxy resources. It's been this way for years!!!

ducks for the inevitable storm of HN hate for having a strong opinion

comment 7y ago · link · parent

Went down this rabbit hole yesterday and played with LitElement/lit-html for the first time... great experience for folks who don't want much "ceremony". Was also SUPER impressed with AppRun.

The more that I depart from my "bare metal" web tooling the riskier/dumber things get. I always want to see a path back to a basic HTML5 shell, driven by almost-pure JS (w/tiny helper libs), and basic CSS. Just like basic UNIX tooling - basic web tooling just works!

To those thinking about trying lit-html; it IS as simple as the example on the GitHub project page. I was able to build it into a semi-complex application within a couple of hours and it had massive performance payoff w/o compromising how I want to build things. It definitely gets my "KISS" approval stamp.

comment 7y ago · link · parent

> Additionally vi is so configurable that one may be intimately familiar with their own vi configuration

Didn't even think of that - you could totally say the same about my Sublime editor =D

People are comfortable with their own tools and I don't like putting candidates into a corner with what they're using.

comment 7y ago · link · parent

Agree. I'm perfectly capable at vi and I'd probably just walk because it shows total arrogance on the interviewer's part.

Anecdotal - I use zsh, with the bureau theme - pretty obvious it's not just a bash shell. During a more operations-focused interview I had someone ask me if he could use bash because he wasn't very familiar with zsh and would like to work with a known tool. Super competent guy.

I thought it was a perfectly reasonable request.

comment 7y ago · link · parent

> I say it all the time, Americans have not acknowledged that the rules have changed and the conditions that led to prosperity for the previous generation no longer exist in the same quality and quantity for today's young people.

Yep - and I wish this was more of the conversation ... I'm really playing a completely different game than my late father.

The ONLY reason I realize it vs my peers is because both of my parents died by/in my mid-20s and left me nothing going into adulthood. In contrast, I would anecdotally say >60% of my peers are still receiving parental help with everything from childcare, to down payments on houses, etc - even well into their 30's... regardless of income.

comment 7y ago · link · parent

I bet there's also a measurable difference in outcome when this type of communication is forced through a screen. By removing the face-to-face interaction you're making it easier to remove empathy from the situation...

But frankly welcome to the US - we have zero empathy for people who end up incarcerated ='(

comment 7y ago · link · parent

My apologies - can you give me the edit capability to go in and tone that down then? Or maybe the ability to delete a comment that turned out to be controversial?

If you are a mod - feel free to delete this thread as many people in other parts of the post are echoing my sentiments, some with equally as harsh language (which you are not singling out).

That lib is technologically irresponsible to use and breaks user experience for a lot of people - I was trying to put a very clear warning out there and decided to be honest in my choice of words which many people have actually defended in this conversation.

comment 7y ago · link · parent

Chrome offered to auto-fill his CC number that is stored with his expiry, name on card, and (maybe) payment address/zip... everything but the CVV, (card verification number, usually three digits).

Chrome is pretty clever these days with payment details and tries to help you keep a "wallet" so-to-speak which acts like an "autofill" feature. Do some searches around Web Payments, Payment Request API, W3C Payment Request, blah blah - let's just say it goes a lot deeper than basic autofill =)

Now for siphoning. That attack (as far as I know) wouldn't be allowed to happen. Chrome WILL NOT autofill your details or inject ANYTHING into the DOM until you've entered/verified your CVV. Due to security with how payments work there has to be some sort of a user interaction before any PAN is allowed to populate the DOM. This is to avoid his exact paranoia where a CC num gets entered automatically w/o a user's knowledge.

Since this is enforced by the browser I consider it to be pretty safe, and appreciate the feature in my day-to-day browsing activities =)

Back to the Cleave.js lib though - that thing is going to BARF on things like CC num autofill driven by browsers/etc. Trying to be super clever is just going to screw-up native browser capabilities.

comment 7y ago · link · parent

Usability errors/barriers like this on high-profile sites have caused millions in lost-revenue.

Many people just abandon their intended action when simple usability things are not right because your sales experience is sorta a "first impressions" thing (bit of a generalization but yea).

comment 7y ago · link · parent

Yep - and I'm entirely skeptical of people who singularly use a singular "A/B" study to back up any case when it comes to a real business' sales funnel. Simple input masking or not - it just wouldn't hold up in some of the board rooms I've had to stand in front of during my career... the phrase "not statistically significant" comes to mind.

And before you link that "A/B Testing is Still Needed" HBR article - know that I 100% agree with it but on the premise of testing MULTIPLE solutions under the traditional "A/B testing" model. As far as you've posited in this conversation - you guys only tried one thing. You're also admitting it's not a "scientific study" so I assume you did nothing to minimize other changing variables/conditions in regards to the input masking.

TLDR: Input masking CC fields is probably a bad idea beyond filtering non-numeric/non-slash characters. I will make that generalization. I'm not convinced you've got a valid argument against that with your "A/B test" experience.

comment 7y ago · link · parent

It COULD be a "real thing" but 100% don't believe it until someone links a study backing up a claim like that.

Breaking up long numbers into smaller input fields CAN help with data-entry (think dyslexia etc.) but in the case of CC numbers that are of different formats (ie: VISA vs AMEX) there's no good way to "auto-format" it even if you knew the issuing PCN of the card before hand.

So - best practice generally is, ignore the dashes and let it be entered as a 10-19 digit numeric only field (or 13-19 if you're not worried about ancient cards). Just don't allow non 0-9 characters in the input via JS which is SUPER easy. Then, before submission, ensure it passes a mod-10 Luhn check to let someone know they fat-fingered it! Easy-peasy.

comment 7y ago · link · parent

> How would the ability to type an arbitrary amount of numbers, or letters, in a credit card number field lead to higher conversion?

Sure - I'll bite. But I'm also going to point out that you're swinging to the other end of the extreme. Obviously no one in their right mind would just allow arbitrary input...

Clearly every CC number can be represented by numbers alone (by omitting the slashes). People are absolutely familiar with this and often will omit the dashes in their fields all together without any filtering of characters. Personally I key off of the "keydown" event on that field and e.preventDefault/return false on anything non-numeric. In the future, I hope the "inputmode" HTML attribute catches on with non-Chromium browsers - that would eliminate my need to do this.

After the number is entered, or (personal preference) before the form is posted, you do a simple Luhn check and show a dynamic error message RIGHT ABOVE the field saying "hey invalid CC num yo" - ideally you keep the "process" button and CC num field close to each other so this happens within the same document view without having to auto-scroll/anchor to the invalidated field.

Then, as always - ensure you have the capability to validate that data using the same rules on the back-end before it's allowed to be sent to your processor, or w/e.

There ya go - there's the "everyman's" approach to CC validation on the front-end.

comment 7y ago · link · parent

Sure but look at the top-level comments on here and there are words like:

* "anti-pattern"

* "overzealous autocorrect"

* "this is everything I hate about 'modern' UI"

* "I hate this idea"

* "This is a weird API for what it’s trying to achieve"

* "...THEN select the country..my number gets deleted... I hate you now"

* "Cute, but it looks like it's trying too hard to be clever."

* "Couldn't find my country for the phone number (UK). Looked for EN and UK, eventually discovered it was GB. Hard!"

* "hot garbage trash" - wait whoops ... that's mine - seems to fit right in though!

It actually took me a few consecutive quotes before I even found a neutral sounding "should simply be solved by browsers imho" comment.

"Your response is assholish" is correct, and I will agree. However I have a visceral reaction against these anti-patterns. The web is suppose to be open, and the web is suppose to be usable by a diverse group of people (including those with disabilities). I don't care if someone built this in their "free-time", this is NOT a responsible front-end lib to use.

comment 7y ago · link · parent

> Your statement is also incorrect if applied as a general rule.

I would absolutely disagree with you here. It is a generally accepted "case" that additional validation barriers on conversion experiences cause users to drop off. I have seen this scientifically proven by hard numbers time and time again over my ecommerce career.

> That's a pretty hostile and condescending way to talk about someone else's work.

Sure, I'll take that criticism. I still think it's a horrible practice and would professionally advise anyone against implementing this.

I do love how we like to rip on the JS community when it's convenient for us (npm, every new framework ever, etc) but when I say a front-end lib is "hot-garbage trash" because it breaks something as simple as backspace it's over the line...

comment 7y ago · link · parent

I've never seen that but it's a super interesting case. Reading this makes me start brainstorming ways I can be more accommodating for that situation - that wouldn't fly with certain sites I run due to US-based NPA-NXX validation on the back-end. Hmm.

comment 7y ago · link · parent

> we also have three day/month/year fields

Yep - I actually use strategy this and type="date" both depending on what the precision requirements are =)

I've always seen the "three-field" old-school method as the most bullet-proof approach for this. Plus, validation becomes super easy since you're just doing simple integers w/ranges.

> Imagine if you're blind and you try and enter a date into those `dd/mm/yyyy/` magic fields

100% - those things absolutely break down for screen reading tech/etc. That's also why I hate these sort of "input masking" libs... accessibility is a huge concern of mine.

comment 7y ago · link · parent

Perfect example of "post your professional experiences on HN and get it ripped apart immediately."

On PANs - sure. However, I (personally) have seen odd-digit PANs but also deal with an industry that sees literally EVERY type of CC number you can imagine from all different areas of the world. Your experience (like mine) is anecdotal. But, here's the kicker - I HAVE to go with what VISA tells me to do because of their individual PCN integration requirements. If VISA is telling me "hey - it's a best practice to support all of our potential PAN formats even though 99% are going to be 16 digit" then I have to support that =)

On phone # formatting - sure. If your use case is the US and Canada things become MUCH more standardized for everything from banking data, to addresses, to (of course) phone numbers. However - I see foreign/odd phone # formats from the Americas constantly as not all the people who are here at this time have a local phone provider. (ie: travel).

I concede on number formatting - but I still use it because (IMO) it has the best/most-consistent mobile experience vs. custom libraries.

On date formatting - sure. "also sucks, btw" let's tell the users WHY it sucks because otherwise it's just trusting some random guy on the internet.

But yea - cool fork on codepen.

comment 7y ago · link · parent

I've tried similar libraries and they all suffer the same general "I don't know what the backspace key just did" sorta issues...

Just look at the top features listed on their Github:

* CC number - doesn't actually support all PAN formats - 19 digits exist although extraordinary rare. NEVER try to do anything fancy with your CC details field because if people try to pay you and can't you've lost a customer.

* Phone number formatting - doesn't support all phone # formats. Leave this as flat text (non-numeric) or numeric for base telephone # and a text field for extension.

* Date formatting - use type="date" so you get native mobile support for date entry.

* Numeral formatting - use type="number" so you get native mobile support for numeric entry.

comment 7y ago · link · parent

> Are people browsing around your laptop / workstation without you monitoring what they're doing?

Nope - but the industry that I work in constantly assumes "bad actors" are present. Although it's not perfect - everything is 2FA, all disks on laptops encrypted, there are strict rules in dealing with secrets/sensitive information, etc. My main concern is if someone were able to do a rip of my home directory.

Trust me - there's a TON of room for improvement, but doing some general protection against someone with "shell" access is something I'm in the practice of... it's the same reason I carefully manage what ends up in my .zsh_history or .bash_history =)

> If someone has your machine without your consent, then you're pretty much screwed

Agreed. Encrypt the disk (I trust LUKS), lock your machine when not in-use, ensure it shuts itself down if a password is "fat-fingered" more than twice, use solid passwords with good complexity, use 2FA when you can/should, etc.

comment 7y ago · link · parent

Excellent - thanks for the heads up =)

Will be looking into this to replace a KeePass DB!

comment 7y ago · link · parent

This was brought up last time - but even having something like the path "./Banking/bankofamerica.com" visible on the filesystem is a disclosure of sensitive information, even if the password is encrypted at-rest. Otherwise I love the idea of *nix based philosophy for password management =)

comment 7y ago · link · parent

Oh yea - I guess I had a specific use case in mind when I said that =)

What I meant is that I can hammer out some Node/Python that will grab an image w/text and put it through OCR for character extraction. "Programming" it would take me a handful of minutes.

comment 7y ago · link · parent

Yep yep - if the text isn't distorted I can rip it from an image within minutes using pre-built OCR libraries. If the text is distorted there's full-blown API-driven services for solving CAPTCHAs and the like.

comment 7y ago · link · parent

100% true. Have written PLENTY of scrapers and methods like this are ultimately ineffective.

Even if you absolutely mangled the HTML/selectors/DOM/etc. I feel you could always have it process screenshots of the interfaces to rip text/figure out how to interact etc. If it's human readable, it's bot readable imo. (but in years of botting it's never came to this - I've always been able to figure out how to use the existing DOM/selectors to do my work even with anti-bot measures)

comment 7y ago · link · parent

> I see the next generation of programmers more populated by tech debt creators and less accepting of mentorship

Yep - even as a youngin' I'm seeing this happen rapidly with tech being the new "hotness" that everyone wants to jump on career-wise. With 6mo bootcamps, Udemy, etc people think you can just jump RIGHT into the industry. And they're right - with the wrong interview panel it's easy for a near zero-experience person to get in the door because so many companies are focused on increasing engineer headcount vs focusing on the quality of their teams.

Honestly I've made a _lucrative_ career out of dealing with tech debt that other engineers/teams have left behind due to bludgeoning their way through the process with tools they've only used once.

comment 7y ago · link · parent

I've always been apt to push for a more technology-oriented manager due to logistics because I don't need/want a non-technical "career coach" calling the shots on implementation/execution when they don't even have an IDE installed on their laptop... which is why I feel they specifically nailed it with this - "We look for candidates' ability to mentor and add value to technical discussions while understanding their own limitations, supporting a technical decision without acting as a decision-maker."

comment 7y ago · link · parent

You may just wanna go with going between Fira Mono and Fira Code then for consistency - I run Fira Mono on my terminals and Code for the editor/IDE.
1
2122232425