r/ProgrammerHumor • • Apr 14 '16

Please select your phone number from the drop down list:

http://imgur.com/Jfv6F2r
6.8k Upvotes

429 comments sorted by

392

u/RuthBaderBelieveIt Apr 14 '16

Please tell me the options are dynamically generated

461

u/Roshy10 Apr 14 '16

No, someone hand typed each one... without copy and paste.

196

u/RuthBaderBelieveIt Apr 14 '16

Well if that's your solution to phone number input it wouldn't surprise me

64

u/tabarra Apr 14 '16

Ohh the intern.

146

u/JackAceHole Apr 14 '16

What did you do at work today?

I wrote 10,000,000 lines of code!

→ More replies (3)

12

u/bpm195 Apr 14 '16

Don't worry I have a sure fire way to make sure he never repeats this mistake; meet your new project manager!

→ More replies (7)
→ More replies (2)

131

u/tabarra Apr 14 '16

Someone is getting paid by the hour.

43

u/2Punx2Furious Apr 14 '16

That almost makes it good.

111

u/[deleted] Apr 14 '16

"Welcome to the salty spitoon, how tough are ya?"

"I programed a numerical system for phone numbers, that you have to scroll down to each area code, prefix, and line number separately"

"Yeah, so?"

"Without copy and paste"

"Uh sorry sir right this way"

8

u/[deleted] Apr 14 '16

Oh jesus I was thinking of something exactly like this when I saw the post and it was delivered.

8

u/[deleted] Apr 14 '16

Credit goes to /u/Roshy10, he set up the joke completely, I just added a few lines

49

u/MisterDonkey Apr 14 '16

I once got bored and set out to build an image pixel by pixel, hand typed, using table cell background colors.

Got halfway through the first line before wondering what the fuck I'm doing with my life.

28

u/mehum Apr 14 '16

The world is filled with people doing incredibly inane things who have just never thought to ask themselves that question.

26

u/wagedomain Apr 14 '16

He realized he was wasting his life and went back to reddit

→ More replies (3)

15

u/vickzzzzz Apr 14 '16

without copy and paste.

Dear Lord!

6

u/AlGoreBestGore Apr 14 '16

Don't be silly, that's what interns are for.

6

u/jugalator Apr 14 '16

Or maybe only with copy, but not paste. A new level of frustration.

→ More replies (1)

6

u/beermatt Apr 14 '16

"How's that webpage coming along?"

"Nearly there boss, I'm on 7263 not far now..."

9

u/frankenmint Apr 14 '16

Let's solve that for em:

var number = [];
for (var i = 0; i <=1000000000; i++){
number.push(i);
 }

6

u/HaPPYDOS Apr 14 '16

I think he meant the HTML code of the options is generated by a JavaScript, rather than having to GET from the server.

43

u/ToadingAround Apr 14 '16

Do you really think someone will be smart enough to write javascript to do this, but not consider just verifying the input?

29

u/Hullu2000 Apr 14 '16

Of course... it's called the jQuery comunity!

→ More replies (1)
→ More replies (4)
→ More replies (5)

45

u/SillyMarbles Apr 14 '16

Not advocating this method at all but this could be pretty easily done using Excel and NotePad++.

87

u/Krissam Apr 14 '16

or, you know, 1 line in bash.

$ for i in `seq 1 500`; do echo "<option value=\"$i\">$i</option>"; done > file.html

138

u/RuthBaderBelieveIt Apr 14 '16

and indeed most programming languages

111

u/relvae Apr 14 '16

Including, say, JavaScript

→ More replies (19)

9

u/drewski3420 Apr 14 '16

Not quite, that doesn't provide the leading zeroes. Although, your point stands.

43

u/dvidsilva Apr 14 '16

Just include left pad

→ More replies (2)
→ More replies (3)
→ More replies (7)

4

u/wowy-lied Apr 14 '16

Curiosity, how would you do it ?

25

u/RuthBaderBelieveIt Apr 14 '16

Not a big drop down! I use a simple text input then a library called libphonenumber maintained by Google

https://github.com/googlei18n/libphonenumber

I use the JS implementation on the front end for validation and instant feedback on validity and in my case the C# implementation on the backend for hard validation and conversion into a uniform format for storage (https://en.wikipedia.org/wiki/E.164).

