Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Nomnom Cookie
Aug 30, 2009



yaoi prophet posted:

i heard there are languages where the compiler is smart enough to figure out types for you these days

Yeah Scala is p cool

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nomnom Cookie posted:

*programs a p lang, has boring job and life, tells self that drinking is fun*

because the java world is excitement city

after clippy eclipse helpfully suggests some fixes for stuff it figured out could only work one way do you drive home and watch sitcoms?

Posting Principle
Dec 10, 2011

by Ralp

yaoi prophet posted:

i heard there are languages where the compiler is smart enough to figure out types for you these days

#define var auto

Nomnom Cookie
Aug 30, 2009



Cocoa Crispies posted:

because the java world is excitement city

after clippy eclipse helpfully suggests some fixes for stuff it figured out could only work one way do you drive home and watch sitcoms?

Nope I play with my kids and eat the excellent dinner my wife cooked and then go to bed. After using java to write distributed systems because a p Lang would kill our latency. My work involves programming a computer to compute, you see, not just pull page content from MySQL and render html

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
javas pretty good, libraries are huge, its got warts but who doesnt

Vanadium
Jan 8, 2005

FamDav posted:

no move constructor
no swap function
operator= should take its parameter by value
the internal data structure should be an array
unary operator+, unary operator-, operator/, and operator* should be rewritten as friend functions which take a Vector3 by value which is used as the return value. you could do something similar with operator+ and operator- and rvalues but you'd have to write multiple versions

my c++ is rusty (heh), what do any of these buy you in this example. it's just like three fields.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

As I've seen this article a number of times, I'd like to go through it to see what everyone has to say on the subject. Warning: This is just stupidly, ludicrously long. it takes an existing 5-page article and tears it apart nearly sentence-by-sentence.

First, let me say that PHP isn't perfect. There's a lot of weirdness to it, a lot of examples of a language that grew organically by a large multinational team instead of being designed by a small committee of English-speaking developers. But that doesn't mean it's bad design, just that there's quirks, like any well used system.

Now, onto the article itself. We're first presented with his toolbox analogy. This ridiculous piece of prose seems to be insinuating that the basic control structures of PHP are somehow non-standard and don't work like every other language. A hammer with a peen on both ends? A screwdriver which only works with specialty screws? How is this an analogy for the most popular web language in the world? He goes on to say that the builders who use these tools make things that don't work and fall down at the slighest provocation. Now, having read this before, I know that he goes into defense mode over this statement later, but I'll go ahead and attack it now: Show me the faults in facebook. Show me where wikipedia falls down when you touch it. Find the design flaws in vbulletin, wordpress, or any of the other toolsets that would be at all analogous to a house "where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards."

Stance

After his analogy, we get his stances. These are almost all wrong, and illustrate his basic misunderstanding of languages in general. He believes languages shoudld be:

Predictable - The author states that it's the language's responsibility to be understood by everyone who uses it, rather than the builder's responsibility to understand their tools. He doesn't understand why PHP does something, so instead of investigating and learning more, he declares PHP "broken" and "badly designed." This is a recurring theme in the article. Much of his problems with PHP stem from him not understanding symbol tables or loosely typed languages. Just look at his list of "surprises": mysql_real_escape_string? OH MY GOD! SHOCKING! What the hell is he talking about?

And E_ALL? How is a constant name a "surprise"? The list of error-level constants is in the manual. they all begin with E_ and then give what they describe. I will grant that E_ALL spent a couple years not being absolutely every error. However, I think the choice was to make E_ALL provide only functional errors, and not strict warnings like deprecated function names. Some disagree.

Consistent - Apparently things that look the same should work the same in a programming language? And if you know one part you should be able to understand other parts? This appears to be a dig at PHP's ecclectic naming conventions, and I will certainly give him that. htmlentities should have underscores like its counterpart, html_entity_decode. Of course, the counterpart of every function is in that function's manual page, but "the manual is right there and it's free and it's integrated into the free IDEs" still isn't an excuse. The language needs to be cleaned up from a naming perspective. He gets one point.

