Tuesday, February 27, 2018

Learn PHP / Ruby / Python?

I was browsing through few learning sites, forums and discussions – One prominent topic where everyone is trying to debate “Which is the best programming technology for web App” considering the current scenario of technology;  Unfortunately, choosing a programming language can be a major hurdle. It’s been a couple of weeks I was going the knowledge-base across and multiple discussion with people who worked on these. I'm sharing all the info I got in form of comparison. There are various aspects we need to consider before comparison and some many deny that comparison itself,  I just picked these three because of the popularity and trend of these three across the industry.

Now the entire comparison will provide you clarity on 3 points:
  • History and background
  • Why it’s used
  • Advantages and Disadvantages

In the conclusion will share my views on what's best for you to use or learn

A brief background, along with advantages and disadvantages - rather I call benefits and limitations 


PHP
Ruby
Python

server-side scripting language
server-side web application framework
Interpreted high-level programming language for general-purpose programming
Introduced by
Rasmus Lerdorf
David Heinemeier Hansson
Guido van Rossum
First released  / appeared in
1995
2005
1991
Background
Developed as a personal homepage tool
Evolved from the  project management tool “Basecamp”
As a hobby, Rossum write an interpreter for the new scripting language he been thinking from a long time
Purpose
Create dynamic and interactive websites
Seamless database table creations, migrations, and scaffolding of views to enable rapid application development
Multi-paradigm programming language.

Current stable version
7.2.2 [Jan 31,2018]
5.1.5 [Feb 14, 2018]
3.6.4  [Dec 19, 2017]
Popularly known for
Fast and flexible
Dynamic, Imperative object-oriented programming language 
General Purpose Programming Language

Market Share

3.4%
2.5%
5.1%
Who is using it [in popular]
Facebook / Wikipedia
Twitter / Groupon
Google /YouTube
Usability
Follows classic approach
Extensively documented
Elegant, powerful and expressive
Most readable programming language
Learning curve
Easy to learn
Needs to know at least one or 2 programming language
Highly recommended for new programmers and simple syntax
Popularity
1
3
2
Performance


Consume less memory and high performance
Advantages or Benefits 
  • Free
  • Easy to learn
  • Provides extensive database support
  • Offers great number of available extensions and source codes
  • Allows execution of code in restricted environments
  • Offers native session management and extension API
  • Can be deployed on most web servers
  • Works on almost all OS and platform

  • Open-sourced
  • Works on multiple platforms
  • Can be embedded into Hypertext Markup Language (HTML)
  • A Very High-Level Language (VHLL)
  • Offers encapsulation of data methods within objects
  • Pure OOP (Object-Oriented Programming)
  • Super advanced string and text manipulation techniques
  • Can easily be connected to DB2, MySQL, Oracle, and Sybase
  • Scalable and big programs written in Ruby are easily maintainable
  • Clean and easy syntax
  • Ability to write multi-threaded applications with a simple API
  • Offers advanced array class
  • Able to write external libraries in Ruby or C
  • Better security features
  • It has a debugger
  • It has flexible syntax
  • Easy and quick to learn
  • Runs on multiple systems and platforms
  • Readable and organized syntax
  • Offers rapid prototyping and dynamic semantics capabilities
  • Easily construct applications by testing and importing crucial functions
  • Reusability through carefully implementing packages and modules
  • Object-Oriented Programming-driven

Disadvantages or Limitations 
  • Not suitable for desktop applications
  • Error handling is traditionally poor
  • Global configuration parameters can change language semantics, complicating deployment and portability
  • Objects are CallByValue by default, which is the opposite of most languages and catches lots of programmers off-guard
  • Generally considered to be less secure than the other programming languages
  • Learning it can be difficult
  • Lacks informational resources
  • Slower processing time (CPU time) compared to other programming languages
  • Development and updates are slower

  • It doesn’t really do multi-processor/multi-core work very well
  • Smaller pool of Python developers compared to other languages, such as Java
  • Absence of a commercial support point, even for an Open Source project (though this situation is changing)
  • Database access layer limitations
  • Reputed to be slower than languages such as Java



If we look at the TIOBE Programming Community index which provides the popularity of programming languages index - It shows Python, PHP, and Ruby in the first 10 trending programming skills across the industry. So popularity is almost the same for the three.

Let's look few highlights on each and then jump to conclusion 