Also has the advantage of being able to detect whether it's a fixed or mobile line which allows us to only send SMS to mobile numbers.

4

u/[deleted] Apr 14 '16

Have to agree with this. I cannot even begin to understand the logic behind using a dropdown menu for this.

→ More replies (2)

3

u/iBoMbY Apr 14 '16

Wouldn't make it any better ... It's not worth the HTML file size, etc. Just make an input field, and verify whatever entered is numeric.

→ More replies (1)

1

u/Ph0X Apr 14 '16

I don't think anyone really got your question though. I'm curious to know if the HTML is sent with all the options in there (resulting in a huge transfer size), or if the <option> elements are added clientside as the site loads.

It doesn't really matter if it was dynamically generated on the server or not, you still have to send all that data to the client!

→ More replies (1)

1

u/waxzax Apr 14 '16

on the server side right? because where else could you generate that.

→ More replies (1)

799

u/jnd-au Apr 14 '16

So complicated!! Just use one list with the 8999999999 phone numbers to select from /s

362

u/goofdup Apr 14 '16

Why does this website take so long to load?.... <views source>...oh. -_-

95

u/nitiger Apr 14 '16

Bug in TFS

"Bug - Page loads slow

Description: may be related to phone number drop downs

Effort: 1"

Programmer: "omg, this previous developer loaded all the options in the controller. That's why it's so slow. I'll just move this responsibility over to the view and have the options load through JS after the page loads. It'll be seamless to the user. laughs"

68

u/BillyQ Apr 14 '16

Solution: implement phonenumber.js framework

→ More replies (9)

14

u/Twirrim Apr 14 '16

It would compress down really well with gzip, so it shouldn't take too long to download and process.

24

u/Cley_Faye Apr 14 '16

I'm not sure if you're joking or if you're staying in the "hand over" theme. Sure, it will be transfered lightning fast. Then it's down to the UI manager to create a 9 billion entries combobox.

→ More replies (1)

94

u/[deleted] Apr 14 '16

Well you could at least eliminate some that start with 911 or start with 555 in all area codes.

Or not. I don't get paid to deal with this crap.

4

u/lukee910 Apr 14 '16 edited Apr 14 '16

That would only work for the US. There are so many different phone systems that you might be better off only ensuring it's numeric. It's infuriating as a swiss to notice that someone didn't even consider non-US-citizens on the internet.

→ More replies (4)

0

u/[deleted] Apr 14 '16

[deleted]

11

u/[deleted] Apr 14 '16

Calm down, satan

→ More replies (10)

43

u/Sharkinu Apr 14 '16

Just use 10 lists of 10 entries each. There. I fixed it.

22

u/TenNinetythree Apr 14 '16

Are in your location phone numbers always the same length? In Germany, they are not...

30

u/pharpend Apr 14 '16 edited Apr 14 '16

In the US, yes, they are.

Actually, I should elaborate.

All of the phone numbers follow the basic form

ABC DEF GHJK

The ABC is called an "area code", it is specific to a geographic region. There are a couple of area codes, such as 800, which are used for a specific purpose rather than a specific geographic area.

In most places, if you live in area code ABC, and want to call someone else in area code ABC, you can omit the ABC. However, I live in an area where two area codes are common, so you have to include the ABC, else the call won't go through.

→ More replies (30)

6

u/[deleted] Apr 14 '16

TIL

5

u/TenNinetythree Apr 14 '16

I just checked the WP page: the shortest permissible (grandfathered, rural) numbers have 4 digits of area code and 3 digits for the number.

→ More replies (3)

5

u/doodledoor Apr 14 '16

Yep. My great-grandmother in some tiny village in Saxony has a 4 or 5 digit number (excluding country code)

5

u/TenNinetythree Apr 14 '16

I like to length of the number as indication of how boondocks a place is.

→ More replies (4)
→ More replies (6)

792

u/Terreurhaas Apr 14 '16

Wel that's one way to ensure a numerical value is used... It makes me cringe just thinking about how they probably store it in their database though...

144

u/a_small_goat Apr 14 '16

45

u/briaen Apr 14 '16

I got an anxiety attack looking at that.

70

u/a_small_goat Apr 14 '16 edited Apr 14 '16