Concise - He makes statements about "boilerplate" a number of times, but never defines the term or tells us what he's talking about. PHP is very concise. It includes time-saving functions like usort(), file_get_contents(), and other functions which in C++ would take pages of code. Of course, it also requires error checking, which seems to be what he's complaining about. He lists error-checking as boilerplate. I don't know how Python handles it, but generally as a programmer I'd like to know if a file operation failed. His point here seems to be that low-level functions return false instead of throwing an exception, which is honestly a holdover from when PHP was young and didn't have exceptions. However, which is more boilerplate: if ( !( $file = fopen('file.txt', 'w') ) ) or a try-catch block?

Reliable - This, again, is him assuming that it's the language's responsibility to be understood, rather than his responsibility to understand it. He goes into what he considers "gotcha" events later in the article, but (spoiler alert) they all stem from his fundamental understanding of the language. You can tell because his two examples perfectly illustrate his misunderstanding. The == operator is listed as "flaky." The == operator is the core of loosely typed languages, and is immensely powerful. He thinks it's flaky because he can't wrap his brain around loose comparisons. His second example is a by-ref loop, something which exists in all programming languages. The only "gotcha" here is that his understanding of the way variables work in this language is simply wrong.

Debuggable - Now this I'll give him. PHP's error handling is atrocious. I mean, look at the errors some of these new users are getting on DevShed. Who can solve any problem when given just the error type, line number, function name, data type, prose description of the error, and potential fix? That's ridiculous! [/sarcasm] Maybe Python's error handling is much more robust than I remember, but PHP's has thus far been fine for me. Better than the error handling of things like Oracle, with 'cannot bind' being the only error I got yesterday. His examples require a stack trace, which I guess could be handy some of the time, but honestly I've rarely used the stack traces we build into our error-handling at work (which is easily overridden in the PHP core with a set_error_handler call)

Arguments

Now, our author goes into a list of arguments he automatically discards. Luckily, my argument of "you don't understand PHP and it's not PHP's job to get into your brain and force you to understand things you choose not to" isn't on the list. He does say that it's not his responsibility to "memorize a thousand strange exceptions." I agree with him on that, strpos should be renamed. However, it is his responsibility to come to an understanding of how programming languages work, and he has failed to do so. He also uses a wonderful straw man with "you should just use C if PHP handles 5% of its operations the way C does." Just because fopen returns false in C and in PHP doesn't mean PHP is a net loss. Finally, his argument of "the largest and most popular websites in the world, designed and written by the smartest programmers in the world, don't prove anything" is laughable. The conscious choices of almost every single web engineering team worth a drat do, in fact, count as proof that the tool they've chosen is worthwhile. (He also says not to argue with him at all, because he's just stomping his little feet and nothing will change his mind. I'm writing this for the DevShed community, not this guy who can't figure out how PHP works.)


Philosophy

PHP was designed to be easy to understand, because at the time the thought of full-featured web applications was silly. An item's source doesn't discredit what it's become. What if someone told you "America was founded to be a colony (and, reading between the lines, not a country); it has not well escaped its roots. This is why I believe nobody should take America seriously as a country." Stupid, right? Good, glad we agree.

Quote:
PHP is built to keep chugging along at all costs.
MY GOD! HOW LUDICROUS! PHP is a web language with very little ability to recover from a crash the way you would in a desktop environment. It will keep doing its best and instead of a blank screen (or a blue one) maybe a bad programmer will get her site's navigation bar with some errors underneath it. But she WILL get something. The fact that PHP doesn't crash and burn as easily as the other languages doesn't have me crying myself to sleep at night.

Quote:
There’s no clear design philosophy.
Yes, we know. He still has one point.

