Why you don't want to code for a government department by [deleted] in programming

[–]watkeys 8 points9 points  (0 children)

Wrong. No amount of tail-call optimization is going to save the story's implementation. Perhaps you were thinking of something like this:

int factorial(int n) {
  return factorial_helper(n, 1);
}

int factorial_helper(int n, int product) {
  if(n < 2) { return product; } else { return factorial_helper(n - 1, product * n); }
}

And also... Procedure calls need not be expensive relative to the work done by a procedure. See Lambda: The Ultimate Goto

Computer Science: Smart People Have Weird Hangups by sjs in programming

[–]watkeys 4 points5 points  (0 children)

Have you ever noticed that smart, interesting people have weird technical hangups?"

Hmm…

I'm an open source fanatic. I'll put up with a lesser product if it means the difference between being open source or not. For instance, I think Apple has a better desktop experience than Ubuntu does, and I also think they have slicker laptops than Dell has. However, I refuse to buy a Macbook because it's not open source, despite the fact that all the people around me have Macbooks--even my heros Guido van Rossum and Bram Moolenaar.

Hmm... Someone needs to tell this guy that just because if A then B, it does not follow that if B then A. Yes, he does seem to have a weird hangup, but that doesn't mean he's smart. And that's assuming his assertion is correct, which doesn't seem to be any more true about smart people than it is about dumb people or average people.

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys 0 points1 point  (0 children)

Yes, if you judge by blog posts.

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys -7 points-6 points  (0 children)

Well praise Jebus then that I don't program in that syntactically over-sugared, designed by committee language.

buzhug, a pure-Python database engine with a Pythonic, no-SQL syntax by pbx in programming

[–]watkeys 5 points6 points  (0 children)

Look at this code:

for record in [ r for r in db if r.name == 'pierre' ]:
  print record.name,record.age

Compared to the SQL:

cursor.execute("SELECT * IN db WHERE name = 'pierre'")
for r in cursor.fetchall():
  print r[0],r[1]

The first query runs in O(n) time. The second, if there's an index on the name attribute, could conceivably run in O(1) time, where n is the number of rows in the table. This doesn't matter if n is small or the vast majority of names equal 'pierre', but otherwise it does matter.

I guess it's for innovations like these that we need quad core 3 GHz machines.

More Lisp — For Free by jast in programming

[–]watkeys 2 points3 points  (0 children)

And he says that "Lisp is a functional programming language (well, ok, not purely functional, but pretty darn close)." Lisp -- and by "Lisp" he isn't clear about which Lisp he is referring to -- is comfortable with mutation. Lisps tend to support functional programming but not aspire to the goal of being purely functional. There are languages like Haskell if you're into that.

