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
Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Westie posted:

There is consistency - it's about as consistent as custard. Keep jumping on it and you'll stay afloat, rest for a moment and you'll find yourself knee deep in the stuff.

All procedural functions are usually styled after C naming conventions - underscores, so, stuff like file_get_contents, curl_init, html_entity_decode, htmlentities, oh drat it.

Underscores are the C++ STL's naming convention, not the C stdlib's. Hence why we have snprintf(3) and strtol(3) and not string_print_formatted_nbytes() and string_to_long() or whatever.

Adbot
ADBOT LOVES YOU

canis minor
May 4, 2011

Sebbe posted:

Brainfuck sticks pretty well to its one-character-per-instruction naming convention.

I'm more of a fan of HQ9+, but there're hopefully some non-esolangs that answer my question.

vvv I'm not familiar with C#, but I wondered if System.out.println shouldn't be System.out.printLn, or why it's not System.out.printLine (if not System.Out.printLine), from top of my head

canis minor fucked around with this message at 15:03 on Aug 19, 2014

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

eithedog posted:

So, which language has naming consistency?
I don't remember ever encountering blatant inconsistencies in C# (VB.Net and F# both have some due also having stuff that uses non-.NET names), and while I haven't used Java much, it appears to have pretty consistent names.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

eithedog posted:

So, which language has naming consistency?

I doubt any language is perfectly consistent.

However, there are many languages that are consistent enough that "inconsistent naming" isn't one of the first things to spring to mind when thinking of their negatives.

Athas
Aug 6, 2007

fuck that joker

eithedog posted:

So, which language has naming consistency?

APL. ⌈ is the maximum function, ⌊ is the minimum. Similarly, ⌽ is reversal along the last axis, while ⊖ is along the first axis, and, of course, ⍉ reverses all axes.

The rabbit hole goes all the way, too: ⍎ is the "eval" function. Conceptually, it is "turn text into APL value". What, then, is the behaviour of the obviously inverse symbol, ⍕? Well, it is the pretty-printer, of course, as that turns APL values into text! Oh, and the function for multiplying by π is of course ○.

Athas fucked around with this message at 16:19 on Aug 19, 2014

No Safe Word
Feb 26, 2005

Plorkyeran posted:

I don't remember ever encountering blatant inconsistencies in C# (VB.Net and F# both have some due also having stuff that uses non-.NET names), and while I haven't used Java much, it appears to have pretty consistent names.

There's teeny things here and there, like text encodings have a method called GetBytes which returns a byte[]. Meanwhile, some of the types (Guid, BigInteger, et al) use ToByteArray for a byte[]. But they're inherently different functions because one takes in an input as an argument and the other acts on the thing itself. All in all, the core C# language is pretty darn consistent with regards to naming things.

ijustam
Jun 20, 2005

No Safe Word posted:

There's teeny things here and there, like text encodings have a method called GetBytes which returns a byte[]. Meanwhile, some of the types (Guid, BigInteger, et al) use ToByteArray for a byte[]. But they're inherently different functions because one takes in an input as an argument and the other acts on the thing itself. All in all, the core C# language is pretty darn consistent with regards to naming things.

At least they start the same way so you can find them easily. If it was ToArray and GetByteArray I'd be annoyed.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
There's good reason that APL has consistent terminology/notation- it was developed as a mathematical notation for manipulating arrays and was used in that manner for a number of years before the first interpreters that ran on real computers were written. Perhaps the takeaway could be that there is benefit to designing languages for human use first, and computer use second. APL does, however, get criticism for being a "closed system" because user-defined operators don't look anything like the builtins. Of course it also gets a lot of flak for not using an ascii alphabet and "normal" operator precedence rules, but I think that is less reasonable.

canis minor
May 4, 2011

Thermopyle posted:

I doubt any language is perfectly consistent.

However, there are many languages that are consistent enough that "inconsistent naming" isn't one of the first things to spring to mind when thinking of their negatives.