Quote:
PHP takes vast amounts of inspiration from other languages, yet still manages to be incomprehensible to anyone who knows those languages. (int) looks like C, but int doesn’t exist. Namespaces use \. The new array syntax results in [key => value], unique among every language with hash literals.
So wait...you're telling me...different languages can build on each other, but an expert in one isn't automatically an expert in the other? Alert NASA, we have a breakthrough in human understanding. Languages are different. That's the point of making new languages. Sorry if Perl's regex format is confusing to a C guru. Perhaps he should learn Perl before complaining that the syntax of a language he doesn't know is confusing.

Quote:
Weak typing (i.e., silent automatic conversion between strings/numbers/et al) is so complex that whatever minor programmer effort is saved is by no means worth it.
This is the closest he comes to outright saying "I don't understand it and therefore it's wrong." If you want to understand how weak typing conversions work, you could look in the manual for the chart, or you could read my article on it.

Quote:
Little new functionality is implemented as new syntax;
From the man who complained about the syntax of arrays, namespaces, and type conversions literally 2 sentences prior.

Code example: fopen

First of all, let me start by saying that when he said the line he discovered was "somewhere in the manual," it was deep into the manual entry for complex system-level error-handling functions and was specifically designed to suppress errors in a weird way so that you could see how error-screaming works. The fact that he pulled this frankly BS example out of a manual entry on weird and complex error handling shows just how hard he was reaching to make a point, but since his misunderstanding of PHP is well illustrated here I'll continue.

Quote:
(Docs don’t say what “won’t work” means; returns null, throws exception?) [...] If allow_url_fopen is disabled in php.ini, this still won’t work. (How? No idea.)
Except the docs DO say what happens when the function fopen fails: it returns false. It's in a nice blue box labeled "returns." Can't miss it.

Quote:
Because of the @, the warning about the non-existent file won’t be printed.
Line-level error suppression is a powerful feature, I'm glad to use a language which supports it.

Quote:
But it will be printed if scream.enabled is set in php.ini.
System-level forcing of all errors is another powerful feature, I'm glad I don't have to go find ever @ sign in my code when I'm debugging something weird.

Quote:
If it is printed, exactly where it goes depends on display_errors
I'm beginning to think he's never used a programming language at all. Is it just me, or should every web language have server-level error reporting configuration? What does Python do? Just spit all errors to the screen no matter what? If you want to log to a file, you have to do that by hand for every error? That sounds awful. Or he's full of it.

Back to individual complaints

Quote:
The language is full of global and implicit state
Server-level configurations are pretty handy and remove a lot of boilerplate, don't you think? Good thing removing boilerplate was one of his biggest criteria back at the beginning.

Quote:
register_tick_function sets a global function to run every tick—what?!
Shame the manual on that function isn't 4 pages with explanations and usage examples or he might learn something.

Quote:
There is no threading support whatsoever.
It's purely a web language, and nothing else. Websites don't need threads, because if they take longer than a second to run they've failed. Again, fundamental lack of understanding.

Quote:
json_decode returns null for invalid input, even though null is also a perfectly valid object for JSON to decode to—this function is completely unreliable unless you also call json_last_error every time you use it.
He gets another point here, json_decode really should throw an exception. Though to be fair, if I ever get a json object which resolves to null, I'm going to handle it as an error regardless.

Quote:
array_search, strpos, and similar functions return 0 if they find the needle at position zero, but false if they don’t find it at all.
Once again, if this person would take 10 minutes to attempt to understand loosely typed languages, this would all make sense. These functions return the index of the item found. if no item is found, they return false. That sounds really powerful, and I'm not sure why it's even a complaint. Luckily for the reader, he goes on to explain his ignorance:

Quote:
In C, functions like strpos return -1 if the item isn’t found. If you don’t check for that case and try to use that as an index, you’ll hit junk memory and your program will blow up. [...] In, say, Python, the equivalent .index methods will raise an exception if the item isn’t found. If you don’t check for that case, your program will blow up.
C and Python crash fatally, potentially destroying the memory space of other programs. Got it.

