Live data from Hacker News

Search: .lenght - Github

github.com

51–60 of 106 posts

Re: Search: .lenght - Github

#51
post #20

Earlier quoted context omitted.

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.

Were you replying to me? I explicitly said .lenght would return undefined. As in, a typo on the .length property.

Re: Search: .lenght - Github

#54
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 .

Obviously you have never worked on a code base with 1000s of developers. If you edit almost every file then basically everyone needs to stop writing new code while the change is made. Otherwise the merges others have to do is going to be a disaster.

Re: Search: .lenght - Github

#57
post #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.

I'll look for more on this, but if you had something you would recommend as a tutorial, I'd appreciate it.

Re: Search: .lenght - Github

#58
post #9

Earlier quoted context omitted.

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

Obviously you have never worked on a code base with 1000s of developers. If you edit almost every file then basically everyone needs to stop writing new code while the change is made. Otherwise the merges others have to do is going to be a disaster.

Honestly, do you really work on the same code base with "1000s of developers"? I find it really dubious.

Re: Search: .lenght - Github

#59
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?

C# is also a compiled language, so you wouldn't be able to get anything to run with a typo like that hanging around. I find it surprising that there are so many commits making that mistake!
Post reply on HN