I've been to many competitions where we'll get problems that can be done in less than 20 lines of Java because of the huge class library. Need to check if a number is prime? Just use BigInteger.isProbablePrime().
Sure, then they throw a Carmichael number in the data set, and you're screwed...
Programming, on the other hand, rarely requires those skills - at least on modern languages. Look at the STL and tell me how many programmers use that rather than learning the intricacies of various sort algorithms or linked lists and binary trees?
Of course you then end up with people doing stupid things like using std::sort to sort piles of strings or whatnot when a much more efficient radix-style sort would be called for...
DRM itself (like patents or the copyright system) is not a bad thing per se. However, the potential to abuse and misuse it is a bad thing, and so it seems that the smart thing to do is to get in on the process and try to keep the end product from being overly restrictive. I don't know if such a thing is possible in the long run, but it seems to me a far better thing to try to realize such a product than to leave it up to people who might not give a damn about your rights/freedoms.
Why shouldn't they be allowed to decide some reporters piss off their chief executive, and they are going to ignore them?
Oh, they're perfectly free to ignore whoever they want -- but if it makes them look like immature assjacks, then they have to deal with that image they've painted for themselves...
It's sort of a corollary to the old saying that speech may be free, but it is not without cost.
Even the example code you posted is an induction proof of its own correctness, except it only proved its correctness for positive numbers.
Sure. But when I'm talking about program correctness, I am talking about correctness relative to some specification. The code I posted is correct for an incorrect specification of factorial, but it is not correct relative to the correct specification of factorial (which should probably have us raise an exception for an argument less than zero). It would also be nice to, e.g., check for overflow, as for the code above, fact 20 <> 20! .
[1] Unless, of course you muck with the type system via things like OCaml's Obj.magic, improper use of Marshaling, or being less than careful when you interface with C.
What something like SML or OCaml give you is the guarantee of type safety[1], and not program correctness. For example: let rec fact = function | 0 -> 1 | i -> i * (fact (pred i));;
type checks and runs beautifully until you boner up and try something like let x = fact (-1);; and you hit infinite recursion. (And if you used a tail recursive version it wouldn't even have the courtesy to die via stack overflow).
Anyway, I loves me some FP, OCaml is my primary language and I wish more people would turn on to it, but type safety <> program correctness, and trying to say that it is does more harm than good.
The definition comes from the way biological viruses work. You do not have to take any steps to become infected. You can sit there quite passively and have someone else walk by you and you become infected.
Well, I think we can safely say that you are not a virologist, nor do you play one on TV. For something to be considered viral, it should display the properties of a virus -- among which we would not include the ability to invade a passive host (using your connotation of passive). While this is true for some viruses, other viruses don't work like that -- they aren't air borne, and so they won't infect you if a carrier just happens to saunter by. Instead, we would like something that is true of all viruses, and not just a select few, and what we generally go by is the idea that viruses "have no proper cell membrane, and thus cannot by themselves perform metabolic processes, requiring entry into a host cell in order to multiply."
This sounds an awful lot like your earlier assertion that "The GPL comes into play if you were to grab some GPL code and put it into your software product, and then you release the result as your own product under a different licensing scheme." That is, the GPLed code requires entry into someone else's released code for that code to become infected, but at that point the GPL is able to "reproduce", forcing the new code to be GPLed as well. This is the viral aspect of the GPL... it's not necessarily good nor bad, but it is viral.
Actually, they were acquired. Rumor has it that they were bought up by Apple... and it seems as if the touch sensitive tech this mouse is built on is a basic use of the Fingerworks tech...
And on top of that, that wasn't even supposed to be the second episode. It was a brand new "premiere" that Joss and Tim had to write over the weekend after Fox told them they weren't going with the true preimere (which they had been advertising for weeks).
So what ended up being shown as the preimere that was supposed to hook viewers was the equivalent of a hastily thrown together b-side. Boy... those folks over at Fox are goddamn programming geniuses.
Well, that all falls square on the shoulders of Fox. You know, those guys who advertised for weeks about a show that included "a girl in a box", and then decided at the last minute to scrap the two hour premiere containing said girl in said box, and made Joss and Tim write a brand premiere over the weekend to be hurried into production. Oh yeah, the new premiere also had to be just an hour long... and with more action, so all of the backstory had to be compressed into quick blunt exposition so we could try to figure out who all these people on this ship were...
And then they had the whacky idea to jumble all the episodes more or less randomly, cause hey... who doesn't love Keno! And oh yeah... they finally decided to show the real premiere as the last episode of the series. Because that makes perfect sense...
It's not that the show required too much involvement... it's that Fox got too damned involved with it.
Well, if you're willing to limit yourself to C, C++, Java, or Pascal, you may want to have a look at some of the problems available at The Online Jodge. You can code them up and submit them to have them tested for speed and correctness.
Actually, you don't need scientific proof. It's just common sense:
And it's just common sense that something as heavy as an airplane cannot possibly fly. Common sense doesn't always work so well...
Now I'm happy to add to the pile of anecdotal evidence in favor of Dvorak, ever since I started using it my wrist pain has diminished greatly -- but I hardly count that as a scientific study
Yes, you should be able to. I use Dvorak for all of my full keyboard typing (at work, and at my second computer at home), and QWERTY on my laptops (including my primary home computer), and I can switch between the two without a hitch. It's like learning a new computer language -- picking up OCaml deosn't mean you'll forget how to program in C.
My personal favorite is the Python Foundation's Explore Functional Programming. Getting paid for sitting around all summer and monkeying around with FP concepts sound great, as I already do it for free (though they probably want you to use Python... ugh!)
Although I'm not so sure Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire is such a good place to introduce FP to students... I've get nothing against the tupling lemma of Fokkinga, but jumping right into catamorphisms and hylomorphisms might cause a rush for the nearest exit...
Don't know who's from Toyota, but Microsoft has some very research oriented people on their payroll: Simon Peyton Jones (big time Haskell guy), Cedric Fournet (the creator of JoCaml), Don Syme (working on f# -- a variant of OCaml for.NET), and so on), and I'm guessing the US Military Academy representative is Chris Okasaki, author of Purely Functional Data Structures. BTW, you do know that the Military Academies are universities, don't you?
First of all, we know we have to use a functional language to design the program.
No you don't. You can use any language you want.
So what we're left with are languages like C and Pascal, PHP
So how is it you throw out C++, Perl and Python in your "have to use a functional language" cut, but C and Pascal survived? C++ at least has libraries like Boost.Lambda, and Higher Order Perl shows off it's functional side a bit. And of course in your final list of languages, the closest thing you have to a functional language is Lisp (which is commonly thought of as functional, but it's really multi-paradigm, and is more often than not coded in an imperative manner). Me = confused...
Anyway, the bottom line is: choose whatever language you want to use.
I'd be interested to hear what languages other Slashdotters think would be most appropriate to a contest like this. Lisp gurus, start your engines!
The most appropriate one is probably the language you know best (coupled with the one most suited to the problem -- if speed is a big plus, you're not going to want to deal with, say, PHP, and if concurrency is a big issue, you might want to lean on Erlang or Oz). Despite the name of the contest, you don't need to use a functional language: the winners of last year's lightning division used Java, C++, Perl, and m4; and the second place team in the main division used C++ (thought the Judge's Prize winners used OCaml, and the main division winners used Haskell). In fact C++ was the most popular language in last year's competition, and C was the leader the year before.
Of course, OCaml is always popular due to its speed and flexibility, and it's what I would choose, as it is my primary language anyway.
Without reading the study, I would suppose that his "build-time" issues were that he was unable to compile his program without first having to waste time running around making all the type declarations first. When you're experimenting with the design, that's a lot of overhead. (This is the philosophical departure from those who favor static languages.)
So use a decent language that offers type inference, like OCaml or Haskell and this consideration goes away (almost) entirely, you still have static type checking, and I remain baffled by his statements. If that's the source of his issues, it's a bit like slamming dynamically typed languages for being so slow because TCL works at a glacial pace..
Re:Static code verifications, anyone?
on
Practical Common Lisp
·
· Score: 2, Interesting
Well, it appears to be worth next to nothing. What we have there is some guy looking at a few of his projects and deciding he doesn't need static type checking. And it's not completely clear if he makes this claim because he's not making type errors, or because his type errors are being caught by his unit tests.
He also makes a somewhat odd set of claims that: a) He doesn't make type errors. b) Dynamically typed code is easier to develop because he doesn't have to deal with build time type issues.
But... if he wasn't making type errors, then why would he have build time issues with static type-checking? I suppose I might be missing something, but what?
It's smaller than a regular iPod, doesn't have a disc to worry about jostling and, unlike a shufle, has a screen and more memory.
It fits in cleanly between the regular iPod line and the shuffle line. Makes perfect sense to me...
I've been to many competitions where we'll get problems that can be done in less than 20 lines of Java because of the huge class library. Need to check if a number is prime? Just use BigInteger.isProbablePrime().
Sure, then they throw a Carmichael number in the data set, and you're screwed...
Programming, on the other hand, rarely requires those skills - at least on modern languages. Look at the STL and tell me how many programmers use that rather than learning the intricacies of various sort algorithms or linked lists and binary trees?
Of course you then end up with people doing stupid things like using std::sort to sort piles of strings or whatnot when a much more efficient radix-style sort would be called for...
Sadly that's what it's becoming more and more...
Look Ma! I got me a B.S. in Java Code-monkey studies!
I don't see why this is a tough call at all.
DRM itself (like patents or the copyright system) is not a bad thing per se. However, the potential to abuse and misuse it is a bad thing, and so it seems that the smart thing to do is to get in on the process and try to keep the end product from being overly restrictive. I don't know if such a thing is possible in the long run, but it seems to me a far better thing to try to realize such a product than to leave it up to people who might not give a damn about your rights/freedoms.
Why shouldn't they be allowed to decide some reporters piss off their chief executive, and they are going to ignore them?
Oh, they're perfectly free to ignore whoever they want -- but if it makes them look like immature assjacks, then they have to deal with that image they've painted for themselves...
It's sort of a corollary to the old saying that speech may be free, but it is not without cost.
Even the example code you posted is an induction proof of its own correctness, except it only proved its correctness for positive numbers.
Sure. But when I'm talking about program correctness, I am talking about correctness relative to some specification. The code I posted is correct for an incorrect specification of factorial, but it is not correct relative to the correct specification of factorial (which should probably have us raise an exception for an argument less than zero). It would also be nice to, e.g., check for overflow, as for the code above, fact 20 <> 20! .
Hmmm... forgot my footnote:
[1] Unless, of course you muck with the type system via things like OCaml's Obj.magic, improper use of Marshaling, or being less than careful when you interface with C.
Er... well, not quite.
What something like SML or OCaml give you is the guarantee of type safety[1], and not program correctness. For example:
let rec fact = function
| 0 -> 1
| i -> i * (fact (pred i));;
type checks and runs beautifully until you boner up and try something like let x = fact (-1);; and you hit infinite recursion. (And if you used a tail recursive version it wouldn't even have the courtesy to die via stack overflow).
Anyway, I loves me some FP, OCaml is my primary language and I wish more people would turn on to it, but type safety <> program correctness, and trying to say that it is does more harm than good.
The definition comes from the way biological viruses work. You do not have to take any steps to become infected. You can sit there quite passively and have someone else walk by you and you become infected.
Well, I think we can safely say that you are not a virologist, nor do you play one on TV. For something to be considered viral, it should display the properties of a virus -- among which we would not include the ability to invade a passive host (using your connotation of passive). While this is true for some viruses, other viruses don't work like that -- they aren't air borne, and so they won't infect you if a carrier just happens to saunter by. Instead, we would like something that is true of all viruses, and not just a select few, and what we generally go by is the idea that viruses "have no proper cell membrane, and thus cannot by themselves perform metabolic processes, requiring entry into a host cell in order to multiply."
This sounds an awful lot like your earlier assertion that "The GPL comes into play if you were to grab some GPL code and put it into your software product, and then you release the result as your own product under a different licensing scheme." That is, the GPLed code requires entry into someone else's released code for that code to become infected, but at that point the GPL is able to "reproduce", forcing the new code to be GPLed as well. This is the viral aspect of the GPL... it's not necessarily good nor bad, but it is viral.
Oh, yeah... IANAV.
Actually, they were acquired. Rumor has it that they were bought up by Apple ... and it seems as if the touch sensitive tech this mouse is built on is a basic use of the Fingerworks tech...
And on top of that, that wasn't even supposed to be the second episode. It was a brand new "premiere" that Joss and Tim had to write over the weekend after Fox told them they weren't going with the true preimere (which they had been advertising for weeks).
So what ended up being shown as the preimere that was supposed to hook viewers was the equivalent of a hastily thrown together b-side. Boy... those folks over at Fox are goddamn programming geniuses.
Well, that all falls square on the shoulders of Fox. You know, those guys who advertised for weeks about a show that included "a girl in a box", and then decided at the last minute to scrap the two hour premiere containing said girl in said box, and made Joss and Tim write a brand premiere over the weekend to be hurried into production. Oh yeah, the new premiere also had to be just an hour long... and with more action, so all of the backstory had to be compressed into quick blunt exposition so we could try to figure out who all these people on this ship were...
And then they had the whacky idea to jumble all the episodes more or less randomly, cause hey... who doesn't love Keno! And oh yeah... they finally decided to show the real premiere as the last episode of the series. Because that makes perfect sense...
It's not that the show required too much involvement... it's that Fox got too damned involved with it.
Well, if you're willing to limit yourself to C, C++, Java, or Pascal, you may want to have a look at some of the problems available at The Online Jodge. You can code them up and submit them to have them tested for speed and correctness.
Actually, you don't need scientific proof. It's just common sense:
And it's just common sense that something as heavy as an airplane cannot possibly fly. Common sense doesn't always work so well...
Now I'm happy to add to the pile of anecdotal evidence in favor of Dvorak, ever since I started using it my wrist pain has diminished greatly -- but I hardly count that as a scientific study
Yes, you should be able to. I use Dvorak for all of my full keyboard typing (at work, and at my second computer at home), and QWERTY on my laptops (including my primary home computer), and I can switch between the two without a hitch. It's like learning a new computer language -- picking up OCaml deosn't mean you'll forget how to program in C.
My personal favorite is the Python Foundation's Explore Functional Programming. Getting paid for sitting around all summer and monkeying around with FP concepts sound great, as I already do it for free (though they probably want you to use Python... ugh!)
Although I'm not so sure Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire is such a good place to introduce FP to students... I've get nothing against the tupling lemma of Fokkinga, but jumping right into catamorphisms and hylomorphisms might cause a rush for the nearest exit...
Don't know who's from Toyota, but Microsoft has some very research oriented people on their payroll: Simon Peyton Jones (big time Haskell guy), Cedric Fournet (the creator of JoCaml), Don Syme (working on f# -- a variant of OCaml for .NET), and so on), and I'm guessing the US Military Academy representative is Chris Okasaki, author of Purely Functional Data Structures. BTW, you do know that the Military Academies are universities, don't you?
First of all, we know we have to use a functional language to design the program.
No you don't. You can use any language you want.
So what we're left with are languages like C and Pascal, PHP
So how is it you throw out C++, Perl and Python in your "have to use a functional language" cut, but C and Pascal survived? C++ at least has libraries like Boost.Lambda, and Higher Order Perl shows off it's functional side a bit. And of course in your final list of languages, the closest thing you have to a functional language is Lisp (which is commonly thought of as functional, but it's really multi-paradigm, and is more often than not coded in an imperative manner). Me = confused...
Anyway, the bottom line is: choose whatever language you want to use.
I'd be interested to hear what languages other Slashdotters think would be most appropriate to a contest like this. Lisp gurus, start your engines!
The most appropriate one is probably the language you know best (coupled with the one most suited to the problem -- if speed is a big plus, you're not going to want to deal with, say, PHP, and if concurrency is a big issue, you might want to lean on Erlang or Oz). Despite the name of the contest, you don't need to use a functional language: the winners of last year's lightning division used Java, C++, Perl, and m4; and the second place team in the main division used C++ (thought the Judge's Prize winners used OCaml, and the main division winners used Haskell). In fact C++ was the most popular language in last year's competition, and C was the leader the year before.
Of course, OCaml is always popular due to its speed and flexibility, and it's what I would choose, as it is my primary language anyway.
And the obligatory response Software Fault Prevention by Language Choice: Why C is Not my Favorite Language (PDF).
So God can't perform tail call elimination? Damn... he must be a C programmer or something.
Are you my ex girlfriend?
Without reading the study, I would suppose that his "build-time" issues were that he was unable to compile his program without first having to waste time running around making all the type declarations first. When you're experimenting with the design, that's a lot of overhead. (This is the philosophical departure from those who favor static languages.)
So use a decent language that offers type inference, like OCaml or Haskell and this consideration goes away (almost) entirely, you still have static type checking, and I remain baffled by his statements. If that's the source of his issues, it's a bit like slamming dynamically typed languages for being so slow because TCL works at a glacial pace..
Well, it appears to be worth next to nothing. What we have there is some guy looking at a few of his projects and deciding he doesn't need static type checking. And it's not completely clear if he makes this claim because he's not making type errors, or because his type errors are being caught by his unit tests.
... An Experiment in Software Prototyping Productivity (PDF) or the less fuzzy Are Ours Really Smaller Than Theirs? (PDF). It's just some guy and his hunch...
He also makes a somewhat odd set of claims that:
a) He doesn't make type errors.
b) Dynamically typed code is easier to develop because he doesn't have to deal with build time type issues.
But... if he wasn't making type errors, then why would he have build time issues with static type-checking? I suppose I might be missing something, but what?
In any case this isn't even up to the fuzzy quality of Haskell vs. Ada vs. C++ vs. Awk vs.