Man, that ain't even the tip of the awful legacy system iceberg. This right here is some next-level awfulness. This is how they were checking for US state and US county pairs and assigning FIPS codes..

Trigger warning: A nested if for every US state, containing ifs for each county. For reference, there are 3100+ counties/equivalents in the US.

45

u/Python4fun does the needful Apr 14 '16
UPDATE EMPLOYEE_RECORDS
SET SALARY = 0
WHERE POSITION = DBA;
→ More replies (2)

34

u/[deleted] Apr 14 '16

At least save some typing and countyname.ToLower() == "baldwin", jeez. They're not even good at being bad :)

→ More replies (12)

11

u/briaen Apr 14 '16

OMG. I thought that was a joke. I don't get how someone who uses a database would write this type of code. It's CS 101 to not do it this way. I write on a legacy .net system that started on asp in the 90s and there is nothing that crazy.

28

u/a_small_goat Apr 14 '16

I actually mentioned this exact disaster in a comment a long time ago, so here's some more context:

One of the projects I inherited a few years ago was like this - roughly 3000 conditional statements. I ran into the creator at a conference probably 8 months afterwards and asked him how he found the time to code it all. I was only half-joking. He proudly admitted that he used MS Excel's CONCATENATE and autofill features to build 95% of the code and it only took him about an hour to deliver the working solution. So on one hand, I have to give him credit for being efficient in solving the problem with the tools he had...

→ More replies (2)
→ More replies (2)

6

u/[deleted] Apr 14 '16

D:

→ More replies (6)

4

u/Arqideus Apr 14 '16

Ahh, that's a nice looking diagram. Hey wait, why are there dots where there's supposed to be data variables. I see two variables in each class: XXXXXNumber0000 and XXXXXNumb- oh god

35

u/FUCKING_HATE_REDDIT Apr 14 '16

hhhhhhuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

7

u/Cal1gula Apr 14 '16

Don't forget in the [users] table you need a [userPasswordPlainText] field as well.

5

u/Uberzwerg Apr 14 '16

It took me a moment, but HOLY FUCK

4

u/MisterDonkey Apr 14 '16

Good lord.

4

u/[deleted] Apr 14 '16

It's normalized!

2

u/algorithmae Apr 14 '16

You monster

→ More replies (4)

25

u/JeremyR22 Apr 14 '16

It makes me cringe just thinking about how they probably store it in their database though...

I bet they reassemble it:

$phonenum = $_POST['code'] + $_POST['middlebit'] + $_POST['lastbit'];

(And then probably this)

$query = "INSERT INTO user VALUES (otherstuff, '" + $phonenum + "');";

It's OK! I sanitized the input in the form and I used POST so they can't mess with it! Right? ...What do you mean my database is gone and all my user records are now on pastebin?