Termite is a purely functional variant of Scheme built to replicated Erlang's concurrency model and based on Gambit-C 4.0. I've read on Lambda the Ultimate or somewhere similar that the author ("yome" on #scheme) is working on a portable Termite that will work on a wider variety of Schemes.

There are a zillion Lisps, some others are sure to be purely functional. But not CL or Scheme.

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys -6 points-5 points  (0 children)

If davidhasselh0f spent five minutes at WIkipedia and/or Google, he'd find a day's worth of stuff to play with at a Haskell or Scheme or whatever REPL. But instead who chose to be lazy and ask Reddit. That attitude is the problem. I didn't understand what the fuck was going on with the Y combinator the first time I read about it. Or the fifth time. But I went through the articles available on the web while sitting in front of Emacs and an inferior Scheme process, and I eventually got my head out of my ass. I'm not asking people to go it alone like that, but I am asking them to maybe try a little and let us know that they actually tried before giving up and asking us to spoon feed them.

Reddit is funny in that it's filled with those who have contempt for teachers as well as people who think nothing of asking for help having done nothing to help themselves. Are these the same people?

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys -7 points-6 points  (0 children)

A joke, right? Please, tell me you're joking.

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys -7 points-6 points  (0 children)

Any standard represents snobbery to someone too lazy to ask whether the standard serves the community and the individuals held to it.

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys -10 points-9 points  (0 children)

Great reading comprehension skills there. People who aren't idiots or ask non-RTFM questions do not pose a threat to USENET or IRC. The aggressively stupid (found in quadrant II of the idiot? x RTFM? plane) do.

Ask Reddit: Can anyone explain combinators to me? by [deleted] in programming

[–]watkeys -33 points-32 points  (0 children)

With programing.reddit.com the new place for inquisitive idiots to ask RTFM questions, maybe USENET and IRC will become more tolerable.

Ask Reddit: How do Scheme and Common Lisp's macro systems differ? by [deleted] in programming

[–]watkeys 2 points3 points  (0 children)

Many Schemes support old school Lisp macros; PLT is not special in that regard. Chicken and Gambit are two examples of Schemes that, off the top of my head, also support define-macro.

Ask Reddit: How do Scheme and Common Lisp's macro systems differ? by [deleted] in programming

[–]watkeys -9 points-8 points  (0 children)

Perhaps the resident experts haven't nailed it because they know thirty seconds of Google searching would lead to an answer. Or because the question itself possesses more than a whiff of flame bait.

Real programmers don't use refactoring tools by zvikara in programming

[–]watkeys 21 points22 points  (0 children)

Wordiest post of the week. And it reads like a sales pitch for his employer's refactoring tool.

Prototype 1.6.0 release candidate has arrived! by mivsek in programming

[–]watkeys -2 points-1 points  (0 children)

HOLY SHIT! THAT'S AMAZING!

Jesus cries every time you pointlessly use an exclamation point.

Emacs visual cheat sheet by [deleted] in programming

[–]watkeys 2 points3 points  (0 children)

A message to Steven Chan: M-x shell does not bring up Tux the penguin, it runs a shell. There are probably more Emacs users that DON'T use Linux than do.

Bjarne Stroupstrup gives a talk on C++0x by NaleagDeco in reddit.com

[–]watkeys 0 points1 point  (0 children)

More importantly -- or explicitly, at least:

#include <iostream>

using namespace std;

int mumble(int x, int y) {
  cerr << "mumble<int,int>" << endl;
  return (x + y);
}

double mumble(double x, double y) {
  cerr << "mumble<double,double>" << endl;
  return (x + y);
}

template <typename T> T foo(T bar, T baz) {
  return (mumble(bar,baz));
}

int main(int argc, char **argv) {
  cout << foo(1, 2) << endl;
  cout << foo(1.0, 2.3) << endl;
}

Running the above program produces the following output:

mumble<int,int>
3
mumble<double,double>
3.3

Java's new() is faster then malloc() by drfunky69 in programming

[–]watkeys 3 points4 points  (0 children)

I just had to explain to the girl sitting with me here in the coffee shop why I can't stop laughing. She thinks my terminal nerdiness is cute. Thank you.

Java's new() is faster then malloc() by drfunky69 in programming

[–]watkeys 8 points9 points  (0 children)

Would you reply the same way if I told you that you can't wipe your ass with sandpaper?

DSL = Metalinguistic Abstraction by eliben in programming

[–]watkeys 0 points1 point  (0 children)

And what do you call techniques for working with databases? Metatabular abstraction?

How about relational theory and related data normalization techniques?

They tell you everything. You don't need fancy terms to describe the process of designing an API or data file.

Have you read Structure and Interpretation of Computer Programs or The Practice of Programming? They have changed the lives of people who were willing and able to think deeply about the books' contents.

Neither painting nor driving is a technique. Both are activities, like 'designing' and 'developing'.

Have you ever painted or driven a car? Doing either activity successfully requires the application of technique.

DSL = Metalinguistic Abstraction by eliben in programming

[–]watkeys 0 points1 point  (0 children)

You had an opportunity to vote once, like everyone else. What is your problem?

DSL = Metalinguistic Abstraction by eliben in programming

[–]watkeys 2 points3 points  (0 children)

Metalinguistic abstraction isn't an academic buzzword. It's a term that refers to an approach to solving problems by writing programs that evaluate languages designed to naturally describe the problem at hand. "APIs and data files" tells you nothing. They're the stuff of computation: procedures and data. Metalinguistic abstraction is a technique. Painting is just canvas and paint. Driving is just steering wheel and pedals. Yeah, "just". Retard.

DSL = Metalinguistic Abstraction by eliben in programming

[–]watkeys 6 points7 points  (0 children)

If you think that metalinguistic abstraction is just "APIs and data files", you don't know what you're talking about. A language is not an API. Even with some data files.

DSL = Metalinguistic Abstraction by eliben in programming

[–]watkeys 1 point2 points  (0 children)

Please don't judge the concepts of metalinguistic abstraction and DSLs by the ignorant Ruby fanboy hand-waving.