Fair point, though I'd not say that about PHP as well (memory management :argh:).

Athas posted:

APL. ⌈ is the maximum function, ⌊ is the minimum. Similarly, ⌽ is reversal along the last axis, while ⊖ is along the first axis, and, of course, ⍉ reverse all axes.

The rabbit hole goes all the way, too: ⍎ is the "eval" function. Conceptually, it is "turn text into APL value". What, then, is the behaviour of the obviously inverse symbol, ⍕? Well, it is the pretty-printer, of course, as that turns APL values into text! Oh, and the function for multiplying by π is of course ○.

It always amazes me how you APL people are able to remember all of these operators; however, even with these symbols, if A×B is multiplication, A○B should be group multiplication.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Athas posted:

APL. ⌈ is the maximum function, ⌊ is the minimum. Similarly, ⌽ is reversal along the last axis, while ⊖ is along the first axis, and, of course, ⍉ reverses all axes.

The rabbit hole goes all the way, too: ⍎ is the "eval" function. Conceptually, it is "turn text into APL value". What, then, is the behaviour of the obviously inverse symbol, ⍕? Well, it is the pretty-printer, of course, as that turns APL values into text! Oh, and the function for multiplying by π is of course ○.

Richard Stallman posted:

Rho, rho, rho of X
Always equals 1.
Rho is dimension; rho rho rank.
APL is fun!
And that is the entire extent of my APL knowledge.

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

TheresaJayne posted:

Knowing that. Is it such a bad thing? those who know better will not use it. Let the newbies use it until they realise that it is not as good as they thought - but by then they have the knowledge to know what is a better language.

But this isn't what happens. People continue using PHP and then make exploit-ridden websites for large organizations.

PrBacterio
Jul 19, 2000

Zopotantor posted:

And that is the entire extent of my APL knowledge.
You forgot this one:

I don't know who posted:

There's just three things a man must do,
before his life is done:
Write two lines of APL,
and make them buggers run.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.
My experience with PHP is it feels like a dynamically-typed C/C++, with the worst of both worlds. On one hand, you got complete type fluidity, no scoping, poor debugging and error handling, behavior that can be unpredictable and hard to validate, etc. On the other, you got a low-level global API, dependency on includes and definition order, tacked-on OOP, inconsistency from constantly adding on more while maintaining all that came before, etc. Combine both (why would you) and it's a mindfuck.

No Safe Word
Feb 26, 2005

If you want to hear not so much a defense of PHP but a justification of why Facebook (natch) actually likes PHP and is sticking with it despite it's silliness: http://www.infoq.com/presentations/php-history

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

No Safe Word posted:

If you want to hear not so much a defense of PHP but a justification of why Facebook (natch) actually likes PHP and is sticking with it despite it's silliness: http://www.infoq.com/presentations/php-history

Subjunctive literally just posted that! Stop astroturfing for PHP!

No Safe Word
Feb 26, 2005

ultramiraculous posted:

Subjunctive literally just posted that! Stop astroturfing for PHP!

Hah, missed it at the bottom of the last page. And believe me, I'm still pretty much on board with the whole "fractal of bad design" point of view.

feedmegin
Jul 30, 2008

nielsm posted:

Sorry, no. It's Japanese for "my way or the highway".

Or in other terms, "really inflexible".

Hence, you know, 'rails'. As in railroading. As in on a railway where you don't get to decide the direction you go in. It is sort of right there in the name.

Ochowie
Nov 9, 2007

PHP Thread posted:

Your argument here is that programming languages are meant for humans? Not computers? Honestly?

This quote still has me laughing.

kugutsu
Dec 31, 2008

feedmegin posted:

Hence, you know, 'rails'. As in railroading. As in on a railway where you don't get to decide the direction you go in. It is sort of right there in the name.

