Live data from Hacker News

Search: .lenght - Github

github.com

11–20 of 106 posts

Re: Search: .lenght - Github

#11
post #2

A common typo, it seems. But I'm a bit confused as to why this was submitted.

In a static language this would be flagged as an error. I assume something less than ideal happens in languages such as Ruby. I once worked at a company where a very early piece of code had a typo "properites" instead of "properties". This misspelling became institutionalized, and was used throughout the codebase because it was deemed too expensive to fix. And this was with a static language (with good IDE refactorin…

In ruby, and I think most dynamic languages, this type of typo is likely to raise an exception. It could hurt, but a simple test run is likely to discover it.

The way javascript (which is what is linked) handles this, as amirhhz described it, leads to silent errors which could turn out a lot worse.

Re: Search: .lenght - Github

#12
post #9

Earlier quoted context omitted.

I'm confused as to why they couldn't simply: grep -R properites .

Perhaps they were using . . . something other than *nix. EDIT: Justly downvoted chastised for attempting humor without understanding.

That command works nicely for me in Cygwin.

EDIT: Eh, apologies if this sounded like chastising -- I didn't mean to. As a developer who's been trapped in "Windows-mindset" for many years, I wanted to try to inspire other Windows devs to try to use *nix-based solutions even if their only option is Windows development. Cygwin is in a very good spot right now -- it's achieved so much acceptance that even the most hardened institutions now allow it to be installed.

Re: Search: .lenght - Github

#13

Is there any context to this or are you just pointing the humor of out how common this is?

Well it is basically a list of bugs -- and a rather long one too.

Of course there are rare cases where "lenght" is a variable and that name is used in every instance but mostly, these are bugs in code that we all use.

Re: Search: .lenght - Github

#14
I remember seeing a Github bot a couple weeks ago that strips out whitespace and adds a .gitignore file to a repo (I also remember this really rubbing some people the wrong way). This search indicates that it would probably be useful to have a linter bot running on Github for all the popular languages. It would find syntax errors, common mispellings, and compilation issues, and then submit pull requests to fix the issues.

I have no time to work on something like this myself, but I'm sure a lot of people would find it useful, especially if it acted as a "first defense" before deployment. Curious what other HN'ers think about this.

Re: Search: .lenght - Github

#15
post #9

Earlier quoted context omitted.

In a static language this would be flagged as an error. I assume something less than ideal happens in languages such as Ruby. I once worked at a company where a very early piece of code had a typo "properites" instead of "properties". This misspelling became institutionalized, and was used throughout the codebase because it was deemed too expensive to fix. And this was with a static language (with good IDE refactorin…

I'm confused as to why they couldn't simply: grep -R properites .

Perhaps the same reason why "referer" has not been corrected to "referrer".

Re: Search: .lenght - Github

#17
post #11

Earlier quoted context omitted.

In a static language this would be flagged as an error. I assume something less than ideal happens in languages such as Ruby. I once worked at a company where a very early piece of code had a typo "properites" instead of "properties". This misspelling became institutionalized, and was used throughout the codebase because it was deemed too expensive to fix. And this was with a static language (with good IDE refactorin…

In ruby, and I think most dynamic languages, this type of typo is likely to raise an exception. It could hurt, but a simple test run is likely to discover it. The way javascript (which is what is linked) handles this, as amirhhz described it, leads to silent errors which could turn out a lot worse.

Yes, but it would raise the exception at run-time, and only when the particular path is taken.
Post reply on HN