Quote:
In PHP, these functions return false. If you use FALSE as an index, or do much of anything with it except compare with ===, PHP will silently convert it to 0 for you. Your program will not blow up; it will, instead, do the wrong thing with no warning, unless you remember to include the right boilerplate around every place you use strpos and certain other functions.
So basically, if you don't include the right boilerplate around other languages, they fatally crash and destroy their state, potentially also destroying neighboring programs in memory. However, if you do the same erroneous code in PHP, it continues to work with slightly unexpected results. Tell me again why "keeps working" is a problem? Plus, for what might be the 10th time, he just plain doesn't understand loosely typed languages. Yes, false == zero. That's actually an incredibly powerful feature of the language. The boilerplate he's comparing about isn't exactly onerous either. Look, here it is: "!== false". Oh man, look out. That nearly broke my fingers I typed for so long.

Quote:
So I have to fit this in here, because it bears repeating: PHP is a community of amateurs.
And they're all stupid heads and not invited to my birthday party. I love how he "had to fit in" an ad hominem attack against an entire community of developers. He even states further up in the article that facebook and wikipedia run PHP, and still manages to claim that those people are amateurs.

"Back to the facts" (and by "facts" we mean "opinions borne of fundamental misunderstandings")

Quote:
== is useless [...] Comparison isn’t much better.
Blah blah doesn't understand loosely typed blah.

Quote:
PHP does not overload +
Quite literally damned if you do, damned if you don't. He simultaneously complains about PHP doing something, then not doing that same thing.

Quote:
There is no way to declare a variable.
I really should make a hotkey for "he doesn't understand loosely typed languages."

Quote:
Global variables need a global declaration before they can be used. This is a natural consequence of the above, so it would be perfectly reasonable, except that globals can’t even be read without an explicit declaration—PHP will quietly create a local with the same name, instead. I’m not aware of another language with similar scoping issues.
PHP has strict function scope, and globals aren't automatically imported for reading and writing. His complaint seems to be that all globals aren't read-only inside all functions, which I personally think is confusing if it's done that way. Why should I be able to read $foo but not write to it? Doesn't that seem more confusing?

Quote:
There are no references. What PHP calls references are really aliases; there’s nothing that’s a step back, like Perl’s references, and there’s no pass-by-object identity like in Python.
His second fundamental misunderstanding finally rears its head here: Symbol tables. PHP doesn't use variables like other languages, it uses symbol tables. PHP does in fact have references, and pass-by-identity (objects are always passed by reference).

Quote:
Once a variable is made a reference (which can happen anywhere), it’s stuck as a reference. There’s no obvious way to detect this and un-referencing requires nuking the variable entirely.
I'm willing to grant him another point here (which makes three). If you, for instance, make $a a reference to the third item in array $b, then any modifications to $a modify the inner structure of $b, though $a still looks like a stand-alone variable. Perhaps another symbol would be good, but then you get into the problem of perl, where $a and #a and &a are all confusing and conflicting things. Difficult problem to solve, but most programmers just don't use references unless they need them.

Quote:
(integer) is a synonym for (int). There’s also (bool)/(boolean) and (float)/(double)/(real). [...] There’s redundant syntax for blocks: if (...): ... endif;, etc.
"PHP is too confusing, I have to memorize so many things! Waaaaaah! In addition, there's aliases for things so if I forget and use the wrong one it will still work! PHP IS AWFUL!!"

Quote:
Most error handling is in the form of printing a line to a server log nobody reads and carrying on.
"I don't read my log files, what kind of programmer would ever use error logs to debug? That's stupid! My website should just die with a white screen and a 'Sorry!' message whenever there's an error so I know to go try to remember where I put the error logs"

Quote:
E_STRICT is a thing, but it doesn’t seem to actually prevent much and there’s no documentation on what it actually does.
As stated above, E_STRICT is an error-level constant (hence the E_) and is well defined in the manual.

