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
putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
PHP 5+ is a useful language to know despite what smug idiots tell you.

Adbot
ADBOT LOVES YOU

Ghostlight
Sep 25, 2009

maybe for one second you can pause; try to step into another person's perspective, and understand that a watermelon is cursing me



The Merkinman posted:

Anyone here try out Spartan in the latest Windows 10 build? The Cortana integration seems neat, but it feels like that's the only site it works on. I've looked at the code and not seen anything special, and in fact it looks pretty sub par as far as code (two #footers, no microdata, etc). Any idea how it works?
It's not in the web code. It's a side panel in Spartan itself that basically just goes off to Bing servers and grabs details from there, the same way Google gives you a map of the business with address details and opentable.com link on the results page for "cuoco seattle" - it's just formatted in a nicer manner and built in to the browser itself rather than a search results page. That's also probably why it doesn't work on basically anything else - it's not actively gathering that stuff on the fly, it's just pinging the server with the domain and asking if there's info there for it.

Thermopyle
Jul 1, 2003

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

The Wizard of Poz posted:

PHP 5+ is a useful language to know despite what smug idiots tell you.

This is true but unrelated to whether someone should pick it up who wants to learn programming, but feel free to continue defending it.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Thermopyle posted:

This is true but unrelated to whether someone should pick it up who wants to learn programming, but feel free to continue defending it.

The problem he wanted to solve, actually, was that he was finding it frustrating having to update his header and footer across multiple HTML files. PHP is 100% perfectly suited for overcoming that problem.

putin is a cunt fucked around with this message at 05:58 on Apr 8, 2015

Thermopyle
Jul 1, 2003

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

The Wizard of Poz posted:

The problem he wanted to solve, actually, was that he was finding it frustrating having to update his header and footer across multiple HTML files. PHP is 100% perfectly suited for overcoming that problem.

And as I said, if that was truly all he wanted to do, then PHP would suffice.

I'm sorry if you felt that PHP was unfairly slighted.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Thermopyle posted:

And as I said, if that was truly all he wanted to do, then PHP would suffice.

I'm sorry if you felt that PHP was unfairly slighted.

Don't be so obtuse, the way you worded it was clearly an attempt to paint PHP as an awful choice. My point is simply that PHP 5+ is not as god awful as you make it out to be and it would be a perfectly valid tool for the job here.

Thermopyle
Jul 1, 2003

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

The Wizard of Poz posted:

Don't be so obtuse, the way you worded it was clearly an attempt to paint PHP as an awful choice. My point is simply that PHP 5+ is not as god awful as you make it out to be and it would be a perfectly valid tool for the job here.

I'm sorry you feel that way. PHP would be a fine tool for handling these headers and footers. My wording was chosen to make sure someone was absolutely sure they needed PHP.

PHP isn't awful in a vacuum, it's awful in relation to the other choices available if you goal goes beyond just wanting to automate your headers and footers and extends to learning programming in general.

You can do great things with PHP and modern PHP is quite nice in comparison to PHP of yesteryear, it's just that there's better choices available.

The thing with recommending PHP for these simple requirements like templates a header and footer, and I've seen it happen a million times, is that the scope almost invariably increases. Particularly for beginners. Then you should have just used a better language to begin with.

My strongly cautioning against PHP for this basic task has nothing to do with smugness or even my admitted idiocy, but with the observation that PHP is rarely the best tool for the job as opposed to merely sufficient...even when it seems like a good fit, outside factors like scope or goal creep often conspire against it.

I mean you might disagree that other languages are better, but someone disagreeing with you on that doesn't make them smug or idiotic. And this thread doesn't feel like a good fit for that argument.

(I'm often both, but I think you're overreacting in this case)

(I mean, there's reasons to choose PHP and I don't think someone is dumb for using it. Social or technical environment, libraries, existing code base, amongst others)

neurotech
Apr 22, 2004

Deep in my dreams and I still hear her callin'
If you're alone, I'll come home.

The Wizard of Poz posted:

Don't be so obtuse, the way you worded it was clearly an attempt to paint PHP as an awful choice. My point is simply that PHP 5+ is not as god awful as you make it out to be and it would be a perfectly valid tool for the job here.

Weren't you the same guy who was like "gently caress node" earlier in this thread? Either that or the front end thread, not sure.

o.m. 94
Nov 23, 2009

Thermopyle posted:



The thing with recommending PHP for these simple requirements like templates a header and footer, and I've seen it happen a million times, is that the scope almost invariably increases. Particularly for beginners. Then you should have just used a better language to begin with.


And pray tell, what incredible technical scope, from a simple header and footer, will this beginner be faced with that PHP cannot address?

unpacked robinhood
Feb 18, 2013

by Fluffdaddy

o.m. 94 posted:

And pray tell, what incredible technical scope, from a simple header and footer, will this beginner be faced with that PHP cannot address?

It's not what Thermopylae is saying

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
PHP can do includes. However if you want a static site generator there are far better tools such as Jekyll and the like. If you want a dynamic website you're better off using a framework. The only benefit you get out of PHP is you can run it everywhere, but after that, after you need to do actual programming in it, there are more than enough inconsistencies in the standard library and edge cases in how it works that you'll be getting held back by minutia when you're trying to learn how to program.

fuf
Sep 12, 2004

haha
One random reason PHP is nice for beginners is that it's usually already on whatever server you're using in a "just works" kind of way, including cheap shared hosting packages.

In my experience the biggest barrier with trying a new language is never anything to do with actual programming, it's just the hassle of setting up the environment. Pythonbrew and pip and Chris Lea's node repos etc etc are all pretty confusing.

e: haha beaten and simultaneously refuted by Maluco Marinero

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Don't get me wrong, I agree that that is a huge benefit of PHP, and definitely contributes to the big CMSes being in PHP, but yeah, you've still got to set up a LAMP stack for that locally. I just think the programming experience is too uneven if you actually want to build poo poo, and not just mash together Wordpress plugins.

o.m. 94
Nov 23, 2009

Maluco Marinero posted:

PHP can do includes. However if you want a static site generator there are far better tools such as Jekyll and the like. If you want a dynamic website you're better off using a framework. The only benefit you get out of PHP is you can run it everywhere, but after that, after you need to do actual programming in it, there are more than enough inconsistencies in the standard library and edge cases in how it works that you'll be getting held back by minutia when you're trying to learn how to program.

I must have misinterpreted the argument, I was assuming that when we say PHP, we mean PHP frameworks and libraries as included. I can't argue that rolling your own solutions in pure PHP is at all sensible for anything that faces the outside world - although of course it has great pedagogical merit.

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India

fuf posted:

One random reason PHP is nice for beginners is that it's usually already on whatever server you're using in a "just works" kind of way, including cheap shared hosting packages.
I am not so sure about this argument.

Maybe it's valid for windows but on OSX/Linux it's piss easy to get something like a local flask server running (as opposed to setting up LAMP), you can literally have a hello world app in 2 minutes. And something like Heroku is both free (for hobbyists needs) and minimizes configuration hassle, though I guess you have to learn a bit of Git to be able to deploy, but that's pretty much a requirement in this day and age (at least some kind of version control) when compared to just uploading to an FTP server.

And when it comes to full blown frameworks, my experience is that there's a lot more hassle involved to get something like Laravel running when compared to frameworks like Rails/Django.

Workaday Wizard
Oct 23, 2009

by Pragmatica
=install visual studio [there is a free version]
=install python tools for visual studio [ptvs]
=make a new python project and add flask from the ide itself
=go to town

bonus: you get to use grown up autocompletion and debugging tools

fuf
Sep 12, 2004

haha

Gmaz posted:

I am not so sure about this argument.

Yeah that's fair. I am thinking back to my own early experience where the only exposure to the server I had was uploading files via FTP. In that situation it's nice to just rename index.html to index.php and oh hey, now it can do cool things. But I guess times have changed and even absolute beginners don't use FTP any more.

Thermopyle
Jul 1, 2003

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

o.m. 94 posted:

And pray tell, what incredible technical scope, from a simple header and footer, will this beginner be faced with that PHP cannot address?

None.

I wasn't claiming that.

kedo
Nov 27, 2007

Lotta people angry 'bout PHP in this thread.

fuf posted:

Yeah that's fair. I am thinking back to my own early experience where the only exposure to the server I had was uploading files via FTP. In that situation it's nice to just rename index.html to index.php and oh hey, now it can do cool things. But I guess times have changed and even absolute beginners don't use FTP any more.

This is a super fair argument. Anecdotally, almost every beginner I've met has had a web server they're playing with, just tossing up files to see what works. The idea of working locally and having all sorts of frameworks and servers running is very much not for beginners. I'm not saying it's wrong to start with something like Ruby or Python or what have you, but there's a difference between saving a text file and uploading it to a server and installing gobs of software through the command line, modifying a bunch of config files, and running terminal commands before you even know how to echo "hello world" onto a page.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Not really sure how to ask this but here goes...

In general when defining margins in CSS, should an element push away from an element above it? Or should an element push down the elements below it?

Wheeze
Jul 31, 2007

fletcher posted:

Not really sure how to ask this but here goes...

In general when defining margins in CSS, should an element push away from an element above it? Or should an element push down the elements below it?

I'm a great fan of the "lobotomized owl" pattern. It puts a space between adjacent elements, which is usually what you want.

kedo
Nov 27, 2007

fletcher posted:

Not really sure how to ask this but here goes...

In general when defining margins in CSS, should an element push away from an element above it? Or should an element push down the elements below it?

Doesn't matter too much as long as you handle it in an organized manner throughout a project. Default styles for most browsers (for typography at least) is to have margins on the top and bottom of elements.

Really this should be something you can answer by thinking about how you're going to use your elements. For example, if you have a banner div followed by a headline body copy and you want a ton of space between the banner and the headline, you could put a margin-top on the headline. However what happens on pages where you don't have a headline? Bad things. Therefore it probably makes more sense to have the margin on the banner.

mobby_6kl
Aug 9, 2009

by Fluffdaddy
Anyone who worked with google maps, is it possible to just get the jpeg tiles based on coordinates/zoom level through some sort of api? I basically want to do that to use them as textures in a webgl application.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Perhaps this gets you close enough? https://developers.google.com/maps/documentation/staticmaps/

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

neurotech posted:

Weren't you the same guy who was like "gently caress node" earlier in this thread? Either that or the front end thread, not sure.

What does Node have to do with anything?

Thermopyle posted:

I mean you might disagree that other languages are better, but someone disagreeing with you on that doesn't make them smug or idiotic. And this thread doesn't feel like a good fit for that argument.

I wasn't trying to specifically single anyone HERE out as being smug or idiotic about it, my point was more that I've seen that attitude before and it's not helpful to anyone. Your clarification makes perfect sense, and you're obviously not one of the smug idiots I was referring to.

putin is a cunt fucked around with this message at 02:00 on Apr 10, 2015

Thermopyle
Jul 1, 2003

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

The Wizard of Poz posted:

I wasn't trying to specifically single anyone HERE out as being smug or idiotic about it, my point was more that I've seen that attitude before and it's not helpful to anyone. Your clarification makes perfect sense, and you're obviously not one of the smug idiots I was referring to.

Oh ok, it was just that I think I was the only one who came out and said negative PHP things and then you said the smug and idiotic comment so I assumed....

Anyway, it's all good!

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
I'll preface this by saying I am a PHP developer. You can now ignore all the points I make as Stockholm syndrome.

PHPs original purpose was to fill a web-based void of "I want to do something simple.. why are all the tools so complicated".
The rise of PHP was because compared to everything else at the time it was easy to install, easy to learn and easy to use. The problem given by huhu is almost exactly what the original PHP was targeted at making super-duper simple, and as a beginners programming language it's one of the most forgiving and quickest to get a return on.

Thermopyle posted:

I mean, lots of places use it because of historical reasons, but it's a poo poo language and there's no reason to learn it if you're just wanting to learn something for self-improvement.

Maluco Marinero posted:

The only benefit you get out of PHP is you can run it everywhere, but after that, after you need to do actual programming in it, there are more than enough inconsistencies in the standard library and edge cases in how it works that you'll be getting held back by minutia when you're trying to learn how to program.
This is an argument consistently raised, but it simply isn't accurate, or at least nobody provided an example. Yes, there are a handful of idiosyncrasies (like the beloved types comparison table) which do cause problems, but these aren't things that are going to torpedo a newbie out of the gate, and some exist because of the original intention to not make things difficult for people trying to do simple poo poo.

PHP has come on leaps and bounds from where it started, and from where most other language programmers formed their negative opinions. It's active development as a language by the community ensures it continue to add features, and slowly deprecate outdated systems and approaches.

In my experience the only thing that makes a piece of PHP code lovely is a developer bringing the wrong approach to a problem. The only reason this is more prevalent in PHP is because a lot of people learned it as their first language, and never grew out of the easy procedural style they were no doubt self-taught. Some people take this as PHP being programmed mostly by people who don't know how to code, but that's only as a true as thinking every C# programmer knows what they're doing.

fuf posted:

I am thinking back to my own early experience where the only exposure to the server I had was uploading files via FTP. In that situation it's nice to just rename index.html to index.php and oh hey, now it can do cool things. But I guess times have changed and even absolute beginners don't use FTP any more.
This is still completely possible and plausible for a beginner to be doing. I can't speak for huhu but I don't expect he's deploying his HTML-only website over GIT via CodeShip or whatever.
It's precisely this ease of setup - "Just throw it on a server!" which brought PHP to popularity, and for a large part keeps Wordpress as popular as it is. In some regards this still makes PHP better than competitors when it comes to ease of setup.

Maluco Marinero posted:

you've still got to set up a LAMP stack for that locally.
XAMPP is an old favourite for just throwing down a LAMP stack on your machine. Add an extra 5 minutes to configure a hosts hack for easier development.
If you move beyond simple learning you'd probably want to set up Vagrant, maybe with something like PuPHPet to simulate an actual development machine, but the same would be true for Node, C#, whatever.

Maluco Marinero posted:

if you want a static site generator there are far better tools such as Jekyll and the like. If you want a dynamic website you're better off using a framework.
This I can agree with - you need to pick a tool suitable to the job you are trying to accomplish. This is true for absolutely everything you do, ever.

If you are learning for the sake of knowledge, I would encourage you to use whichever language had the lowest entry fee. I would rather you spend 2 hours programming than 2 hours trying to figure out what's wrong with some dependencies or configuration or port forwarding or whatever. If this means JavaScript in the browser console, so be it.
If you want a simple way of updating the header/footer of your hand-crafted site, Jekyll or some simple PHP would probably solve your problems.
If you want an easy to maintain CMS, I'd probably point you at Wordpress because it could hardly be easier to use.
If you want to learn PHP and build an application, I'd point you at Laravel and tell you to do the tutorials.

Thermopyle posted:

My strongly cautioning against PHP for this basic task has nothing to do with smugness or even my admitted idiocy, but with the observation that PHP is rarely the best tool for the job as opposed to merely sufficient...even when it seems like a good fit, outside factors like scope or goal creep often conspire against it.
I think the simple fact is PHP attracts inexperienced programmers because it's simple to learn and forgiving to use. It's not a very opinionated which leaves it open to stupid practices, which require a betterment of the programmer and not so much the language.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
I'll also add that a solid amount of the bad code you see produced is because of beginners that use tutorials written back when the mysql extension was the right way to connect to a database. The internet has a long memory and it tends to keep dumb stuff around for a long time. Modern PHP is every bit as powerful and elegant as Python even with its warts.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
I hate to interrupt this language chat, but does anyone know if it's possible for a single click to select all text in an input and have the copy/paste widget appear in iOS/Android? Calling .focus() and/or .select() highlights the field, but doesn't bring up the widget.

smithandweb
Feb 28, 2013

v1nce posted:

I think the simple fact is PHP attracts inexperienced programmers because it's simple to learn and forgiving to use. It's not a very opinionated which leaves it open to stupid practices, which require a betterment of the programmer and not so much the language.

This is so painfully true.

My Rhythmic Crotch
Jan 13, 2011

I have a coworker who likes to loudly wonder "why we can't use PHP" so I usually send a couple examples like this or this to get the point across. It might be the best thing ever, but there appears to be enough errata that I don't want to invest any time learning or using it.

Data Graham
Dec 28, 2009

📈📊🍪😋



And this. Is it unfair?

My Rhythmic Crotch
Jan 13, 2011

Dunno about unfair, but usually people say that article is too outdated to be relevant now.

Thermopyle
Jul 1, 2003

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

BitTorrent released a beta of their Project Maelstrom browser today as well as developer tools. In case you're not familiar, it's a system for delivering sites through the bittorrent protocol rather than the traditional client-server model.

There's about a .0001% chance of this being adopted in any sort of widespread manner, but it's cool technology anyway. I downloaded it an checked out some of the highlighted pages, and its pretty much transparent except for the fact that urls look like: bittorrent://e1516b2768604a46d0bded4960c85b8d48c39154/index.html and there's a transitional loading page that shows peers and whatnot.

no_funeral
Jul 4, 2004

why
Does anybody have a decent way of disabling manual scrolling for a page, but allowing scrollTo animations to scroll? Doing so via CSS doesn't allow scrollTo, and the methods I've seen to do so with javascript/jquery seem to allow specific types of scrolling for different devices.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
What's the purpose? You can set scrollLeft and scrollTop on an element whilst it is set to overflow: hidden.

That said though, locking natural scrolling without a good reason is one of the worst design trends of the modern era, so thats why I asked about the use case.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Sitting Bull posted:

Does anybody have a decent way of disabling manual scrolling for a page, but allowing scrollTo animations to scroll? Doing so via CSS doesn't allow scrollTo, and the methods I've seen to do so with javascript/jquery seem to allow specific types of scrolling for different devices.

Don't do this.

butt dickus
Jul 7, 2007

top ten juiced up coaches
and the top ten juiced up players
I'm working a minor mobile site for some of our techs who are on the road. The icons on my desktop site end up being way too small so I figured I'd just use HTML entities in place of icons. I have a few things that look like this:
HTML code:
<a>
<h1>&#128663;</h1>
<h3>Map</h3>
</a>
It looks fine when I preview it on a desktop browser, Android or Windows phone, but on an iOS device the entities are super tiny! Can I fix this or do I need to do something like make SVGs?
e:
Android

iOS

butt dickus fucked around with this message at 16:33 on Apr 13, 2015

nanerpuss
Aug 6, 2005

voudrais-tu une banane, mon amie?
Who is going to Drupalcon and if so, why the gently caress are you doing this to yourself?

Adbot
ADBOT LOVES YOU

Sereri
Sep 30, 2008

awwwrigami

butt dickus posted:

I'm working a minor mobile site for some of our techs who are on the road. The icons on my desktop site end up being way too small so I figured I'd just use HTML entities in place of icons. I have a few things that look like this:
HTML code:
<a>
<h1>&#128663;</h1>
<h3>Map</h3>
</a>
It looks fine when I preview it on a desktop browser, Android or Windows phone, but on an iOS device the entities are super tiny! Can I fix this or do I need to do something like make SVGs?
e:
Android

iOS


Looks like safari fucks up the font-size for some reason. Is it px or em based?

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