Re:Why I prefer scheme to Haskell
by getsat on Monday April 09, 2012 @07:30AM
(#3816522)
Does F# let you debug using printf? I stopped reading the linked post at that point.
[ Parent
| on HN ]
Yes, you could do that. Won't judge that approach - that's probably a cultural thing. But you have access to side effects and could dump stuff to the console (even, if you're so inclined, using the .Net framework standard way, calling Console.Write/WriteLine - although the print* stuff in F# is really better suited if you decided to go down that path).
Re:Why I prefer scheme to Haskell
by more_original on Monday April 09, 2012 @07:59AM
(#3816596)
Yes, printf is easy in F#. The following example works in F# and OCaml:
let rec fact n =
Printf.printf "%i\n" n;
if n = 0 then 1 else n * (fact (n-1))For the record, this was sarcasm. It's 2012. I really hope you guys aren't debugging using printf still.
You'd think someone into esoteric languages would've heard of a debugger.
Re:Why I prefer scheme to Haskell
by reddit_clone on Monday April 09, 2012 @08:52PM
(#3820120)
Print/Trace statements are invaluable in several situations.
I don't trust debuggers for multi-threaded applications or applications with open, time-sensitive resources (open sockets etc..)
Installing and firing up a debugger is not an option in a customer's system.
> It's 2012
I expect to be using Printf's in 2022 and beyond.
I'm pretty good at Haskell and prefer print to debuggers in pretty much every language. I'd rather have the computer produce output for me to read than to have to hand-hold the computer through evaluating my program. It's easier.
The one doesn't replace the other. I wrote a JS debugger for Emacs so as to have a debugger when I wanted one. I still use print statements more.