News for hackers. Stuff that matters.
Re:Space Monkey dumps Python for Go by Pxtl on Tuesday April 22, 2014 @01:34PM (#7629071)
Don't the first 3 apply just as well to python? It compiles fast, and is duck-typed so interfaces are always there and implicit, and the indent-based blocking ends many arguments about formatting.
Re:Space Monkey dumps Python for Go by dekhn on Tuesday April 22, 2014 @01:38PM (#7629111)
the difference is that if you're not careful when you cut-paste indented blocks in python, you can easily change logic.
Re:Space Monkey dumps Python for Go by mau on Tuesday April 22, 2014 @02:11PM (#7629313)
If you cut and paste probably the misaligned indentation is the least problem. Cut and paste should be avoided if it's not done during a refactoring (so actual moving of code for better design).

Beginners usually think Python strong indentation is a weakness of the language. I actually find C++ freedom being more error prone:

    if (a < b);
        a = b

It's a not very frequent bug, but when it happens it takes you hours to spot. ;)
Re:Space Monkey dumps Python for Go by maxiepoo on Tuesday April 22, 2014 @02:23PM (#7629401)
Yes and in Go (and hopefully all curly-brace languages of the future) this is actually a syntax error, you need the braces:

  if (a < b) {
     a = b;
  }
Re:Space Monkey dumps Python for Go by TylerE on Tuesday April 22, 2014 @04:22PM (#7630175)
The thing I don't get...if braces are mandatory (Good), why keep the now completely, unambiguously, irrelevant () around the cond?
Re:Space Monkey dumps Python for Go by kyrra on Tuesday April 22, 2014 @05:16PM (#7630503)
If you ran the code through gofmt, it would remove the () around the cond for you. I code go in SublimeText with GoSublime. On every save it runs the file through gofmt and reformats it for me. Keeps my code looking pretty with very little effort.
Re:Space Monkey dumps Python for Go by wtbob on Tuesday April 22, 2014 @04:36PM (#7630267)
You don't need those parens in Go, and go fmt will in fact remove them/
Re:Space Monkey dumps Python for Go by CasualSuperman on Tuesday April 22, 2014 @04:33PM (#7630245)
They're actually not required in Go.
Re:Space Monkey dumps Python for Go by gnur on Tuesday April 22, 2014 @04:07PM (#7630080)
And you don't need the semicolons!
Re:Space Monkey dumps Python for Go by dekhn on Tuesday April 22, 2014 @05:17PM (#7630512)
This would never happen to me because I frequently format my doc, and it wouldn't be indented.
Re:Space Monkey dumps Python for Go by Artemis2 on Tuesday April 22, 2014 @01:45PM (#7629162)
Python executes, it does not compiles.

EDIT: Whoops, it's actually compiled into bytecode then executed by the VM.

Re:Space Monkey dumps Python for Go by Pxtl on Tuesday April 22, 2014 @03:10PM (#7629691)
it's generous to call the CPython interpreter a VM - the binary encoding of Python isn't some crazy IL bytecode, its' really just python-as-binary. Language constructs converted into opcodes, strings with pre-calculated hashes, and local variables within a scope become a sort of vector... but otherwise, it's a prettymuch 1:1 mapping between Python language constructs and the bytecode form.
Re:Space Monkey dumps Python for Go by runjake on Tuesday April 22, 2014 @02:19PM (#7629378)
Re:Space Monkey dumps Python for Go by the_paul on Tuesday April 22, 2014 @01:58PM (#7629236)
This is not true.
Re:Space Monkey dumps Python for Go by mimighost on Tuesday April 22, 2014 @02:24PM (#7629409)
It actually "compiles" into bytecode, then consumed by the interpreter.