2,869 karma · joined Dec 7, 2017 (8y ago) · 728 submissions
comment 7y ago · link · parent
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
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
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
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
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
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
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
But frankly welcome to the US - we have zero empathy for people who end up incarcerated ='(
comment 7y ago · link · parent
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 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
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
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
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
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
* "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
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
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
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
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
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
comment 7y ago · link · parent
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
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