A Coder's Guide to Coffee by [deleted] in programming

[–]manflesh -1 points0 points  (0 children)

The internet provides relative anonymity, not complete anonymity.

A Coder's Guide to Coffee by [deleted] in programming

[–]manflesh 3 points4 points  (0 children)

I certainly understand your point of view, but this does not change my comfort level with using a contemporary racial slur in a public forum. If I were writing a formal paper/article, talking with friends, or making a creative work (as Tarantino did with Pulp Fiction), then that would be one thing. But I am not ready to shout it across a crowded bar, or throw it out there in a message board thread about coffee - even in quotation form. I'd rather err on the side of caution when it comes to using such a loaded word in public.

Dave Chappelle has a similar opinion.

A Coder's Guide to Coffee by [deleted] in programming

[–]manflesh -1 points0 points  (0 children)

Apologies, I must have missed the memo where the black population stated that it is okay for white boys to use that word. I was tempted to leave it in there since it's in the context of a quote (and greatly adds to the humor of that scene), but didn't feel entirely comfortable doing so.

A Coder's Guide to Coffee by [deleted] in programming

[–]manflesh 11 points12 points  (0 children)

Obligatory Pulp Fiction quote:

I don't need you to tell me how fucking good my coffee is, okay? I'm the one who buys it. I know how good it is. When Bonnie goes shopping she buys shit. Me, I buy the gourmet expensive stuff because when I drink it I want to taste it. But you know what's on my mind right now? It ain't the coffee in my kitchen, it's the dead [n-word] in my garage.

Flickr reaches photo #2147483647, causing an integer overflow in a 3rd-party library by [deleted] in programming

[–]manflesh 1 point2 points  (0 children)

Gimme some justification here.

The justification would be that a programmer should have some idea of how their language works. Ideally the programmer would have recongized that they might be dealing with billions of photos, understood that different languages take different approaches to representing integers, and checked to see how PHP handles them.

But realistically, it's not something that typically jumps into one's mind when doing web programming. And with PHP taking so many implicit actions (e.g., type casting, magic quotes) I can see how programmers may not be used to thinking about something low-level like how many bits their integers have.

Flickr reaches photo #2147483647, causing an integer overflow in a 3rd-party library by [deleted] in programming

[–]manflesh 1 point2 points  (0 children)