Quote:
Weirdly inconsistent about what’s allowed and what isn’t.
The things he listed as "silent" are not errors in the least, they're all valid PHP operations. He seems to think E_STRICT should mean "work more like another programming language." Probably because he doesn't understand PHP.

Quote:
PHP errors and PHP exceptions are completely different beasts
Are there interpreted languages which throw in-application exceptions instead of language-level errors when they encounter fatal or parse errors? I don't think there are, I think the author doesn't understand interpreted languages vs compiled ones.

Quote:
Some built-in functions interact with reference-returning functions in, er, a strange way.
The one example he has of this shows someone attempting to create an anonymous (unreferenced) array, put a variable in it, and then have it immediately destroyed. Not sure why that's even something someone would do, but...err...you got me.

OO

Quote:
I’ve yet to find a global function that even has a capital letter in its name
Anyone else feel like scrolling up to where he complains about function names being case-insensitive? No?

Quote:
Perl, Python, and Ruby all have some concept of “property” access via code; PHP has only the clunky __get and friends. (The documentation inexplicably refers to such special methods as “overloading”.)
Our dear author has not yet discovered the simplicity of $foo->bar. Either that or he has absolutely no understanding of how objects work in ANY language.

Quote:
Classes have something like variable declaration (var and const) for class attributes, whereas the procedural part of the language does not.
Aside from demonstrating the "var" syntax (deprecated over a decade ago), this doesn't understand the complexities of designing a real system in PHP.

Quote:
Despite the heavy influence from C++/Java, where objects are fairly opaque, PHP often treats objects like fancy hashes—for example, the default behavior of foreach ($obj as $key => $value) is to iterate over every accessible attribute of the object.
Still not getting why he complains about additional functionality he doesn't even have to use. So you can foreach over an obect to get its public variables (or, if it implements arrayaccess, some other variable of the author's choosing). If you don't like that, don't use it. It's like saying "unlike C, Python allows me to have tuples." So?

Quote:
Object attributes are $obj->foo, but class attributes are Class::$foo. ($obj::$foo will try to stringify $obj and use it as a class name.) Class attributes can’t be accessed via objects; the namespaces are completely separate, making class attributes completely useless for polymorphism.
None of this makes any sense at all. I'm willing to give him the benefit of the doubt and assume he hit his head or something.

Quote:
I’m aware this is more personal taste, but I don’t know why this stuff is necessary in a dynamic language—in C++ most of it’s about compilation and compile-time name resolution.
Wow, that's an excellent point. I'm glad we're talking about a compiled language and not, for instance, PHP.

Arrays

Quote:
Despite that this is the language’s only data structure, there is no shortcut syntax for it
Once again, who wants to volunteer to scroll up to where he complained about the shortcut array syntax? It's like this article was written in 2004, and then he updated it with more complaints, many of the complaints being about the fixes to his previous complaints. It's like the room is filthy, and the maid used floor polish that smells too strongly. One or the other.

Quote:
it’s the only language in its niche that has no vetted way to create a hash without quoting string keys.
Because it's a loosely typed language perhaps? Because it's possible to use a variable without defining it, even constants, and therefore an unquoted bare string literal is assumed to be an undefined constant? Becuase you don't understand loosely typed languages?

Missing Features

Quote:
No XSS filter. No, “remember to use htmlspecialchars” is not an XSS filter. This is.
So "remember to use htmlspecialchars" doesn't count, but "remember to use marksupsafe" does? Gotcha. Good to know that the criteria for language functionality can just change mid-sentence.

Quote:
No CSRF protection. You get to do it yourself.
Because his last example was a function call you had to wrap arounde every string, I'm going to go ahead and assume that's what he'd use to "prove" this point as well, if such a library is even available.

