Lurker News

Comments (199) 48 threads

Earlier comments
jxf1 reply#
I think this is a neat way of encoding things. But this also has a lot of shortcomings that existing mailing addresses don't have; it's really only useful for identifying a physical spot, which is what a lat/long and geocodings of mailing addresses will do anyway.

Additionally:
* What if you live at an apartment?
* What if your address doesn't correspond to a fixed physical location, like an APO?
* Aren't the city and country redundant if you have a physical lat/long location?
Still, we need to look at how we send information to our fellow humans. Addresses are important and I'm glad folks like the OP are taking a closer look.

robalfonso#
I think a couple changes would be required to address the shortcomings:

apartments need a z value as you already have a x and y - of course you need to account for height above sea level if you keep to the same type of measurement as lat and long (rather than just saying floor 2). It could be tricky for someone to sort that out for themselves.
I'd think a prefix on the address could indicate a special case that needs to be handled differently to fix APO etc.
I played with the demo, it seemed like the city/county operate as a checksum so you can verify the location you've decoded. Its not needed but nice to have

acangiano2 replies#
Great idea / initiative but I must ask, are you new to Ruby? I've rarely come across code that was so not idiomatic.
roberdam2 replies#
Thanks, yes, I'm ashamed of my code, this is my first project in ruby , my last programming work was 15 years ago, (Foxpro for DOS) so this is my comeback to programming.

I hope that being opensource will help it to improve.

jwn#
I applaud you for putting it out there! Fear of negative feedback often keeps me from releasing code in situations like this.
acangiano1 reply#
No sweat, man. You are new to the language and you're putting yourself out there. Major kudos for that.

Now, for some low hanging fruits / pointers:
- $name is a global variable. Virtually unused in idiomatic Ruby.
- @name is an instance variable. So it's perfectly ok to use it... within a class.
- You should omit the 'then' after each if.
- I'd use find_words rather than busca_palabras.
- Except for rare edge cases, you can drop the .nil? from if my_var.nil?. If my_var is nil it will on its own make the condition false.
- I would use more spaces. 'a = 1' instead of 'a=1', 'b == 0' rather than 'b==0'.
- Use indentation consistently. 2 spaces.
- The else clause is indented at the same level as the leading if.
- Use && instead of 'and' in conditionals. Likewise || instead of 'or'. These short circuit the evaluation for you. So if the first argument is false && won't bother evaluating the second argument. Likewise, if the first argument is true || won't bother executing the second argument as it doesn't matter.
- Ruby is an Object-Oriented programming language. I would look into modules and classes to restructure the code in a less procedural way.

roberdam#
Thank you very much acangiano, I will review all the code with your guidelines at hand!.
jsjohnst#
At first I thought you might be being overly critical as can sometimes be the case here, but glad I checked the code. Your comment is spot-on.
codev10 replies#
My current location is 5308 AFRAID ANUS. Might be best to exclude ANUS from the word list.
roberdam2 replies#
thanks codev, added to the TODO!
perfectfire#
Probably don't want SCROTAL in there either
codev#
Great. It's a nice project, nice demo as well.

I realised when I was living in Japan recently how much I miss the UK postcode system. When I'm in the UK I can give anyone a short alphanumeric string and they can find me. A global coordinate system like this is really useful. I hope you can get some traction with it.

erelde#
What are you afraid of?

More serioulsy. I think there are curated word lists out there without swear words.

jdhawk1 reply#
My Street is "BASTARD BOX"

Jee, thanks.

throwanem1 reply#
Are you kidding? I'd love to have my address be BASTARD BOX. So apropos.
luckystarr#
My subway station is apparently a SHITHOLE.
wscott1 reply#
Note you can click on many of the words and cycle over alternatives.
sp3321 reply#
If you look at the word list, there are many options for each set of numbers. "Anus" could equivalently be any of:

ANUS CUFFLINK GRETNA EMPT WAIFS UNAS FUMOTO GUIDOS ASUN GOOFER GANTER ACKNOWLEDGMENTS YOCHEVED OVERCOMETH WIFIE USAN EDICIONES UNDERPOWERED CALIFIORNIA DESPRES

aw3c2#
> CALIFIORNIA

grin

alanbernstein#
Mine is BASTARD ASSHOLES
jabzd1 reply#
Mine is 8763 UNTIL DICK, word list definitely needs a review.
sp332#
You could be DICK UNTIL 8763... no wait
echeese#
I'm at "ETERNAL SHITTIN" No thanks.
jvogt#
First two clicks in the default map location:

8529 WANT FILTHY
8529 WANT EXPLOSIONS

irrational#
Mine is SUPERMAN KRYPTON which I rather like. I could also go with EMERGENCY REBEL, DOUGLAS PHOTOS (I live in an area with lots of Douglas trees), CATATONIC TYRANNOSAURUS, etc.
datenwolf#
IMHO the Maidenhead Locator System [1] solves this problem very nicely. Locations are concise and can be specified with arbitrary precision. And the encoding scheme makes vocal transmission quite robust.

1: https://en.wikipedia.org/wiki/Maidenhead_Locator_System

Load more comments