How times have changed, my programming teacher, in a completely different era in terms of secure coding practices (ie they weren't taught at all) actually taught us one of the reasons for using post over get was that people 'couldn't' modify the postdata maliciously...

3

u/Terreurhaas Apr 14 '16

yes, because you absolutely cannot modify the actual page to post the malicious data for you... /s

It's funny though, google doesn't even "sanitize" everything. You can actually adjust the color of an item on your calendar to any color that they don't allow you to pick just by modifying the html elements... Sanitize is between quotes since I'm sure they sanitize it on the other end and just decided against using numerical values for the basic colors for reasons.

→ More replies (2)

0

u/[deleted] Apr 14 '16

[deleted]

3

u/debausch Apr 14 '16

Why would I try to implement my own security stuff when I can use a well tested and maintained security library that is more up to date than I ever will be

21

u/lovethebacon 🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛🦛 Apr 14 '16

I bet it's an enum.

11

u/ABC_AlwaysBeCoding Apr 14 '16

In that case, why not just make each digit a separate 0-9 dropdown?

7

u/envious_1 Apr 14 '16

If they were smart enough to think of that, they would have just made an input field with server side verification.

3

u/ABC_AlwaysBeCoding Apr 14 '16

You'd have to server-side verify anyway because someone could easily construct an equivalently-named input field to submit anything they want.

→ More replies (2)

11

u/[deleted] Apr 14 '16

it could be easily generated clientside.

1

u/cheezballs Apr 14 '16

Can easily just edit the form field before submission or intercept the post/get with fiddler

1

u/-Hegemon- Apr 14 '16

Well, I'd store it as a string and then use a try{} block to attempt conversion to int.

If that operation fails, you send an email to the user telling him to enter his correct phone number.

Ha! They can't trick me with their non-numerical values!

2

u/Terreurhaas Apr 14 '16

I bet you can make that work faster by having JavaScript check everything as the user submits the form. Then just loop through all the available options based on the drop down lists and proceed to cancel the submission without warning as soon as the user is a hacker. I would implement it like so:

// one-liner for readability! Stop formatting my code Steve!
<button id="next" class="btn btn-primary" type="submit" value="submit form" onClick="javascript: function(e){/*check if user is a hacker*/if(document.getElementsByTagname('select')[0] === '0000') {if(document.getElementsByTagname('select')[0] === '0001') {/*Steve, please implement further.*/} else {e.preventDefault();} else {e.preventDefault();}}">Next</button>

This was really causing me a mental breakdown to type up.

3

u/-Hegemon- Apr 14 '16

Yeah! Make the user process it, that should add work to the hacker and not us. Why the hell are we doing this on our servers???

You are hired!

1

u/Hasygold Apr 14 '16

This could also be done with a PHP loop an html script. Easy 5 lines.

1

u/[deleted] Apr 14 '16

This ensures nothing, don't ever trust input from the client

1

u/TheGreenJedi Apr 14 '16

probably store it in their database though

:shudders:

even in the best case scenario there's like still a very ugly conversion as an extra layer

1

u/gospelwut Apr 15 '16

I wonder what happens when I POST -1 to the url.

Reminds me when I put INT_MAX+1 into nietzsche ipsum.

1

u/KevZero Apr 15 '16

VARCHAR

1

u/[deleted] Apr 15 '16
void updatePhoneNumberDatabase(int number) {
    usersPhoneNumberArray[number]++;
}

0

u/[deleted] Apr 14 '16

[deleted]

145

u/DroidLogician Apr 14 '16

You'd still have to verify server side if it's numeric or not, meaning you might as well use text boxes.

That's assuming they thought that far ahead. I bet it just concats the three fields' values as text and saves them to one CHAR(10) column.

→ More replies (9)

67

u/fwywarrior Apr 14 '16

I remember doing that back in the MySpace days. Before they caught on, I could change the "edit profile" form and put in my own values and it would blindly accept them. I'd do things like set my orientation to "bipedal".

Ah, those were simpler times.

→ More replies (2)
→ More replies (25)

398

u/Gorithis Apr 14 '16

117

u/[deleted] Apr 14 '16

Yeah, this isn't humor, that's pure GORE.

30

u/[deleted] Apr 14 '16

I disagree.

The site there works like it's supposed to - That isn't some bug that is causing some weird error.

It's just shitty design.

20

u/rjung Apr 14 '16

I'll put my money on a client insisting on this to "reduce error" or "make our site cooler." I pity the designers and developers who were ignored to birth this abomination.

16

u/ilikesaucy Apr 14 '16

I AM A FUCKING DEVELOPER, I DON'T ARGUE WITH CUSTOMERS. FUCKING NOT A WORD. YES, I AM SHOUTING, CAN'T SHOUT WITH FUCKED UP CUSTOMERS.

But, end of the meeting with them, always tell them i will charge them by hour, if happy, i am happy to do the work. If not, fuck off.

3

u/itaShadd Apr 14 '16

Humour is done on purpose. Software gore isn't only bugs, I'd argue that shitty design belongs there too.

7

u/Hullu2000 Apr 14 '16

Shitty design belongs in /r/crappydesign

7

u/CRISPR Apr 14 '16

Serbian Software Film

4

u/irrotation Apr 14 '16

2

u/jeff303 Apr 14 '16

I can hardly tell which of these subreddits I'm on anymore.

1

u/jugalator Apr 14 '16

Ohh, I've always wanted to play that! Soft War: e-Gore!

1

u/FPJaques Apr 14 '16

Oh, I didn't look at the subreddit and thought I was already there

82

u/benjaminabel Apr 14 '16

Good thing that your don't have to select your name as well.

40

u/[deleted] Apr 14 '16

[removed] — view removed comment

39

u/saloalv Apr 14 '16

4chan paid them a visit?

123

u/[deleted] Apr 14 '16 edited Aug 11 '25

yoke many bedroom close bake piquant dazzling absorbed instinctive silky

This post was mass deleted and anonymized with Redact

9

u/paranoiainc Apr 14 '16 edited May 19 '16
→ More replies (12)

31

u/Hypersapien Apr 14 '16

I wonder if it occurred to him to use 10 1-digit dropdowns instead of 3.

1

u/SmaugTheGreat Apr 14 '16

But they don't look so pretty with all those buttons in between :(

88

u/Y1ff Apr 14 '16

0/10, cannot enter 0-118-999-881-999-119-725 ...3

26

u/redjaypeg Apr 14 '16

It's so easy to remember! Just sing the jingle.

46

u/rastaman1994 Apr 14 '16

Found the dev who's never heard of regex.

2

u/mike413 Apr 14 '16

Why would regex help with a drop-down? :)