Quote:
No generic standard database API. Stuff like PDO has to wrap every individual database’s API to abstract the differences away.
There's no standard database API. Except for the standard one. But that one doesn't count because deep down below where you can see it, it doesn't call the same functions for each database.

Quote:
No authentication or authorization.
This one I actually know nothing about. Do other languages have built-in user authentication which can work as a login system? So if I want to write a web login system in Python, there's a built-in language core module for that?

Security

Quote:
PHP’s poor security reputation is largely because it will take arbitrary data from one language and dump it into another. This is a bad idea. "<script>" may not mean anything in SQL, but it sure does in HTML.
Again, I'm going to have to ask how Python does that. Does Python automatically sanitize plaintext output? How would you print a <script> tag in python if that's the case? Or is this, like most of his complaints, just how languages work?

Quote:
PHP outright encourages “sanitizing”: there’s an entire data filtering extension for doing it.
Could this be because PHP interacts with half a dozen other languages? Sure, you can use "placeholders" (bound parameters) with SQL, but can you use "placeholders" with HTML forms? No, you need to sanitize your output. Good thing PHP includes those functions.

Quote:
register_globals. It’s been off by default for a while by now, and it’s gone in 5.4. I don’t care. This is an embarrassment.
PHP was originally written to be super easy to use. As the featureset grew, they disabled some of the easier things. Register_globals is stupid today, which is why it's been deprecated for 10 years.

Quote:
include accepting HTTP URLs. Likewise.
There's a PHP.ini command to disable this, which is off by default. He even complained about a similar command above.

Conclusion

Quote:
If you got all the way down here, I assumed you agreed with me before you started
Or you had a morbid fascination with the awful arguments being presented and were unable to turn away, like a car crash.
Comments on this post
Northie agrees: mainly in part due to your efforts in responding. I just didn't have the energy
huyaroo agrees!

Shameproof
Mar 23, 2011

do other countries besides the US even have p lang developers?

Shameproof
Mar 23, 2011

non english speaking countries i mean

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Shameproof posted:

non english speaking countries i mean

T_PAAMAYIM_NEKUDOTAYIM

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

Shameproof posted:

non english speaking countries i mean

ruby is an honorary plang

Shameproof
Mar 23, 2011

Luigi Thirty posted:

T_PAAMAYIM_NEKUDOTAYIM

That's probably worse than english. Imagine a PHP dev in Chinese who speaks a fair amount of English. Poor sap would know what a double colon is but now he has to google that and glance over and translate a bunch of snarky stackoverflow comments.

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

wisdom

that "fractal of bad design" post was one of the stupidest things i've ever read. facile bullshit hand-crafted to appeal to useless perubython "developers", all of whom breathlessly recirculated it for a month

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
BTW, there is a spelling mistake in the parse error, it should be T_PAAMAYIM_NEKUDATAYIM (in hebrew, the 'double' form is just the original noun + the 'ayim' suffix and 'nekuda' is the single form ['nekudot' is the plural form]).

cowboy beepboop
Feb 24, 2001

Tiny Bug Child posted:

wisdom

that "fractal of bad design" post was one of the stupidest things i've ever read. facile bullshit hand-crafted to appeal to useless perubython "developers", all of whom breathlessly recirculated it for a month

0wned btch

tef
May 30, 2004

-> some l-system crap ->

Luigi Thirty posted:

tears it apart nearly sentence-by-sentence.

heh


quote:

This ridiculous piece of prose seems to be insinuating that the basic control structures of PHP are somehow non-standard and don't work like every other language.

http://stackoverflow.com/questions/10057671/how-foreach-actually-works/



quote:

Show me the faults in facebook.

facebook don't use php :confused: they use a variant with different syntax, semantics, standard library, and supports first class html

quote:

Find the design flaws in vbulletin, wordpress

imagine i've pasted a link to cert or bugtraq


quote:

Just look at his list of "surprises": mysql_real_escape_string? OH MY GOD! SHOCKING! What the hell is he talking about?