PHP: 
  • Is the popular, so help is easily available
  • Syntax is very similar to C and C++, provides ease to developers in adaptation 
  • Works well with most popular online database MySQL and also with many RDBMS
  • It can run both on Windows / Unix servers
  • As it's fully object-oriented language helps to build large and complex web applications

Ruby:
  • Contains many ready-made plugins and modules, which allow developers not to waste time [Time-efficient]
  • Need to follow standardized file storage and programming conventions that keep a project structured [Consistent]
  • It's an open source framework distributed under the MIT license [Cost-effective]
  • It comes with inbuilt Minitest tool, which will help in expectation syntax, test benchmarking, and mocking.
  • Encourages TDD
Python: 

  • Contains numerous third-party modules that makes it capable of interacting with most of the other languages and platforms
  • Provides large standard library, many high use programming tasks have already been scripted into the standard library
  • It's free to use and distribute, including for commercial purposes.
  • Learning Ease and Support Available
  • User-friendly Data Structures:

As most programmers will agree, all three will do everything and there's no Good / Bad to choose. It always depends on what you want to accomplish. For example:


After so much excitement, I'm not telling you any groundbreaking rule. So like in the above picture it always depends on what the goals you are trying to achieve in the project or scenario you are with.  I'm a fan of Python because its been on the web since 1995 and is a powerful scripting language with simple syntax, it's also easy to learn and easy to write. On the other hand, it's slower because it is an embedded language, runtime overhead can be a problem in larger applications. Also deploying Python web applications isn’t as straightforward as it is in other languages like PHP. So, Always remember it depends on your development needs, the scale of your application, necessity of the customer and many other underlying factors to determine the language you need to use. When you bring all of these factors together it's a purposeful discussion on which language to choose or best. 

Feel free to add your points and views, Thank you!! 

Sunday, February 4, 2018

"Leaders Eat Last" by Simon Sinek



Another utter evocative and astute book for any person who wants to be a leader or a leader want to a better one, by “Simon Sinek”. It’s a definite book which “Inspires”. Examples of Bad leaders Vs outcome, Good leaders Vs Results in this books gives a clear understanding of what we miss in modern leadership traits.


His detailed flow of how four components of our biological body inhibit our acts in the context of teams and leadership:
  • Dopamine - Gratification, tied to addiction 
  • Cortisol - Fear, stress 
  • Oxytocin - Serving, being a part of 
  • Endorphins - Runner's High 

Going in detail on the topics where will be many takeaways for everyone and few which I liked are

  • Trust is the most important value in the organization. Building trust requires nothing more than telling the truth. 
  • The leaders of companies set the tone and direction for the people 
  • Customers will never love a company until the employees love it first. 
  • In a bad economy, employees need extra help, not the opposite 
  • Give authority to those closest to the information. Leaders' job is to have a vision, not authority. 
  • Managers look after short-term goals. Leaders look after long-term goals. 

How the principle of “Telling the truth” helped in creating a new business out of innovation: Readout from the book “Most people are familiar with Post-it Notes. But what most people do not know is how they came to be. Unlike so many companies that develop products by imagining and trying to build them—3M owes the development of Post-it Notes, and so many of its other products, to one simple thing: its culture of sharing. Spencer Silver, the scientist who is partially credited with the creation of the Post-it, was working in his lab at the Minnesota-based company, actually trying to develop a very strong adhesive. Unfortunately, he wasn’t successful. What he accidentally made was a very weak adhesive. Based on the job specs given to him, he had failed. But Silver didn’t throw his “failure” in the trash out of embarrassment. He didn’t keep his misstep a secret out of fear for his job or guard it closely in the hopes of someday profiting from it. In fact, the unintentional invention was shared with others at the company … just in case, someone else could figure out a way to use it. And that’s exactly what happened. A few years later, Art Fry, another scientist at 3M, was in church choir practice getting frustrated that he couldn’t get his bookmark to stay in place. It kept falling out of the page, off the music stand and onto the floor. He remembered Silver’s weak adhesive and realized he could use it to make the perfect bookmark! And that was the birth of what would become one of the best-recognized brands in history, with four thousand varieties sold in over a hundred countries.”


There are many more such examples in the book which will give a definite insight into what the “safety circle” is and how a leader should grow.


I consider this book as one of the best to be top of the shelves and recommend others too!

Happy Reading!!