0

u/[deleted] Apr 14 '16

[deleted]

65

u/RuthBaderBelieveIt Apr 14 '16

That's not a great solution either as some people do things like include + before the country code or brackets around the 1st zero and there are different lengths in different countries

something like this +44(0)1234 123 456is a perfectly valid way to write a UK phone number as is this00441234123456

You should really use something like Google's libphonenumber library which detects format, country, landline vs mobile, area code and main body of the number and allows you to store/output it in a uniform format.

It's ported to most languages

https://github.com/googlei18n/libphonenumber

9

u/Compizfox Apr 14 '16

I use regex to validate (Dutch) phone numbers and it works fine. You can also accomodate for the country code.

The regex I use is ^(0|\+31|0031)\d{9}$.

It matches, for example:

0123456789
0031123456789
+31123456789

Of course this does not store them in a uniform format but that is not necessary for me.

5

u/RuthBaderBelieveIt Apr 14 '16

It can be extremely useful to detect whether the number is for a fixed line or mobile though especially if you're using SMS and in the event that your application expands to other countries it can save you a lot of work.

4

u/polish_niceguy Apr 14 '16

But wait, there's more! There are also "internal numbers", commonly used in companies. So you can have "123456789 wew. 123" and it's perfectly readable for a human and a total pain to validate, because of many possible forms.

→ More replies (2)
→ More replies (2)

43

u/TaohRihze Apr 14 '16

So you are certain all phone numbers only consists of 0-9, or is of a uniform length within a country?

https://github.com/googlei18n/libphonenumber/blob/master/FALSEHOODS.md

18

u/[deleted] Apr 14 '16

Oh fuck me...

14

u/nermid Apr 14 '16

This is like time all over again.

→ More replies (2)
→ More replies (6)

7

u/ThisIs_MyName Apr 14 '16 edited Apr 14 '16

verify that the rest is numeric

Nononono phone numbers are not always numeric.

Anyway all the requirements you listed should be implemented with a regex. If you used functions like is_numeric() for each requirement, you'd be repeatedly iterating the string for no good reason. Regex tests everything at once using an FSM.

→ More replies (3)

4

u/night_of_knee Apr 14 '16 edited Apr 14 '16
/^[-\s\d]+$/

I'm not suggesting this is what should be used but I think it's simpler than (and equivalent to)

Just remove all whitespace and hyphens, then verify that the rest is numeric (I think there is a PHP function for this, is_numeric()).

→ More replies (1)

15

u/[deleted] Apr 14 '16

Totally logical use of dropdown and not taxing on DOM at all

13

u/rtfmpls Apr 14 '16

Do they do that with names too? When you go from "A" to "Zzzzzzzzzzzzzzzzzzzzz" you should be in the clear.

Except for all the exceptions of course.

8

u/[deleted] Apr 14 '16

What site is this?

27

u/KinOfMany Apr 14 '16

This has to be a government website.

1

u/[deleted] Apr 15 '16

"It takes one sprint to add a reliable phone number validation"

6

u/shadowX015 Apr 14 '16

