

Show HN: WordCount.is - joelrunyon
http://wordcount.is

======
joelrunyon
This is my first ever endeavor into some sort of programming.

I use evernote or textedit to write a lot posts or guest post and there's not
always a quick way to check word count before I send them off. In addition, a
lot of wordcount sites out there were ugly, hard to use or filled with ads.

I know it fills a really, really small niche need, but I was pretty happy I
could put it together in a few hours, solve a small problem and learn
something about programming at the same time.

Now, to move on to bigger projects!

~~~
markszcz
This is what I see in case it differs from you: <http://imgur.com/jhjSV> Im on
Windows 7 using Chrome.

Personally I feel as though the gray box explaining what the page is, is
taking up most of the page. Any way to make it smaller? This way I feel as
though it would remove any scroll bars on the page and prominently show your
"WordCount.is is a useful web utility by Joel Runyon"

Other then that, page looks clean and is simple to use.

~~~
joelrunyon
Thanks for the feedback. I'll see what I can do.

~~~
5xz41s0P8T5N
I actually expected the word count to show up in the grey area, I think it
would look nice.

------
erichocean
As a funny little anecdote, I know of a Mac word processor company that, as a
tiny update, added a live word count feature to their product.

Sales shot up 30%.

It turns out that a number of people who write for a living need to hit hard
word count limits, and were willing to pay for a product that had that
feature.

The dev I know who added the feature said he spent all of 15 minutes on it.

~~~
joelrunyon
I'm surprised at how many people leave this out. It's a simple function that
most writers/editors use, but for some reason lots of writing applications
leave out.

------
skymt
While already quite clean, your JavaScript can be simplified somewhat. split()
will take a regular expression:

    
    
        var wordCount = value.trim().split(/\s+/).length
    

Additionally, JavaScript's regex dialect has a special character of "\W",
which matches any non-word character. So if you split on "\W+" instead, you
ought to get a more reliable list of words, eliminating cases like "foo --
bar" counting as 3 words.

~~~
ThomasQue
I was wondering what a word (in a word count) was, thinking like you that "foo
-- bar" was only two words, just like "foo-bar" or "foo/bar". So I started two
widely used word processors and got surprising results : "foo -- bar" is
actually considered 3 words long in both Microsoft Word 2007 and LibreOffice
Writer 3.6.1.2, but "foo-bar" and "foo/bar" are 1 word long. There seems to be
no standard as to what a word is in this context :

    
    
          Different word counting programs may give varying results, 
          depending on the definition of "word", on the text segmentation
          algorithms, and on whether words outside the main text such as
          footnotes or hidden text are counted. [1]
    

Anyway it seems a consensus to say that "foo -- bar" is 3 words long, so
wordcount.is does give a not so wrong answer after all.

[1] <http://en.wikipedia.org/wiki/Word_count>

------
thomasfrank09
Nice first project Joel!

Evernote is one of the rare programs that's very much inferior on the Mac, as
the Windows version DOES have a word count feature. I'm really not sure why
the team can't include it on the Mac version.

~~~
joelrunyon
Thanks Thomas.

I love Evernote, but this is one of the minor details that could be improved.

~~~
msarnoff
Evernote for Mac has had word count for several months now. Click the "i"
button, the popover shows the size of a note, and its word and character
counts.

------
jaredsohn
I was going to suggest making a browser extension out of this, but after some
searching see that it has been done before. (On Chrome:
[https://chrome.google.com/webstore/detail/kmndjoipobjfjbhocp...](https://chrome.google.com/webstore/detail/kmndjoipobjfjbhocpoeejjimchnbjje)).

This seems useful for people who 1) are not programmers, and 2) either are
running a browser where there is no such extension, aren't interested in
installing extensions, or have a one-off need.

------
drewschrauf
Very clean design and targets the niche nicely. One of my pet peeves is broken
wordcounts though. A single space registers on your site as 1 word. Can I
suggest checking out my post about javascript wordcounts?
[http://drewschrauf.com/blog/2012/06/13/javascript-
wordcount-...](http://drewschrauf.com/blog/2012/06/13/javascript-wordcount-
that-works/)

------
sidcool
Congrats on your first project. Useful features: 1\. Detect whitespaces in
count 2\. Count of a specific word/character in the text

~~~
joelrunyon
Good ideas. I'll see if I can figure that out!

------
steve8918
For a first venture into programming, this was nicely done!

One thing, I thought the definition of a "word" is something like 6
characters, so a really long word could be considered 2+ "words". It seems
like your definition of a word is a set of strings separated by a space. Is
this intentional?

~~~
joelrunyon
Hey Steve, I'm not aware of that definition. Hmm...Would have to have a link
to that definition? I guess tweak the script pretty simply if that's the case.

But yes, to answer your question, this is a word count as defined by spaces
between words.

~~~
binarysolo
Off-the-cuff thoughts: is a number (say "12") a word? Is a hyphen -- used,
say, like this -- a word? They count as 'em in your webapp, but I'd be curious
what the official definition of word actually entails.

~~~
joelrunyon
I think it depends on your definition, but broadly, yes, I would say most
would count "12" as a word.

------
PuercoPop
Nice but I think it is a little bit lacking on the feature side even for a pet
project. As others point out there are already a ton of ways to obtain a word
count. Maybe you add value by providing a frequency chart of words?

~~~
joelrunyon
It's not really supposed to have a lot of "features." It's a single-purpose
site – find your basic word count.

It took me a few hours and taught me a little about programming. I view it
much more as a stepping stone to understanding development and programming
than as a full-time business project.

------
robertduncan
wc(1) to the rescue! :)

~~~
slig
If you're on OS X: copy the text to the clipboard and run pbpaste | wc

~~~
dlsym
If you're on Linux: Select text and run xclip -o | wc

------
zrail
Pretty cool. Congrats on releasing!

~~~
joelrunyon
Thanks zrail!

------
ssazesh
Good stuff Joel! This is clean.

~~~
joelrunyon
Thanks man! :)

------
ruswick
For whatever reason, this counts prefixed whitespace as a single word.

------
electic
Why is this a service and not a .js file?

~~~
peacemaker
I have to agree. I mean, it's nice and all but really it's a function you can
write in a few minutes. I don't think it needs a website and a submission to
HN.

~~~
joelrunyon
Thanks peacemaker. Maybe as I get better I'll get faster at programming.

In the meantime, it was fun to be able to solve a problem I had by learning
something I didn't know before.

~~~
peacemaker
I agree it's good to get out and learn things like this, I'm just not sure you
needed to post it here?

*Thanks for the downvotes too...