Rails is not even 'omakase' anymore in the way that dhh was talking about in that blog post from years ago. It provides defaults for things like ORM and templates but it's also really easy to substitute your own way of doing things. I think a lot of people come to Rails with no Ruby experience and things end up looking a lot more magical than they really are. In reality once you're in a controller method you're running plain old Ruby code and working with plain old Ruby objects and you can render whatever the hell you want back out.

The real horror of Rails is how far dhh has his head up his rear end most of the time.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

kugutsu posted:

Rails is not even 'omakase' anymore in the way that dhh was talking about in that blog post from years ago.

That blog post was barely a year and a half ago.

kugutsu
Dec 31, 2008
Fair enough. So dhh is completely ignorant about what people are doing with his own framework, which isn't surprising really.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

SupSuper posted:

My experience with PHP is it feels like a dynamically-typed C/C++, with the worst of both worlds. On one hand, you got complete type fluidity, no scoping, poor debugging and error handling, behavior that can be unpredictable and hard to validate, etc. On the other, you got a low-level global API, dependency on includes and definition order, tacked-on OOP, inconsistency from constantly adding on more while maintaining all that came before, etc. Combine both (why would you) and it's a mindfuck.

What about PHP reminds you of C/C++, other than maybe the things shared with all Algol-descendent languages? It lacks pointers, choice of representation, control over memory layout, explicit object lifecycles, and generics. Those to me are pretty fundamental to C-family languages. It also feels pretty different to program in the two, IME. PHP reminds me much more of Perl, if I had to find an analogue.

No Safe Word posted:

Hah, missed it at the bottom of the last page. And believe me, I'm still pretty much on board with the whole "fractal of bad design" point of view.

You're the worst parachute account ever.

Space Kablooey
May 6, 2009


Subjunctive posted:

What about PHP reminds you of C/C++, other than maybe the things shared with all Algol-descendent languages? It lacks pointers, choice of representation, control over memory layout, explicit object lifecycles, and generics. Those to me are pretty fundamental to C-family languages. It also feels pretty different to program in the two, IME. PHP reminds me much more of Perl, if I had to find an analogue.

Segfaults? :shobon:

raminasi
Jan 25, 2005

a last drink with no ice

Subjunctive posted:

What about PHP reminds you of C/C++, other than maybe the things shared with all Algol-descendent languages? It lacks pointers, choice of representation, control over memory layout, explicit object lifecycles, and generics. Those to me are pretty fundamental to C-family languages. It also feels pretty different to program in the two, IME. PHP reminds me much more of Perl, if I had to find an analogue.

There's a pretty straightforward list of similarities in the post you quoted :raise: (admittedly more to C++ than C)

SupSuper posted:

My experience with PHP is it feels like a dynamically-typed C/C++, with the worst of both worlds. On one hand, you got complete type fluidity, no scoping, poor debugging and error handling, behavior that can be unpredictable and hard to validate, etc. On the other, you got a low-level global API, dependency on includes and definition order, tacked-on OOP, inconsistency from constantly adding on more while maintaining all that came before, etc. Combine both (why would you) and it's a mindfuck.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Subjunctive posted:

What about PHP reminds you of C/C++, other than maybe the things shared with all Algol-descendent languages?