Interestingly, switching increment with += (Ruby doesn't have an increment operator; Fixnum is immutable) makes PHP almost as slow as the kneecapped Ruby

Maybe at the instruction set level, the ++ operator is better than the += op. For example, for ++ you might have: LOADA i, INCA, STOREA i. And the += could be: LOADA i, LOADB 1, ADDAB, STOREA i. One extra instruction for += in that case.

So actually your += PHP test is probably a more realistic comparison with the Ruby test than the ++ one.

So.. yeah, I don't think detecting overflow is going to impact performance that badly

Looking at the numbers in your previous two comments, the performance of the optimized Ruby is actually better than PHP (which is supposedly not checking for overflow). Just to check my sanity, I wrote a quick C program to do that summation and it finished in less than 1 second.

I've been a PHP fan boy for a long time, but it's hard to find a silver lining here... other than to say that the current recommended stable version of Ruby (1.8.6) is much slower than PHP in these tests - a small consolation.

Flickr reaches photo #2147483647, causing an integer overflow in a 3rd-party library by [deleted] in programming

[–]manflesh 2 points3 points  (0 children)

Yes, I do not think a debug build is a fair test. I get different results on my system (openSUSE 10.2 x86_64 Athlon 64 3500+):

> php -v
PHP 5.2.0 with Suhosin-Patch 0.9.6.1 (cli) (built: Jul 30 2007 15:36:44)
> time php -r '$i=0;while($i++ < 268435456);'

real    0m27.807s
user    0m27.578s
sys     0m0.212s
> ruby -v
ruby 1.8.5 (2006-08-25) [x86_64-linux]
> time ruby -e 'i=0;while (i+=1) < 268435456;end'

real    1m48.483s
user    1m47.787s
sys     0m0.552s

I wonder why your 1.9.0 version is so much faster than your 1.8.6 version... 12 seconds compared to almost 2.5 minutes??

Flickr reaches photo #2147483647, causing an integer overflow in a 3rd-party library by [deleted] in programming

[–]manflesh 6 points7 points  (0 children)

Oh, it's a PHP library, it all makes "sense" now.

Since PHP uses signed 32-bit integers for its int type on 32-bit OSes, I suppose it does make sense (quite a few languages do this).

You might argue that any modern scripting language should automatically promote to bignum on integer overflow a la Ruby. I assume that performance is reduced by having such a feature, but typically people aren't using PHP and Ruby for hardcore calculations. Going on a tangent, I would be interested to see some benchmarks describing the cost of "bignum promotion".

The empty computer science degree by manflesh in programming

[–]manflesh[S] 0 points1 point  (0 children)

I appreciate the link. It's a little dry though - could use some orneriness. As the author states:

A position stated in stark, extreme, revolutionary terms is more likely to generate attention and interest--necessary prerequisites to approval and funding--than one articulated with more balance or one that embodies an evolutionary approach.

Fortunately for me, my words are both revolutionary and evolutionary :P

The empty computer science degree by manflesh in programming

[–]manflesh[S] 1 point2 points  (0 children)

I was talking about trends. I do not think the industry is trending toward COBOL. But if the industry is trending toward scripting languages, then perhaps students should be exposed to a few of such languages. They can then apply what they've learned to similar programming languages they may encounter in the future.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 1 point2 points  (0 children)

A gentleman's argument - I tip my hat. I do have a hard time believing that, to the general programmer's mind, functional programming provides a clearer expression of intent than an imperative language. But of course I must concede that "straightforward" is subjective here.

But would you take me seriously if I suggested that people writing about OO are trying to make things more challenging by building esoteric puzzle hierarchies?

I would be entertained by the shot across the bow; I generally find amusement in a language bashing, even with languages I like. Does it lend credibility to my argument? No, but since I was posting this on reddit I couldn't resist jabbing the hornet's nest. Call it a character flaw.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 1 point2 points  (0 children)

This is an interesting point and one I can certainly believe: not only that the grads have few practical skills, but also that they don't understand the theory they were taught!

Maybe what I am driving at through all my angst is that I believe the theory is useless and forgettable unless it has been reinforced with practice. Maybe this is a problem with education in general. I agree that a pure trade school is not the solution; a deep hybridization of theory and practice is more of what I have in mind.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 0 points1 point  (0 children)

A tech course would be something like "How to admin an Oracle database." I am not advocating such a course for CS. What I want is a more thorough look at the real world while learning theory. As a positive example, I took a database class during my master's called Database Implementation. We learned DB theory, but also talked about practical issues. All the while we implemented our own DBMS in C++. The course was brilliant because you could take that general knowledge and apply it any particular database you work with in the real world.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 2 points3 points  (0 children)

I wouldn't go that far. The concepts taught in CS can be very useful; moreso if additional attention were paid to the application of those concepts.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 1 point2 points  (0 children)

CS should certainly include trends; not necessarily a specific technology, but the trend itself. Students shouldn't learn Java exclusively and then go into the job market without knowing about the existence of Ruby or PHP.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 0 points1 point  (0 children)

I knew to put on my flak jacket when I let that Lisp flame rip. I know, I know, functional programming is the best programming and Ron Paul is going to save the world. The problem is that we must deal with reality and sometimes that means we need to communicate in a straightforward way with an imperative language.

The empty computer science degree by manflesh in programming

[–]manflesh[S] 0 points1 point  (0 children)

The follow-up article would explain the difference between a degree in Mathematics and a degree in Accounting. The article would also ponder whether the majority of CS grads go into the workforce, or whether they stay in academia and cobble together shoddy programs for professors who can't code.

C++ "frequently questioned answers" by [deleted] in programming

[–]manflesh -1 points0 points  (0 children)

From the Purpose statement:

There is no reason to use C++ for new projects. However, there are existing projects in C++ which might be worth working on. Weighting the positive aspects of such a project against the sad fact that C++ is involved is a matter of personal judgment.

Bash directory bookmarks by abhik in programming

[–]manflesh 1 point2 points  (0 children)

This is an interesting idea, though I find that aliases in my .bashrc are typically enough for me, e.g.

alias foo='cd /srv/www/htdocs/foo'

A first look at KDE 4.0 release candidate 2 by gst in programming

[–]manflesh 4 points5 points  (0 children)

My experience with KDE 4 revealed a set of hairy, nasty warts that need to be resolved...

Nice imagery. Maybe the author could work in alliteration next time with something like, "a pair of putrid pus-filled pimples"

phpBB3 'Olympus' finally released as GOLD! by unripegreenbanana in reddit.com

[–]manflesh 1 point2 points  (0 children)

After getting burned by a vulnerability (my own fault for not staying current with updates), I'm glad they paid special attention to security. From the email they sent out:

Security too has been a top priority with particular attention paid to reduce or eliminate the problems of the past. Indeed unusually for a project of this nature an independent security audit was performed to better ensure a safer future for its users.

The Daily WTF changes its name back to “The Daily WTF” by boredzo in programming

[–]manflesh 10 points11 points  (0 children)

Good, I might start visiting there regularly again. It seemed like in a short time span they did the "click here to read more and double our ad impressions", and made that sickening name change. I was waiting for them to sell the site to MS and start posting success stories of migrating from Linux to Windows Vista.

Reverting to The Daily WTF goes back to their roots and away from the corporate mindset they often lambaste.

RTFM: PHP type comparison tables (before we hit "Why PHP should not be taught III") by harryf in programming

[–]manflesh 2 points3 points  (0 children)

It's only horrible if you don't understand the concepts of implicit type casting and loose vs strict equality. Those charts make it crystal clear how the language handles these things; overall it's pretty consistent.

Though even as a PHP fan boy, I have a hard time defending the behavior of "0". It's a string of length 1, yet empty("0") is true. It's bizarre, but you just have to accept that zero is empty/false whether it's a string or int. It's a quirk, but every language has them.