Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Terry Chay:
Which has better packages, Python or PHP?
Sep 13, 2018 @ 15:27:50

Terry Chay has an interesting post on his site that wonders which language has better packages - PHP or Python?

It depends on the target utility. In the Python world, the most common package installer is pip; the PHP world didn’t settle on a dominant format/installation for packages until composer, and that was relatively recently (last 4 years).

[...] So which has better packages? The answer is it depends on the domain. In nearly any language you can find an adequate package for any of your needs, but overall you will find the packages are higher quality, more up-to-date, and sometimes just better overall in the domain the language seems to target well.

He starts off by talking some about PHP and Python's origins - PHP as a web-focused language and Python as more general purpose - and how this influenced their package implementations. He then shares his opinions on which kind of packages are a more natural fit for which languages:

  • for data science/AI/ML applications, Python
  • for DevOps, relying on other tools (Puppet/Chef/Ansible/etc) is better
  • For server-side web-based packages, I feel PHP and Composer [are the solution]

He also includes some thoughts about other languages - Ruby, Javascript, Go - and their own package managers.

tagged: package manager python comparison opinion usage

Link: http://terrychay.com/article/which-has-better-packages-python-or-php.shtml

Algotech Solutions:
Converting to another web framework: Basic apps in Symfony and Django
Mar 08, 2018 @ 17:19:34

On their Medium.com site Algotech Solutions has a post that does a side-by-side comparison of two web applications frameworks from two different languages: Symfony in PHP and Django in Python.

Many times have I heard the following from a developer: “I am scared to change technologies”, “I am excited but I’m afraid it will be entirely different”, “I only know , I’ve never seen any code in my life!”. Sounds familiar? This article will show you that different web frameworks are not in fact that different.

With the advent of open source software, modern frameworks have inspired each other in adding and improving features for easier and more efficient usage. I will try to explain the abstract notions under MVC Web frameworks and how you can easily implement them through any framework and programming language needed.

The article then walks through the basic setup and creation of a web application in each, going through:

  • Installation
  • Generating the sample application (Jobeet)
  • Configuring the controllers and views
  • Creating the view output

All of the code and command line calls are included in the post too. If finishes out with an overview of the similarities between the two frameworks and briefly mentions some of the differences (like when it comes to model handling).

tagged: framework convert symfony python django similarities application tutorial

Link: https://medium.com/algotech-solutions/converting-to-another-web-framework-basic-apps-in-symfony-and-django-f55332030c44

KillerPHP.com:
PHP vs Python in 2018?
Nov 27, 2017 @ 19:43:35

On the KillerPHP.com site there's a new post that compares two popular languages - PHP and Python and tries to answer the question "Which one should I learn?"

One question I get often, is which programming language should you learn? I’ve been getting this question for years!

Things change in the programming world, languages come and go. But the good news is that the basics, the core concepts and techniques, are 90-95% the same in all the modern programming languages. [...] What that means, is that your programming language choice, isn’t nearly as critical as you’d think. Why? Well, once you know one programming language, it is easy as apple pie to switch to another!

He then gives some of his own thoughts about how you could decide which language you should pick including the kinds of programming (target result) and what kinds of jobs you can get with each.

tagged: python language comparison select jobs programming

Link: https://www.killerphp.com/articles/php-vs-python-in-2018/

Gonzalo Ayuso:
Playing with Docker, Silex, Python, Node and WebSockets
Jan 03, 2017 @ 15:47:19

Gonzalo Ayuso has a new post to his site sharing some of the results of his work combining Docker, Silex, Python, Node and WebSockets, discovering how to create a complete platform with these tools.

I’m learning Docker. In this post I want to share a little experiment that I have done. I know the code looks like over-engineering but it’s just an excuse to build something with docker and containers. Let me explain it a little bit.

The idea is build a Time clock in the browser. [...] Yes I know. We can do it only with js, css and html but we want to hack a little bit more. The idea is to create: a Silex/PHP frontend, a WebSocket server with socket.io/node [and a] Python script to obtain the current time.

He then starts in on the code, first creating the WebSocket server in Node then the Python script that makes an internal request to get the time and return it. Then the Silex route is created to serve up the template for the page and the code it uses to connect back to the websocket. The post ends with the Docker configuration he used to create the Docker environment all of this lives in.

tagged: docker silex python node websockets tutorial environment

Link: https://gonzalo123.com/2017/01/02/playing-with-docker-silex-python-node-and-websockets/

Davey Shafik:
The Syntax of Tech Communities
Jun 07, 2016 @ 18:18:43

Davey Shafik has an interesting post to his site sharing some of his views on the "syntax" of different programming communities - PHP, Ruby, Python and Perl.

In my (almost) three years of being in a developer relations type role I have attended events in several communities and have observed how they differ from my primary community (PHP). As I’ve tried to understand those differences and the reasons behind them, I have had many discussions with members of many more communities also.

After attending my first PyCon (US) I was struck by just how welcoming and diverse the community is and had many conversations trying to understand why this is. This is not what this post is about. This post is about conferences specifically, and how communities place different priorities on different things when it comes to how they run, organize, speak at, and attend events.

He talks about conferences - both attending and speaking at them - and how the situation differs from community to community. He did some background research on why things are they way they are and how that has influenced the overall focus of the community.

