Live data from Hacker News

Search: .lenght - Github

github.com

41–50 of 106 posts

Re: Search: .lenght - Github

#41
post #9

Earlier quoted context omitted.

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".

Yes, it was exactly like that- lots of code had grown around the "bug", and it was not immediately obvious what other software had come to depend upon it. "Little hairs", as Joel might say.

Re: Search: .lenght - Github

#42
post #20
post #7

[deleted]

It's not, because reutrn is a syntax error, but .lenght is valid and would return `undefined`.

Yes it is, it would work fine as a variable. E.g.

  var lenght = 23;
  console.log(lenght);
will not cause any troubles. And many of the results returned by the search are of this kind.

Re: Search: .lenght - Github

#43
post #21

most of them are variable names which is acceptable!

Not at all. It's irritating and confusing.

Come back to that code in a year and try to extend it, stuff will break because you start to use the correct name.

Re: Search: .lenght - Github

#44

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 is…

I actually just replied with a suggestion that Github should implement some built-in functionality for simple error-checking. I think it's a great idea. It would be really helpful if you got a simple little list of notifications for a commit indicating possible error points.

So basically something like Krazy does with KDE: http://ebn.kde.org/krazy/

Re: Search: .lenght - Github

#45
post #26

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 is…

I wrote that bot! https://github.com/Miserlou/WhitespaceBot Feel free to fork it to do whatever you want, that's why I made it.

Ah, aggressive trailing whitespace removal. That I can completely get behind. I've already got command-s bound to a custom macro that strips trailing whitespace in TextMate for myself and my co-workers; but this would be an even more inclusive solution.

Re: Search: .lenght - Github

#46

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 is…

Perhaps it would be more productive to advocate the use of local pre-commit hooks. Git makes it very easy to configure validation locally long before anything gets sent to Github.

Would be nice if Github provided better documentation and a selection of validation templates to include in new projects. This would better leverage the power of Git and its distributed nature than a bot running on Github.

Re: Search: .lenght - Github

#47
post #31

I thought this is actually interesting but I would like to know if >4k misspellings is a lot or not. Here is one way to do it: LANGUAGE #LENGHT #LENGTH = #LENGHT/#LENGTH JavaScript 4252 2907459 = 0.0015 C 18981 2902857 = 0.0065 Java 7706 2348900 = 0.0033 Ruby 10789 1690604 = 0.0064 C++ 9458 1315552 = 0.0072 PHP 3116 1167924 = 0.0027 C# 1352 937647 = 0.0014 Python 3662 737292 = 0.0050 Ruby 1232 380484 = 0.0032 Perl 12…

C# I can understand being so low, since it's almost always written in Visual Studio or MonoDevelop (both of which provide autocompletion). But how is JavaScript the next lowest?

Hmm, I guess it's because length is a commonly used function in Javascript, but not in other languages. In Python you do len(list) instead, so the word length is more likely to appear in comments and therefore less likely to be corrected.

Re: Search: .lenght - Github

#48
This reminds me of a US company I worked with that outsourced some of their service layer work to a company with heavy European influence. As a result, API methods also had the spelling of certain words eg. getColour() or getFavourites(). Good times.

Re: Search: .lenght - Github

#49
post #31

I thought this is actually interesting but I would like to know if >4k misspellings is a lot or not. Here is one way to do it: LANGUAGE #LENGHT #LENGTH = #LENGHT/#LENGTH JavaScript 4252 2907459 = 0.0015 C 18981 2902857 = 0.0065 Java 7706 2348900 = 0.0033 Ruby 10789 1690604 = 0.0064 C++ 9458 1315552 = 0.0072 PHP 3116 1167924 = 0.0027 C# 1352 937647 = 0.0014 Python 3662 737292 = 0.0050 Ruby 1232 380484 = 0.0032 Perl 12…

C# I can understand being so low, since it's almost always written in Visual Studio or MonoDevelop (both of which provide autocompletion). But how is JavaScript the next lowest?

Because the built-in .length property is frequently used, and will fail if misspelled.

Whereas C and C++ programs tend to have a lenght operator implemented by the programmer, and from there the error gets snowballed by IDEs and debuggers.

Post reply on HN