He's probably referring to PHP's habit of exposing pretty thin wrappers over various C APIs, eg. the way the language exposes mysql_escape_string() and friends, and how common instructional materials prefer their usage over something further abstracted like DBI (e: I see PHP has PDO now, I am pleasantly surprised as I haven't used it in years; I hope it sees a lot of uptake).

Steve French
Sep 8, 2003

Subjunctive posted:

Keith Adams gave a talk about why we still use and improve PHP at Facebook: http://www.infoq.com/presentations/php-history

Am I missing something, or is this site going to make me create an account of some sort so that I can download the slides and mp3 separately, for a talk about PHP?

gently caress everything about that.

senrath
Nov 4, 2009

Look Professor, a destruct switch!


Steve French posted:

Am I missing something, or is this site going to make me create an account of some sort so that I can download the slides and mp3 separately, for a talk about PHP?

gently caress everything about that.

You could just, y'know, watch the embedded video.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
The short version of the talk is that PHP, possibly by complete accident, has characteristics which guide the design of web applications in good directions. Specifically:

  • the PHP model makes the dependencies (includes) of a given PHP file explicit. Every PHP file's processing begins with a predictable, uniform set of things in the namespace. This makes it easy for a maintainer to reason about that individual file's behavior in isolation.
  • PHP programs have to explicitly preserve session data if they want it. They're stateless by default.
  • PHP programs cannot do any sort of local concurrency, so applications instead communicate with other processes through mechanisms like curling another PHP page. This prevents programmers from even thinking about sharing memory between processes and instead requires data be shared by copying.

It is argued that the large-scale architectural decisions which arise from these features/limitations serve large applications well from a maintenance perspective, to the point that it overrules the small-scale faults of the language and standard libraries. Facebook has then gone on to write tooling which attempts to mitigate some of those small-scale problems.

I'm not sure I buy it entirely but it's kind of interesting to see vague similarity between what is said about PHP and the kind of architecture that is idiomatic in, say, Erlang.

No Safe Word
Feb 26, 2005

Steve French posted:

Am I missing something, or is this site going to make me create an account of some sort so that I can download the slides and mp3 separately, for a talk about PHP?

gently caress everything about that.

The slides aren't that useful without the video, I'd just watch the video. Here are the slides though

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

GrumpyDoctor posted:

There's a pretty straightforward list of similarities in the post you quoted :raise: (admittedly more to C++ than C)

Huh, yeah. I have no excuse.

What doesn't depend on declaration order? Java's imports do, python/Perl/ruby/JS do.

I don't think C++'s OOP really feels tacked on at this point, but I guess if I squint; it certainly used to, though. If you saw C++ without knowledge of C, I wonder if you could tell which parts are forced by compatibility. There are probably examples of things that could be done more naturally but were twisted around due to heritage, but I haven't followed the evolution of the language closely enough to know of them.

I'm not sure if I'd prefer well-written C++ to well-written Hack to take over from someone else, tbh, and my C++ is a fair bit stronger than my PHP.

The Insect Court
Nov 22, 2012

by FactsAreUseless

Internet Janitor posted:

The short version of the talk is that PHP, possibly by complete accident, has characteristics which guide the design of web applications in good directions. Specifically:

  • the PHP model makes the dependencies (includes) of a given PHP file explicit. Every PHP file's processing begins with a predictable, uniform set of things in the namespace. This makes it easy for a maintainer to reason about that individual file's behavior in isolation.
  • PHP programs have to explicitly preserve session data if they want it. They're stateless by default.
  • PHP programs cannot do any sort of local concurrency, so applications instead communicate with other processes through mechanisms like curling another PHP page. This prevents programmers from even thinking about sharing memory between processes and instead requires data be shared by copying.

It is argued that the large-scale architectural decisions which arise from these features/limitations serve large applications well from a maintenance perspective, to the point that it overrules the small-scale faults of the language and standard libraries. Facebook has then gone on to write tooling which attempts to mitigate some of those small-scale problems.

I'm not sure I buy it entirely but it's kind of interesting to see vague similarity between what is said about PHP and the kind of architecture that is idiomatic in, say, Erlang.

There's no remotely convincing reason to use PHP that doesn't involve having either a lot of legacy PHP code, or developers who are only familiar with PHP.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Subjunctive posted:

What doesn't depend on declaration order? Java's imports do, python/Perl/ruby/JS do.
Under what circumstances will switching the order of two import statements in Java affect the behaviour of the rest of the file?

e: I guess maybe if they're both "import *" or some poo poo but that's not the usual case and certainly isn't the same kind of effect you get from textual inclusion or imports that can execute arbitrary code.

Soricidus fucked around with this message at 22:59 on Aug 19, 2014

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Soricidus posted:

Under what circumstances will switching the order of two import statements in Java affect the behaviour of the rest of the file?

If you are wildcard importing, conflicting names are resolved in favour of the last import, no? "Don't do that, then", but that applies to a lot of the horrors we share here.

ObHorror: Android doesn't have priority-inheriting locks, but it sure does have priority-inversion deadlocks!

Edit: another nice side-effect of using PHP is that you tend to attract people who mostly want to get poo poo done, and care much less about the specific technology used to do that. You don't really get "language queens", though people definitely have language affinities. Basically none of our incoming engineers, proportionally, have meaningful PHP experience, so they learn how we do stuff and how to use our tools, and the legacy of "public" PHP practices aren't as relevant.

(Going from working on Java server stuff or Android to PHP and getting that edit/reload feedback latency back feels pretty great, man.)

Subjunctive fucked around with this message at 23:07 on Aug 19, 2014

pigdog
Apr 23, 2004

by Smythe

No Safe Word posted:

If you want to hear not so much a defense of PHP but a justification of why Facebook (natch) actually likes PHP and is sticking with it despite it's silliness: http://www.infoq.com/presentations/php-history

I'm not impressed. "Yes PHP is poo poo, but it's easy to start with, so if we reinvent it to make it look somewhat like a proper language in a really convoluted way, it's less poo poo yay".


quote:

(Going from working on Java server stuff or Android to PHP and getting that edit/reload feedback latency back feels pretty great, man.)
But in the long run it's also a horror of sorts. Seeing poo poo appearing as you reload means it kinda-sorta works and perhaps that it's wired correctly, but doesn't mean it's free of bugs, and recreating various states and conditions in a web app isn't necessarily as convenient. In Java server stuff, say, you should get the feedback of doing the right thing from running unit tests.

pigdog fucked around with this message at 23:17 on Aug 19, 2014

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

pigdog posted:

I'm not impressed. "Yes PHP is poo poo, but it's easy to start with, so if we reinvent it to make it look somewhat like a proper language in a really convoluted way, it's less poo poo yay".

Yeah, I think the talk is really more a description about how PHP worked out OK for them rather than a compelling argument for starting a new project in PHP. That they felt it necessary to create Hack in the first place indicates that PHP is a source of pain even if it didn't cause enough pain to destroy them.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Subjunctive posted:

Edit: another nice side-effect of using PHP is that you tend to attract people who mostly want to get poo poo done, and care much less about the specific technology used to do that. You don't really get "language queens", though people definitely have language affinities. Basically none of our incoming engineers, proportionally, have meaningful PHP experience, so they learn how we do stuff and how to use our tools, and the legacy of "public" PHP practices aren't as relevant.

I hate to say this, but this really smacks of rationalization. It sounds like you have good hiring practices, not that PHP attracts good people.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Thermopyle posted:

I hate to say this, but this really smacks of rationalization. It sounds like you have good hiring practices, not that PHP attracts good people.

Oh, I don't think use of PHP attracts basically anyone, as first-order effect (those it does attract are probably somewhat disappointed because our stuff doesn't look like typical PHP). In fact, I think it repels some people, especially those who are religious about technical purity. It would not be a reason to choose PHP, but I think that cultural filter is real and a nice side-effect.

Our hiring practices are decent though, false positives like myself notwithstanding.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Subjunctive posted:

What about PHP reminds you of C/C++, other than maybe the things shared with all Algol-descendent languages? It lacks [...] generics. [...] fundamental to C-family languages

Fundamental to C-family languages. Well, except C.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Dessert Rose posted:

Fundamental to C-family languages. Well, except C.

Touché.

Adbot
ADBOT LOVES YOU

Doctor w-rw-rw-
Jun 24, 2008

Subjunctive posted:

Our hiring practices are decent though, false positives like myself notwithstanding.
Eh...I've seen and experienced very major issues with Facebook's hiring practices.

I've just never complained because I still hold out hope of Facebook someday deciding I was a false negative.

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