this is just beautiful.


quote:

And E_ALL? they all begin with E_ and then give what they describe. I will grant that E_ALL spent a couple years not being absolutely every error. However, I think the choice was to make E_ALL provide only functional errors, and not strict warnings like deprecated function names. Some disagree.

seriously, an argument about how all means some


quote:

Of course, the counterpart of every function is in that function's manual page

look I told you I was an rear end in a top hat so you can't complain about it


quote:

He lists error-checking as boilerplate. I don't know how Python handles it

I am defending php because it's the only thing i've ever googled.


quote:

PHP's error handling is atrocious.

after explaining how error handling is good and it is my problem, when i have to understand my code i have no idea what I am doing, and when that happens to me, it's php's fault.

quote:

However, it is his responsibility to come to an understanding of how programming languages work, and he has failed to do so.

to be fair neither has zend.

quote:

The conscious choices of almost every single web engineering team worth a drat do, in fact, count as proof that the tool they've chosen is worthwhile

php is the justin bieber of programming, and thus the best.


quote:

PHP was designed to be easy to understand

php was a series of perl macros inline in html originally.

quote:

Quote:
There’s no clear design philosophy.
Yes, we know. He still has one point.

but i thought it was to be easy to understand

quote:

So wait...you're telling me...different languages can build on each other, but an expert in one isn't automatically an expert in the other?

the author demonstrates the issue of php copying the look of other languages but not the meaning, by doing so with an argument in english. all the words are there, but to him they mean different things.

quote:

If you want to understand how weak typing conversions work, you could look in the manual for the chart, or you could read my article on it.

PHP is easy to understand because you have to decode it via google.


quote:

So "remember to use htmlspecialchars" doesn't count, but "remember to use marksupsafe" does? Gotcha. Good to know that the criteria for language functionality can just change mid-sentence.

except those really smart people using php think this is a bad idea too and so made xhp


quote:

Again, I'm going to have to ask how Python does that.

I'm going to ask because I don't want to learn how other languages work

eh effort


tbc is a better defender of php because he understands how little the code he writes matters

tef
May 30, 2004

-> some l-system crap ->
although it's kinda hilarious tragic

dismissing arguments that it doesn't work like any other language and then admitting they don't know any other language

claiming it has a design then admitting it doesn't

it's sorta like someone in a vicious cycle of ignorance.

tef
May 30, 2004

-> some l-system crap ->
frankly, the php 'fractal of bad design' is a whole long list of issues most people don't face in php because they're not trying to write anything than dumb templates and sql queries.


it's when people think it is a programming language for writing software and not html templates, then you get into issues.

Opinion Haver
Apr 9, 2007

quote:

In C, functions like strpos return -1 if the item isn’t found. If you don’t check for that case and try to use that as an index, you’ll hit junk memory and your program will blow up. [...] In, say, Python, the equivalent .index methods will raise an exception if the item isn’t found. If you don’t check for that case, your program will blow up.
C and Python crash fatally, potentially destroying the memory space of other programs. Got it.

this one's my favorite tbh

yeah blowing up in a really obvious way is totally way better than silently continuing with bad data

Opinion Haver
Apr 9, 2007

Nomnom Cookie posted:

Yeah Scala is p cool

i've never actually taken a look at scala but i've heard decent things about it

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
the author of "fractal" explained to him basic virtual memory and permissions and how no, you can't corrupt other processes memory space, especially not with python exceptions

and he just continued saying that you could crash other processes

read the devshed forums thread its p cool

tef
May 30, 2004

-> some l-system crap ->
i dunno why people compare php to python

php is a c web framework with a template language included, that lets you call out to c library functions

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
ah right i remember now after being rebutted that you couldn't corrupt other processes memory

You have just declared buffer overflow attacks impossible. Congratulations.

http://forums.devshed.com/php-development-5/php-is-a-fractal-of-bad-design-hardly-929746.html

