Live data from Hacker News

Search: .lenght - Github

github.com

21–30 of 106 posts

Re: Search: .lenght - Github

#23

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.

Re: Search: .lenght - Github

#24
post #4
post #2

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

In JavaScript, if you check for a non-existent property on a variable (e.g. aVar.lenght vs aVar.length) it will return "undefined". So people often rely on this behaviour to check if something is an array or not (no comment on whether this is good or bad), with: if(somethingThatMightBeAnArray.length){ // do things with array } So misspelling of length can be making a lot of code out there behave in an unexpected way.

That is a bad thing as String also have a length property

"bar".length; // 3

Re: Search: .lenght - Github

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

Re: Search: .lenght - Github

#28
post #12

Earlier quoted context omitted.

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

No snarkier than my remark, and less snarky than it might have been for being so much smarter.
Post reply on HN