Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Comment Re:Fractal rant makes about six good points (Score 1) 536

How does the presence of "C and Python crash fatally, potentially destroying the memory space of other programs. Got it." invalidate the whole rebuttal? Even if it isn't sarcasm, when programs hit undefined behavior, they can scribble on other programs running in the same process space, such as if your web app is loaded as a module instead of a CGI program. Granted, this is harder to do in Python without using native code interfaces like ctypes.

Comment Take Python, for example (Score 1) 536

After writing tons of Java code that [checks a string variable for both null and equality to the empty string]

Not all implicit conversions introduce problems. Casting to a Boolean type, as the if statement does, is fine with the caveat that which values are considered "truthy" or "falsey" depends on the language. For example, PHP's ordinary bool cast rules are pretty much the same as Python's, except that the string "0" is falsey in PHP but truthy in Python. C and Java have their own definition: a nonzero primitive or a nonnull pointer is truthy. I find these implicit conversions, as well as some language-specific rule for implicit conversion to the language's string type, to make sense in general.

The practical problem with how PHP handles comparisons comes when it performs implicit conversions that make little sense. Strings more often than not end up converted to numbers before they're compared.

For the parse errors, you mean you don't do precommit hooks to do php -l to validate your checkins and don't have continuous integration setup?

You are correct that a lot of people do not. For one thing, they may lack the money to lease both a testing environment and a production environment from the hosting provider. Or they may lack access to server logs because the hosting provider doesn't provide server logs to customers on plans below the VPS tier.

For the undefined functions, if you're doing OOP, the language has had great support for autoloading classes for over a decade

Autoload failures caused fatal errors until 5.3, and some hosting providers were still on 5.2 after 5.4 came out.

The only valid complaint is that the major version isn't incremented often enough to clue people in that there are potential breaking problems.

True. But there are several cases in Python where the interpreter implements both sets of semantics and allows each source code file to select one or the other. Some, such as the division semantics, use the from __future__ statement; others, such as the parallel "classic classes" and "new classes" in the 2.x series, use other syntactic triggers. And unlike Python, where the initial #!/usr/bin/env line selects the interpreter version, the choice of PHP version depends on a server configuration that's often out of the hosting subscriber's control.

PHP is basically a thin wrapper for C libraries.

Thin wrappers are better when they're namespaced. Namespaces allow providing both traditional names and PEP 8-compliant names without overly polluting the global namespace.

Comment VPS costs several times more (Score 1) 536

Why are you letting your hosting provider choose your language? Just get a VPS.

True, a VPS is a better once you get to a certain scale, but it can be more expensive for those just starting out. Shared web hosting from Go Daddy, for instance, starts at $3.49 per month, while a CentOS VPS from the same company starts at $19.99 per month. And a VPS is only going to get more expensive over time as IPv4 addresses run out.

Counterexamples would be appreciated.

Comment Re:The central tenet of atheism (Score 1) 1330

There are any number of other possible explanations of how the universe came into existence, and you might choose one based on observation and evidence

I'd be interested to look at some of this evidence that rules out a god's involvement. Without such evidence, atheists have to fall back on what the author of the book of Hebrews called "assurance about what we do not see."

Comment Fractal rant makes about six good points (Score 5, Informative) 536

Anyone cosidering PHP should read this the now infamouns "PHP is a fractal of bad design".

Which must be balanced with the "hardly" rebuttal. For example, PHP lets a program solve the exception/warning dichotomy cleanly in about six lines of code; see the manual's page about the ErrorException class. This leaves about a half dozen legitimate complaints:

  • No way to turn off the language's loosely-typed comparisons.
  • Parse errors and undefined function errors are fatal rather than throwing an exception that the caller can catch.
  • Inconsistent naming conventions in the standard library.
  • Associativity for the ternary ?: operator is the less useful side.
  • PHP allows the server operator to change program semantics in ways that are annoying to work around, such as not allowing a shared hosting subscriber to turn off "magic quotes" or not following HTTP redirects in libcurl.
  • PHP versions change the semantics of existing programs in ways that encourage shared hosting providers to continue to offer only outdated versions of PHP, making it impossible for web application developers to take advantage of new features.

Slashdot Top Deals

Get hold of portable property. -- Charles Dickens, "Great Expectations"

Working...