- Python (like most other scripting languages) does not require variables to be declared, as (let (x 123) ...) in Lisp or int x = 123 in C/C++. This means that Python can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom and you lost all unsaved data. Local and global scopes are unintuitive. Having variables leak after a for-loop can definitely be confusing. Worse, binding of loop indices can be very confusing; e.g. "for a in list: result.append(lambda: fcn(a))" probably won't do what you think it would. Why nonlocal/global/auto-local scope nonsense?
- Python has a faulty package system. Type time.sleep=4 instead of time.sleep(4) and you just destroyed the system-wide sleep function with a trivial typo. Now consider accidentally assigning some method to time.sleep, and you won't even get a runtime error - just very hard to trace behavior. And sleep is only one example, it's just as easy to override ANYTHING.
C/C++ (like every programming language) does not require variables to be correct, as
int fib(int n) {
int p = 1;
while (n--)
p * n;
return n;
}
This means that C/C++ can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom and
you lost all unsaved data.
>>8
No.
$ sbcl
This is SBCL 1.0.55.0-abb03f9, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>;.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (defun car (x) (sqrt x))
; in: DEFUN CAR
; (SQRT X)
;
; caught WARNING:
; Derived type of X is
; (VALUES LIST &OPTIONAL),
; conflicting with its asserted type
; NUMBER.
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
STYLE-WARNING: redefining COMMON-LISP:CAR in DEFUN
debugger invoked on a SYMBOL-PACKAGE-LOCKED-ERROR:
Lock on package COMMON-LISP violated when setting fdefinition of CAR while in
package COMMON-LISP-USER.
See also:
The SBCL Manual, Node "Package Locks"
The ANSI Standard, Section 11.1.2.1.2
restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE ] Ignore the package lock.
1: [IGNORE-ALL ] Ignore all package locks in the context of this operation.
2: [UNLOCK-PACKAGE] Unlock the package.
3: [ABORT ] Exit debugger, returning to top level.
(PACKAGE-LOCK-VIOLATION
#<PACKAGE "COMMON-LISP">
:SYMBOL
CAR
:FORMAT-CONTROL
"setting fdefinition of ~A"
:FORMAT-ARGUMENTS
(CAR))
0]
Name:
Anonymous2012-03-11 9:54
Haskell is the only obvious choiout of memory (requested 2097152 bytes)
the compiler can not catch all errors. relying on the compiler leads to more errors in the long run
Name:
Anonymous2012-03-11 16:41
ITT: EVERYONE BUTTMAD!!!
Name:
Anonymous2012-03-11 17:40
his means that Python can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom
Post some code to show me what you mean.
Agreed on other counts.
Name:
Anonymous2012-03-11 18:52
>>16
>>> def f(n):
... if(n==1 or n==2):
... return 1
... else:
... return f(n-1)+F(n-2)
...
>>> f(1)
1
>>> f(2)
1
>>> f(3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 5, in f
NameError: global name 'F' is not defined
>>>
Name:
Anonymous2012-03-11 18:59
>>17
Does Python have anything like Perl's use strict 'vars'?
Name:
Anonymous2012-03-11 22:17
C (like most other compiled languages) does not require bounds to be checked. This means that C can't even detect a trivial off-by-one error - it will produce a program, which will continue working for hours until it reaches the error - THEN go stack overflow and you lost all unsaved data.
>>19
Nigga, you just went full retard. Out-of-bounds array indexing doesn't cause a stack overflow even if the array is on the stack. You should probably Google the definition of "stack overflow" (hint: it has something to do with moving a stack pointer) and get your ass back to /vip/.
>>22
PERL (like most other dong languages) does not require doubles to be checked. This means that PERL can't even detect a trivial off-by-one dub GET - it will produce a shitpost, which will continue shitting for hours until it reaches anti-satori - THEN go threadstopped and you didn't lost all unsaved sages.
Name:
Anonymous2012-03-12 1:17
>>19
Hey African, your granny's a compiled language. U know der's no such fing rite? Dat kinda shit's up to da implementation, not da language. *slips a zuckerberg in your bum*