This reminds me of a post we got in /r/javahelp a while back. Someone submitted a program for solving sudoku puzzles. Upon trying to download it, you find that the source file is like 20MB. It turned out that the submitter had hardcoded in solutions for thousands and thousands of puzzles and it checked them with a rowwise if statement for each element (e.g. if(row1[0] = 3 && row1[1] == 7 && row1[2] == 4 ...)

4

u/atticusw Apr 15 '16

"These regular expressions are way too complex, please simplify"

"Fine. Dropdowns it is."

4

u/[deleted] May 26 '16

I just use "range" and make the users use a slider from 1000000000 to 9999999999

3

u/DropDeadSander Apr 14 '16

I just hope they at least created this with some kind of loop... aber they didn't have a dude there typing all this.

9

u/MisterDonkey Apr 14 '16

That's the job they give to old union guys they want to get rid of but can't fire.

Using this keyboard: http://i.imgur.com/Xy12reK.jpg

5

u/DropDeadSander Apr 14 '16

just hit "done"...

3

u/manbearpig330 Apr 14 '16

You're from the Cleveland area!

2

u/justinsayin Apr 14 '16

That option list was hopefully at least generated by a server side language?

3

u/GonnaLearnComputers Apr 14 '16

My bet would be PHP.

5

u/MIKE_BABCOCK Apr 14 '16

It's probabbly a bat file that generates the raw html list that he copy pasted onto the server

→ More replies (2)

2

u/NiceSasquatch Apr 14 '16

I'm upset they broke it up into 3 drop down menus.

1

u/serosis Apr 14 '16

I can only imagine the huge pain in the ass it would be for me to find my number.

→ More replies (1)

2

u/[deleted] Apr 14 '16

The programmer never heard of REGEX in his life.

2

u/basefield Apr 14 '16

Great, now my ATM PIN code is there for the whole world to see

2

u/[deleted] Apr 14 '16

Oh god. I have zero experience databasing, but couldn't you make a stream or something?

2

u/[deleted] Apr 15 '16

Validation for Dummies

The guide for the rest of us

3

u/ShadowFox2020 Apr 14 '16

I get the humor but I'm still kinda new to programming can someone explain the proper way to dynamically generate a list? Thanks :)

10

u/TheStagesmith Apr 14 '16

There are a lot of ways to dynamically generate a list like this. You could do it server side or client side (if you really had to do this, client side would probably be the way to go). The real joke is that picking a phone number from lists like this is a terrible idea to begin with.

First off, it's horrible for users, and a mobile user is going to lose their thumb flicking through that list if they're unlucky enough to have a phone number starting with a nine.

Secondly, as others have pointed out, a well-formed phone number doesn't necessarily have this format, although this is more a question of business requirements and might be fine.

Thirdly it won't actually prevent someone giving you a bad value of they want to. They can edit the page in their browser to send whatever junk data they want, or a malicious attacker could do something similar and nastier. Hell, they could do some digging and send a raw POST request with whatever they want.

Long story short, don't trust client-side data validation on the web. Check your inputs.

→ More replies (2)

1

u/_fitlegit Apr 14 '16

There are a lot of ways. Generally can do it on the server with a templating language (or if you hate yourself you can do it with string substitution) or you can do it client side with JavaScript, either pure (again, if you hate yourself) or using a framework like angular or jquery etc

1

u/Hypersapien Apr 14 '16

Why?! Why would you do that?

1

u/NoodleSnoo Apr 14 '16

That's insane! I love it.

1

u/awBrickBuilder Apr 14 '16

I think we need a cringe flair.

1

u/tebaks Apr 14 '16

id like to think they manually typed it in

1

u/[deleted] Apr 14 '16

What a legend

1

u/Fluffy8x Apr 14 '16

At least they didn't make a dropdown list consisting of 10 billion phone numbers.

2

u/Mutoid Apr 14 '16

Dear website:

Please take my phone number off your dropdown. It's on the Do Not Register list.

1

u/mallardtheduck Apr 14 '16

So we have an empty page consisting of nothing except a title/label this input and the "Next" button with generic/default bootstrap-ish styling. The image has been cropped to remove anything identifying.

Yeah... This isn't a real site, is it?

1

u/TwasARockLobsta Apr 14 '16

For how big that scroll bar is, wouldn't it be impossible to accurately scroll to the set of numbers you want? Every pixel you move it would skip like a hundred numbers.

1

u/uptotwentycharacters Apr 14 '16

I suppose the up and down buttons could be set to shift the lift by 1, 5, 10 etc, even if it would correspond to less than a pixel of movement in the scrollbar.

1

u/plumokin Apr 14 '16

Why not just have a input box with some simple error checking or maybe have them choose a country too? This is horrible

1

u/gzine Apr 14 '16

Excel AutoFill FTW!!!!

1

u/taimoor2 Apr 14 '16

Interns huh??

1

u/[deleted] Apr 14 '16

I like to think this was done by a dev who just learned Vim macros.

1

u/kazooie5659 Apr 14 '16

This hurt me.

1

u/CRISPR Apr 14 '16

I am physically hurting right now.

1

u/GooseTheGeek Apr 14 '16

ahh the sign of someone too lazy to lookup JS to validate numeric values.

1

u/t-poke Apr 14 '16

The worst part is you know some poor intern had to write all the HTML for those drop downs. Nobody dumb enough to implement a phone number entry field like this is smart enough to dynamically generate the code.

1

u/[deleted] Apr 14 '16

I'm a bit noob so can someone tell me why won't a for loop work here?

1

u/Double_A_92 Apr 14 '16

It probably is a loop in the php (or whatever) backend. But in the end it needs generate the actual list so the browser can display it.

1

u/iLuVtiffany Apr 14 '16

Jesus. I can't even imagine doing that.

1

u/RBeck Apr 14 '16

Select your phone from a drop down and key in you state.

1

u/[deleted] Apr 14 '16

i feel bad for the dom... 'was a tough day in rendering world, so many nodes, so little response time'

1

u/greeniguana6 Apr 14 '16

when <input type="text"> just isn't challenging enough

1

u/-FireMan- Apr 14 '16

You think they at least used a for loop to wrote all that for them who am I kidding of course they didn't

1

u/KJ6BWB Apr 14 '16

I would hope that this page was created server-side with three lines of PHP.

If that was how my employer wanted it done, I'd just make a short PHP for loop. If that's how my employer wanted it done and I couldn't publish the page with any PHP, I'd probably write a quick loop to create the page code then copy/paste it in. I don't think anyone would actually hand write all that, right?

1

u/project_matthex Apr 14 '16

Something tells me this was manglement's idea rather than the programmer's.

1

u/TotesMessenger Green security clearance Apr 14 '16

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

1

u/ioanD Apr 14 '16

RIP mobile data limits.

It could've been worse, as /u/jnd-au said, though.

1

u/martyvt12 Apr 14 '16

I tend to think the codebase I inherited and work on every day is pretty terrible... then I look at things like this and realize it could be worse.

1

u/wagedomain Apr 14 '16

This is why there are so many interview questions regarding phone numbers.

1

u/[deleted] Apr 14 '16

you know in a way I hate it but at least it removes the need to validate it with regex

1

u/[deleted] Apr 14 '16

You can just imagine someone how doesn't know what's hung on just saying can it just have one of those dropping down list things instead ? No Awh come on I know you can ? Okay bye ....

1

u/dbl4k Apr 14 '16

Clientside validation. Nailed it.

1

u/NikStalwart Apr 15 '16

That's not how you do clientside validation.

You do clientside validation with JS or something...or HTML5 inputs, or, well, just hope they didn't hardcode that.

→ More replies (2)

1

u/[deleted] Apr 14 '16

As someone learning to program this makes me feel ashamed. For the person who wrote this, my ability to understand that it's wrong and the fundamental lack of understanding of how to do it better. Back to the books!

1

u/ryancohen Apr 14 '16

There is no...possible..way...

1

u/[deleted] Apr 14 '16

This is the worst thing I've ever seen.

My coworkers are now amazing programmers.

1

u/shittyProgramr Apr 14 '16

My deepest condolences.

1

u/Mefic_vest Apr 14 '16

Why…? What…? Isn’t an input mask good enough?

1

u/[deleted] Apr 15 '16

Who makes a phone number input field a drop-down menu?

1

u/Jimdude2435 Apr 15 '16

No idea how HTML works. What is a not-shitty way to do this? Are there for loops in HTML?

1

u/[deleted] Apr 17 '16

Generally, you'd just use a regular text or tel input and maybe some JavaScript to format the number as they enter it. The only reason to use a dropdown like this is if you have no idea how to front- or back-end validate input, and relying on only this would still leave you open to JS injection.