tagged: syntax community tech perl ruby python conference

Link: https://daveyshafik.com/archives/69985-the-syntax-of-tech-communities.html

Matthew Weier O'Phinney:
Automating GitHub Pages Builds with MkDocs
Feb 01, 2016 @ 16:49:57

In this new post to his site Matthew Weier O'Phinney details the process they (Zend) used to create the documentation for the latest release of their Expressive PSR-7 compatible framework (now in v1.0).

One of the final tasks in prepping for the Expressive 1.0 release was setting up the documentation site. We'd decided to use GitHub Pages for this, and we wanted to automate builds so that as we push to the master branch, documentation is deployed.

The process turned out both simple and bewilderingly difficult. This post is intended to help others in the same situation.

While they decided on MkDocs for the actual document generation (written in Python) Matthew how he integrated it with the builds they'd already created for the Expressive framework. He talks about reusability for the process, eventually using it again on the Zend Framework side. He also shows the full process for creating the resulting documentation and pushing it over to GitHub Pages including the setup of the credentials, which events should trigger the build and handling environment variables and software dependencies. It's a great post with plenty of details on each step of the process - I'd highly recommend it if you're looking into building these sorts of documents for your project.

tagged: github pages build travisci mkdocs python tutorial process

Link: https://mwop.net/blog/2016-01-29-automating-gh-pages.html

Reddit.com:
What great advantages does Python have over PHP?
May 08, 2015 @ 14:49:06

There's an interesting post in the /r/php subreddit asking the PHP developers out there a serious (non-trolling) question: What great advantages does Python have over PHP?.

All over I see people saying that Python is better than PHP, but as a programmer that has tried Python I don't see its great advantages. Can you guys please help me here.

There's already over 50 comments on the post with a wide range of answers including:

  • that Python is "more mainstream" in the world of *nix tools
  • the culture of Python's community for installing extensions
  • features Python includes like a "consistent API, sane error handling, keyword args..."

There's also an interesting "sub-discussion" happening around the sanity of Python's OOP system. Check out the full post for more or to voice your own opinion.

tagged: python language advantage opinion feature

Link: http://www.reddit.com/r/PHP/comments/357zlx/what_great_advantages_does_python_have_over_php/

Adam Bard:
The Same App 4 Times: PHP vs Python vs Ruby vs Clojure
Mar 27, 2013 @ 14:13:35

Adam Bard has written up a post that takes the same small application (a "Nurblizer") and writes it as a web application in four different languages - PHP, Python, Ruby and Clojure. His point is less about which is "best" but more to show the differences between them.

Here’s a toy program I wrote implemented in PHP, Python, Ruby, and Clojure. I hope it’s helpful for someone who knows at least one of those and wants to learn another. The program is called “Nurblizer”, and it does one thing: Accept free-form text, and attempt to replace all words but the nouns in said text with the word “nurble”. It’s up and running at http://nurblizer.herokuapp.com

He includes the source for each language's version using Sinatra for Ruby and Flask for Python but for PHP and Clojure it's just straight code. For each he briefly explains what its doing and a bit about how it relates to the examples from the other languages. He also points out a Hacker News discussion that's popped up about the examples.

tagged: flask python clojure ruby example nurblizer compare

Link:

Chris Hartjes:
Standards, Soapboxes, and Shamans
Jan 21, 2013 @ 19:16:47

In this latest post to his site Chris Hartjes shares some of his thoughts about the recently approved PSR-3 standard (for logging) and some of the reception that the other PSRs (PSR-0, 1 & 2) have gotten from the PHP community.

For those who pay attention to the workings of the PHP community you might have heard about the “PHP Standards Recommendations” that have been coming out of the PHP Framwork Interop Group. [...] More recently this group has been working on a standard for logging interfaces called PSR-3. I spoke about this on Twitter, and I will repeat it here: I think PHP programmers should get behind PSR-0 and efforts like PSR-3. I feel that PSR-1 and PSR-2 are solutions looking for a problem and seem, to me anyway, to me out of place with the solutions offered by PSR-0 and PSR-3.

He likens the PHP PSRs to the Python enhancement proposals (PEPs) and, more specifically, to the PEP-8 - their own version of "coding standards" that was highly championed by Guido van Rossum and put into wide practice.

Any programming language community that does not work as hard as possible to make it easier to integrate other’s libraries of code together [by standardizing their formatting] is asking for irrelevancy.
tagged: standards psr0 psr1 psr2 psr3 community feedback python pep

Link:

Gonzalo Ayuso:
Multiple inheritance with PHP and Traits
Dec 19, 2012 @ 19:17:48

Gonzalo Ayuso has a new post today showing how you can use traits in PHP to simulate a kind of multiple inheritance.

Multiple inheritance isn’t allowed in PHP. [It's not] possible with PHP (in Java is not possible either), but today we can do something similar (is not the exactly the same) with Traits. Let me explain that: Instead of classes we can create Traits.

He includes a code example showing the creation of two traits, "Base1" and "Base2", that are implemented (via "use") and the calls to methods on each. He also points out the error condition and message that can come up when there's a conflict in the method names between two or more traits. This is relatively easy to solve with the mapping ability of the "use" statement (code example included for that too).

tagged: multiple inheritance traits python example mapping use

Link:


Trending Topics: