التخطي إلى المحتوى الرئيسي

Which should I learn: Python or PHP?


Technology, as a practitioner, is counter-intuitive.  This is perhaps the hardest concept for people learning to become technologists to understand.  It seems simple, but it affects so many things that will occur as you learn and grow your skill-set and build things.  The purpose in most cases of course is to build useful abstractions that make using technology feel intuitive to the end user, but as the practitioner you have to deal with the burden of this inherent lack of intuitiveness so that your users don't have to.  Keep this in mind for a moment, because it's a concept that will be important to my point later on.

When you go to design and build a new system perhaps the greatest thing to grasp is that every decision you make is based around determining what are acceptable trade-offs.  There's no panacea, and in most cases you'll be thinking through (hopefully, because you put thought into things) a series of problem statements and possible solutions which tend to follow the implementation form of "3 positive things, pick 1 or pick 2".  This is perhaps most obvious and well researched when it comes to distributed data storage systems, and things like the CAP Theorem (Consistency, Availability, Partition Tolerance, pick 2).  

With these things in mind, I'm just going to go ahead and drop the bomb.  Bad technologies do exist, and in many cases, they're bad because they attempt to make things easy which are not in any way easy or generally considered solved, and therefore encourage bad practices or hide critical problems.  PHP is a perfect example of this, MongoDB is another example of this.  There's hundreds of examples though that meet this criteria.  

Many of these bad technologies are very popular with beginners simply because they are easy to learn and work with.  The problem is, you will end up learning bad habits and putting trust in things which are not trustworthy.  This may not matter much when you're just futzing around on your own time to see how something works or try something new.  But the things you learn always end up coming back to you.  Your time is perhaps your most valuable asset, and how you invest it will determine many of the future choices you will end up making when you're professionally using those skills to build something.

Because, ultimately, technologies are tools, just because a technology is bad in the general case doesn't necessarily mean it should never be used.  But, it takes a significant amount of experience and expertise to adequately understand all the possible pitfalls of using a bad technology and whether or not those trade-offs are acceptable.  When you're in the stage in your career where you're still learning, this is not the time to throw away your very valuable time by investing in learning bad technologies.  You are much better off investing in learning technologies which are generally good, and ensuring you understand where all their skeletons are buried and what pointy edges exist, so that you can accurately and intelligently decide what trade-offs you're willing to make in your designs.

This is kind of the long-winded philosophical answer as to why I would say that under NO CIRCUMSTANCES should anybody choose to learn PHP as their first language.  While PHP is very easy to learn at a superficial level, it has a LOT of faults and gotchas that are not immediately apparent and are a direct result of it having a fundamentally bad language design.  These gotchas can be near invisible, because they may not even prevent your application from working, but they could lead to opening up serious remotely exploitable security vulnerabilities or create a ticking time bomb waiting for the right conditions to cause the application to crash.  This type of unpredictable behavior is extremely frustrating even when you understand what is causing it, but as someone who is learning it wastes your time and distracts you from learning a clear understanding of the abstract concepts involved.

The design of the core library for PHP (which is the basis of the entire language, since it relies heavily on "magic" which is handled by the interpreter) is completely brain-damaged.  While this article is not mine, I do consider it to be very well researched and pointedly accurate, although it is dated so some of these things have been fixed at this point, most still remain, and new failures have been added.  It's well worth the read if you want the nitty gritty: PHP: a fractal of bad design 

So, while I think there are many languages that are worth learning and I would consider a valuable use of your time to familiarize yourself with, I won't go into them.  Instead, I'll merely say that Python is an extremely sane, structured language, which is designed specifically to enforce good practices and help guide new programmers into understanding the proper way to build things.  Some of this is enforced in the interpreter, some of this is enforced in the community and the standards of companies and projects that use Python.  Either way, Python is an EXCELLENT first language to learn.  I highly recommend Zed Shaw's Learn Python The Hard Way which is available for free online at that link or can be purchased in paper for $30.

It seems unintuitive, as I've mentioned before, but the absolute best way to become a competent programmer, somebody who your peers look up to and rely on to be the person who can really solve problems, is to put a lot of effort in early on learning things the hard way.  Rather than picking heavily abstracted frameworks and technical tools that do a lot of heavy lifting for you, it's important to understand why those pieces of heavy lifting are being done and what is going on in the background.  I think Python is a great introduction to this, because it's abstracted enough to keep it from making you get dejected while learning, it provides immediate feedback because it's interpreted, but it also provides an easy sliding scale to get you into deeper systems understanding.  

After you become competent with Python, I think it is absolutely essential that you become at least passingly familiarized with C and x86 ASM (or ARM ASM if you are more interested in mobile and embedded devices).  This is not to say that you must be writing Linux kernel patches or optimized device drivers, although neither is a bad thing or a bad objective.  Rather, understanding lower level system languages will give you a significant boost in your understanding of how computers work and what the basic trade-offs are that were made in Python or any other language or framework you choose to use now or in the future.

There's no silver bullet and as technology continues to change and improve I have no doubt that there will be a need for you to continuously learn new things.  Don't start from a flawed foundation, learn the fundamentals in a proper way so you have the right knowledge to act as building blocks for a long time to come.  PHP cannot provide you this, but Python and many other languages can.



تعليقات

المشاركات الشائعة من هذه المدونة

تصميم الالعاب الالكترونية

100 مليار دولار هو حجم وناتج تجارة وصناعة سوق الألعاب الالكترونية دوليا، ليصبح هذا السوق في أهمية أسواق أي سلع استراتيجية أخرى .. مع انتشار الهواتف الذكية بصورة كبيرة و انتشار العاب و تطبيقات الهواتف الذكية اصبح هناك العديد من   الاشخاص يهتمون بتصميم العاب الاندرويد و الايفون  لذلك تقوم شركة لودكس بتصميم العاب اندرويد وايفون والالعاب الاونلاين والعاب الديسك توب بكل احترافية وبتصميمات رائعة وجودة عالية .    Game Developing           

أفضل برامج لصناعة الرسوم المتحركة

تعد صناعة أفلام الكارتون والأنيميشن من الصناعات الضخمة والمكلفة، إلا أن ظهور التكنولوجيا وكثير من التطبيقات تسهل من صناعتها كثيرا، مع توفير الكثير من الأموال التي يتم إنفاقها لعمل أفلام مميزة. وترصد فيتو 3 برامج لعمل أفلام أنيميشن 3D 1- برنامج Autodesk 3DS Max يتميز البرنامج بأنه سهل الاستخدام، وسريع، ويمكن من خلاله ابتكار شخصيات مختلفة ثلاثية الأبعاد، البرنامج غير مجانى إلا أنه يمكن تحميله للتجربة، أو الحصول عليه مجانا لمدة 3 سنوات في حالة كنت طالب، ويمكن تحميله من  هنا  2-برنامج Cinema 4D. ويتميز البرنامج بتوفير مجموعة واسعة من الإصدارات المختلفة، والتي تناسب كافة الاحتياجات وميزانية المستخدم، البرنامج سهل الاستخدام، ويوفر الكثير من الخيارات التي تمكن من عمل فيلم احترافى، ويمكن التحميل من  هنا  بعد اختيار الإصدار المناسب. 3- برنامج FlipaClip  وهو تطبيق خاص بالهواتف الذكية العاملة بنظام أندرويد، البرنامج سهل الاستخدام، التطبيق يقدم العديد من المزايا من طبقات الرسم، وجدول زمنى وأدوات مختلفة للرسم، ويمكن تحميله من  هنا  4- تطبيق Animation ...

Difference between virtual reality, augmented reality and mixed reality

Augmented reality and mixed reality are often used to refer to the same idea, however there are a few potential differences between the two depending on who you speak to. To some, it is semantics, while to companies like Microsoft, there is an important distinction between the two terms. The majority of mentions of augmented reality and mixed reality in the press right now refer to “mixed reality” as a synonym of “augmented reality”. Even experiences which could be under the umbrella of “mixed reality” are called “augmented reality” by the companies creating them. This is where things get confusing. “Mixed reality” is most commonly used by Microsoft to describe their HoloLens. The media often call it “augmented reality” to begin with, adding on in a rather forced sounding way — “or as Microsoft calls it, ‘mixed reality’”, followed by using the terms interchangeably throughout their articles. It is best explained by starting with the much easier definition of “virtual reality”: ...