FamDav
Mar 29, 2008

Vanadium posted:

my c++ is rusty (heh), what do any of these buy you in this example. it's just like three fields.

so i was being a jerk but also for something that you're going to be creating a lot of, performing operations on, and passing in and out of functions you want the code working with them to be as optimized as is reasonable.


and everything I said was trill c++ that the females loves.

tef
May 30, 2004

-> some l-system crap ->

Suspicious Dish posted:

ah right i remember now after being rebutted that you couldn't corrupt other processes memory

You have just declared buffer overflow attacks impossible. Congratulations.

http://forums.devshed.com/php-development-5/php-is-a-fractal-of-bad-design-hardly-929746.html

how

Cybernetic Vermin
Apr 18, 2005

it is weird how so many supposedly expressive languages, such as the p's, get hashmaps wrong and only allows string keys, where clunky ol' java has a bullet-proof flexible hash implementation. such an incredibly useful data type as well

Opinion Haver
Apr 9, 2007

code:
>>> x = {(2,3): "y", 8: "os", object(): "p", lambda x: x: "os"}
>>> x[(2,3)]
'y'
look at all those string keys

tef
May 30, 2004

-> some l-system crap ->
thanks shaggar

Opinion Haver
Apr 9, 2007

ugh what's the syntax for using language-specific code block highlighting

Cybernetic Vermin
Apr 18, 2005

oops, was pondering php and js from the last few pages, remembered perls original weirdness, expanded to the p's for example without thinking :downswords:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
JavaScript code:
var map = new Map();
map.set(4, 'butts');

Cybernetic Vermin
Apr 18, 2005

Suspicious Dish posted:

JavaScript code:
var map = new Map();
map.set(4, 'butts');

imagining a better world with ecmascript 6 itt~~

FamDav
Mar 29, 2008

yaoi prophet posted:

ugh what's the syntax for using language-specific code block highlighting

code="yourbitchasslanguage"

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan
what language is good at arbitrary precision arithmetic

Zombywuf
Mar 29, 2008

Moist von Lipwig posted:

what language is good at arbitrary precision arithmetic

C++*

* Assuming a sufficiently good arbitrary precision arithmetic library**

** You probably have to write this bit yourself.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

JewKiller 3000 posted:

it may be the case that they are "useful" in an html templating language for functional retards.

i didn't think you could do functional programming in php?

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Notorious b.s.d. posted:

"variable variables" can only be implemented in a bad language because they are a consequence (defect?) of php's naive implementation

scala takes the converting constructor idea way overboard. you can use implicit defs to convert anything anywhere anytime (even to effectively assign new methods to an existing object based only on its type, because it is convertible to some other type that DOES have the method)

Eh, converting constructors can be abused, but at least they can't be top-level and you have to actually intend to make one, as opposed to C++ where they exist unless you use the explicit keyword and they come with whatever header you include automatically. And the converting to another type to add methods is pretty useful for extending code past what it was designed for originally, like how StringOps allows us to use scala collection methods on java.lang.String.

Condiv fucked around with this message at 13:27 on Mar 4, 2013

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan

Zombywuf posted:

C++*

* Assuming a sufficiently good arbitrary precision arithmetic library**

** You probably have to write this bit yourself.

yyyup that's what i thought, time to dust off the books

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Moist von Lipwig posted:

yyyup that's what i thought, time to dust off the books

so why not a bignum library?

Adbot
ADBOT LOVES YOU

skeevy achievements
Feb 25, 2008

by merry exmarx

Cybernetic Vermin posted:

it is weird how so many supposedly expressive languages, such as the p's, get hashmaps wrong and only allows string keys, where clunky ol' java has a bullet-proof flexible hash implementation. such an incredibly useful data type as well

that's a benefit of java being designed by pro-tier studs like james gosling and guy steele and bill joy instead of no-name hobbyists

obviously it all went wrong somewhere but I'm not up on the history of sun/java

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply