You are not resetting the Stopwatch so EllapsedMilliseconds continues to grow with each Start/Stop
Many readers will take what you write as the last word in programming.
I do not think any programmer should ever do that for anything he or she reads, even if itās Knuth. And I am far, far from Knuth.
I completely disagree Niyaz. A blog is an author expressing his or her thoughts/ideas, nothing else. If readers take what is written on a blog for a fact, well frankly that is not the authors fault.
Itās as with every other type of media. Donāt believe it just because you read/hear it. Think for yourself.
Was the Happy Gilmore (as opposed to Billy Madison) reference a joke pointed at the misinformation youāre talking about? =)
Heh, you give me too much credit. Iām not that clever. Fixed the post.
You are not resetting the Stopwatch so EllapsedMilliseconds continues to grow with each Start/Stop
Look more closely, or, try it yourself and see.
Hmmā¦ I really donāt see how you can seriously compare a blog entry about a verifiable technical issue and a blog entry that can affect a personās life and can only be validated over the course of a career.
Also, you didnāt pick the most salient criticism from the reddit discussion:
http://www.reddit.com/r/programming/comments/78vq3/jeff_atwood_finally_jumps_the_shark/c05zp1u
The thing with articles like this is, itās basically boosterism for the term Marketing. It starts with the (shocking) claim that marketing isnāt so bad - actually we should all be good at it. Then it says, Actually by marketing we really mean basic communication skills, so donāt be frightened of this term marketing or of being good at it!
What irritates the shit out of me is that it conflates these two, falsely. What Atwood really means - what he can ONLY mean - in this conflation is that marketing is more important than programming in a programmer. Normal communication is not the same thing as selling yourself or selling what youāve been up to lately. And the conflation is a totally Marketing attitude. To Marketing, everything is marketing. You know what guys? Itās a good idea not to be a shrinking violet, and to have some conversation skills. And yes, the boundary between non-manipulative communication and manipulative communication is hazy. But telling programmers that they should all practice a more or less professional salesmanship, because they are (apparently) all social misfits, is insulting, and fucking annoying.
Tchami,
I will not take whatever written here for a fact; nor will you.
But that does not relieve Jeff from writing responsibly. This blog is high up in Google for many search terms and there are a lot of visitors to this blog. You cannot run away from that fact.
If Jeff can do something to stop WTF programmers from made, that is to write excellent programming articles that can be used as a fact rather than whining about the fact that this is ājust a blogā.
āJust a blogā applies to my blog where there are only a handful of readers. The ājust a blogā excuse cannot be used for a very popular blog like this for giving incorrect information.
Jeff, the point for me is revealed in this sentence of yours:
But, like any veteran internet user, I never take what I read on a blog ā or any other site on the internet, for that matter ā as fact. Rather, itās a germ of an intriguing idea, a call to action.
Many many programmers (or internet users in general) believe what they see - without doing the investigation first. I disagree with Niyaz PK above - users who do not do the extra fingerwork to verify what they read will be burnt by their lazieness sooner or later - and thatās a good thing. You can only write about what you know - even if in the due course of events that turns out to be incorrect. Scientists have been working this way for hundreds of years. To suggest that we (as bloggers) start writing about nothing but the absolute truth is patently absurd (besides, some people will argue that trut is subjective rather than objective).
Keep up the good work.
See what ? that the timings always increase because you do not /reset/ ? You do start and stop, but /reset/?
Jeff Atwood has always held the distinction of having the most dangerous programming blog ā¦
The arrogant, angry and hysterical will always be with us. I hope so. Theyāre so CUTE!
Jeff,
Normally, it is the just the nature of media that people belive what they read,hear or watch. However, in your niche, people who are reading this blog, are genreally intelligent people, who should verify what they reas. Also a blog is meant to stimulate the thoughts, and should not be taken as absolute jugdement. Also, if you keep a lot of peopleās interest in your mind, it kills the creativity.
Jeff, Iāve seen quite a few comments/posts on Reddit bashing you lately.
Mostly itās just people who need to get over themselves and realize they have better things to do with their time.
Iāve often found your blog very educational, and your writing style pleasant too.
You bring up lots of topics that are useful reading, but might be unknown to many of your readers (like me).
As for all the bashing, I think should just ignore it all.
Besides, saying something like What youāve just written is one of the most insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought is just one of the most insanely idiotic things Iāve ever heard.
Somewhere on the Internet, a typical redditor just creamed himself and felt an urge to post CCC-C-C-C-COMBO-BREAKER!1!.
Considering Blogs Harmful Considered Harmful Considered Harmful Considered Harmfulā¦
sw.Start() should be sw.StartNew(), Mr. Dangerous.
How can GZip be faster than Deflate? GZip uses the exact same compression algorithm as Deflate (the deflate algorithm), but adds a header and a footer and calculates a CRC-32 checksum. Because of this, it should ALWAYS be slower than Deflate.
The fact that in your test GZip comes out faster might be because of the garbage collector or some other external factor. I suggest you change the order of your code: first test Deflate and then test GZip. If GZip is still faster, Iāll retract my words.
You are not resetting the Stopwatch so EllapsedMilliseconds continues to grow with each Start/Stop
Sorry to say this Jeff, but Iād agreeā¦ MSDN states that the call to Stopwatch.Stop() does not reset the counter, and calling Stopwatch.Start() will continue from the previous time.
It seems to fit your data too. Looking at the differences between values,
GZip - Compress = 243, Decompress = 163
Deflate - Compress = 231, Decompress = 157
Not much in it really. Probably what I would expect considering the similar processing involved.
P.S. Iām with you on the dangerous principle though Jeff. Never just believe anything you read/hear - always ask youself - do I agree? Does this make sense?
So, fixing the reset:
Gzip size: 3125
243-000=243
406-243=163
deflate size: 3107
637-406=231
794-637=157
They are close to each other, and decompressing takes less time than compressingā¦ Much more sensical.
a blog entry that can affect a personās life and can only be validated over the course of a career
At the risk of really distasteful name dropping and speaking on behalf of other people, Iām 99.9% sure that Steve Yegge and Joel Spolsky would all agree with the point of yesterdayās post: Learning a little bit about marketing will make you a better programmer.
So, based on the sum of our careers, that is one thing we have all learned and would like to share with other programmers.
what he can ONLY mean - in this conflation is that marketing is more important than programming in a programmer
Never said that, of course, and I donāt believe it.
Thomi, Varun Mahajan, Jeff
What I can understand from your points:
It is OK to write whatever you FEEL like writing in a programming blog. The readers are supposed to be intelligent (if not, they are doomed. isnāt it?) and so they ought to search and find the correct information from somewhere else.
Is that it?
I mean, I seriously cannot understand this. What is the need for reading all these blogs if I should verify every single word you write?
Also, tell me guys, where am I supposed to get the CORRECT information from?
Some other programming blog? What is the guarantee that it will be correct?
Some programming website? What is the guarantee that it will be correct?
Wikipedia?
What is the guarantee that the information in the WWW is correct if everybody thinks like you guys?
You try your best to write a correct article. Mistakes may happen; acknowledge and update. That is what I would suggest. (Rather than telling people will verify whatever crap you will write)
You do start and stop, but /reset/?
Of course youāre right.
sw.Start() should be sw.StartNew(), Mr. Dangerous.
Yep. I hope no young, inexperienced programmers were reading that! Corrected.
Wellā¦maybe Jeff, but you gotta admit this is a great quote.
No, heās more like those girls in elementary school who were really good at jumping rope, and would jump the two opposite-ways-spinning ropes during recess for minutes at a time.
Only with sharks.
Wow, thatās bad-ass!
WOW!!! how do you get them to bend like that?..I mean I know theyāre mostly cartilage and all but still. And Iām assuming the tail is easy to hold on to but what about the other end with all the pointy-bits? what do you hold on to there?
Love the show.
Jeff,
From the doc it does seem like, Reset() is required in the stopwatch, havenāt used the class so donāt know what the actual semantics are.
But fits nicely into the pattern that you describe, 2x improvement for larger strings and smaller for smaller files.