Altabel Group's Blog

Archive for the ‘PHP’ Category

 

“Computer programming is an art, because it applies accumulated knowledge to the world, because it requires skill and ingenuity, and especially because it produces objects of beauty.”
Donald Knuth, 1974

 

It’s better to start your journey into the career of programming by answering the question “Do you really need programming?” This question does not apply to those, who majored in computer programming or was close to it. If at school you were good at math, if you like to spend a lot of time sitting in front of the computer, if you want to learn something new, then programming is for you. What is more, this area is now in demand and highly paid in the world, job vacancies for the post of programmers are always open. Isn’t it the best time to be a programmer?:)

Everyone knows that the future programmer should be able to think broadly and to present the project from different perspectives before its implementation and realization. Unfortunately, the machine does not understand a human language. Of course, I’m not talking about Siri and other voice recognition — I’m talking about the creation of new software. To create the calculator, the computer needs to be given the task in the same way as the foreman explains to workers how to lay bricks. That’s why you can’t do anything without understanding the programming languages. Well, first you need to decide what kind of programming languages we should start with.

And here everyone chooses a language which will be useful for him. It depends on the kind of products you are going to develop. Most of us studied Turbo Pascal at school, and it’s no news that this language is practically not used anymore. So, if you want to join the team of programmers in the nearest future, the choice of language should be made sensibly.

Among the most popular programming languages in 2016 are Java, followed by C languages, then Python, JavaScript, PHP, Ruby, etc. It should come as no surprise that the more popular language is, the more chances you have to find work in the future. So, you’d better start with Java or C#, as these are the best paid and relatively simple learning languages of writing code. If you can’t cope with them, then you should try to learn Python. This language suits for quick and effective programming.

But if you have no programming experience at all you can start with something more simple for understanding. Good examples can be the basics of HTML and CSS.

Why? These two languages are essential for creating static web pages. HTML (Hypertext Markup Language) structures all the text, links, and other content you see on a website. CSS is the language that makes a web page look the way it does—color, layout, and other visuals we call style. Well, if you are interested in making websites, you should definitely start with HTML and CSS.

Let’s move to JavaScript. It is the first full programming language for many people. Why? It is the next logical step after learning HTML and CSS. JavaScript provides the behavior portion of a website. For example, when you see that a form field indicates an error, that’s probably JavaScript at work.

JavaScript has become increasingly popular, and it now lives outside web browsers as well. Learning JavaScript will put you in a good place as it becomes a more general-purpose language.

Some people also suggest choosing Python as the first programming language because Python’s program code is readable, first of all. You don’t even need to be a programmer to understand what is happening in the program. Due to the simple syntax of Python you will need less time for writing programs than in Java, for example. A huge base of libraries will save you a lot of strength, nerves and time. Large technology companies are working with Python: Yandex, Google, Facebook and YouTube. It is used for web applications, game development, software for servers.

Java can also be a good choice for a beginner. This language is more popular than Python, but a bit more complicated. At the same time, the development tools are much better designed. Java is one of the most popular languages for the backend development of modern enterprise web applications. It is used in Amazon, eBay, LinkedIn and Yahoo! With Java and the frameworks based on it, developers can create scaling web apps for a wide range of users. Java is also the primary language used for developing Android applications for smart phones and tablets. Moreover, after Java you will be able to work with low level programming languages.

PHP is one more popular language. The PHP language, along with databases (e.g. MySQL) is an important tool for creating modern web applications. Most of the sites developed on PHP are focused on a large amount of data. It is also a fundamental technology of powerful content management systems like WordPress. There are no normal imports in PHP, there are many solutions to one and the same problem. And it makes training more complicated.

 

 
The languages C and C# are a bit complicated for a beginner. But if you develop software for embedded systems, work with system kernels or just want to squeeze out every last drop from all available resources, C is what you need.

Ruby has begun to gain popularity since 2003, when the framework Rails appeared. Used widely among web startups and big companies alike, Ruby and Rails jobs are pretty easy to come by. Ruby and Rails make it easy to transform an idea into a working application, and they have been used to bring us Twitter, GitHub, and Treehouse.

Choosing a programming language may still seem challenging. It shouldn’t. You can’t go wrong. As long as you choose a language that is regularly used in technology today, you’re winning. When you are starting out, the goal is to become solid in the basics, and the basics are pretty similar across almost all modern programming languages.

Part of learning to code is learning a language’s syntax (its grammatical or structural rules). A much bigger part of learning to code, the part that takes longer and gives you more headaches, is learning to solve problems like a programmer. You can learn the grammatical structure of the English language pretty quickly; however, you won’t truly understand the language until you put that grammatical structure to use in a conversation. The same is true in programming. You want to learn the core concepts in order to solve problems. Doing this in one language is similar to doing it in another. Because the core concepts are similar from language to language, I recommend sticking with whichever language you choose until your understanding of the core concepts is solid. If you have a clear idea of your reasons for learning to program, and know exactly what you want to accomplish with your new coding skills, then you’ll be able to make the right choice.

How did you guys get into programming? What are the best programming languages for first-time learners?

Please, share with us your experience and opinion here below:)

 

Kate Kviatkovskaya

Kate Kviatkovskaya

Business Development Manager | LI Profile

E-mail:Kate.Kviatkovskaya@altabel.com
Skype: kate.kviatkovskaya
www.altabel.com

Over the years, PHP has evolved greatly and now it’s not just the most popular server-side scripting language but also the language used to build complex websites and web apps. The same could be told about its frameworks. PHP web frameworks have an ecosystem of their own in the world of web development. PHP frameworks are used to build websites and web applications of all sizes and complexity, ranging from small static websites to large scale complex enterprise content management systems.

Still there are different opinions on the question which PHP framework is the best, as some developers prefer performance, some prefer better documentation, some prefer lots of built-in functions, etc. Perhaps we should have a look at the frameworks depending how popular they are.

Different frameworks have been popular in different time. For instance, CodeIgniter framework remained the top choice for PHP developers from 2011 to mid 2014. However, later in 2014 a new PHP framework Laravel has gained its popularity and became the most used framework in 2015. Now in 2016 it is clear that the Laravel framework will remain at the top, due to the huge interest from developers and clients worldwide.

  1. Laravel

It’s already been said that Laravel is most famous PHP frameworks nowadays. It is very secure and have a lot of useful libraries like session, authentication, middleware, RESTapi and others are included in it. PHP developers choose to work on the Laravel framework because its large and gradually growing community and very good functionality. You don’t need to write more code because every basic and required code-blocks are pre-build on it. At the same time it’s mostly used by experts.

Features:

– Routing and middleware are the best feature of Laravel

– Laravel uses the blade template engine for generating various views

– Inherent Database Version control

– Built-in unit testing and simply readable impressive syntax

– Larger Community catering to thousands of progarmmers

  1. CodeIgniter

CodeIgniter is the second most popular web framework among PHP developers. It is a lightweight powerful PHP framework that provides simple and elegant platform to create full-featured web applications. Choosing CodeIgniter you get all the tools you need in one little package. It’s easy to understand and to extend.

Features:

– Develop using MVC pattern

– No PHP Version Conflicts

– Less Duplication of Code

– Most Active Online Community

– Cache Class

– Security and Encryption

– Little to no server requirements

  1. Yii

YiiFramework is the high-performance modern PHP framework. It attracts most of PHP developers due to its features like fast development, caching, authentication and role-based access control, scaffolding, testing, etc.

Features:

– Yii adopts the proven MVC architecture

– Yii allows developers to model database data in terms of objects and avoid the tedium and complexity of writing repetitive SQL statements

– With the help of Yii, collecting input extremely easy and safe

– Zero configuration required to let the task easier for you

– Thorough maintenance

  1. Cakephp

CakePHP is also popular among PHP developers due to its lightweight, simplicity, faster and require less code. It is easy to learn with fast and flexible templating. The built-in CRUD feature is very handy for database interaction. The framework also has various built-in features for security, email, session, cookie and request handling. It’s perfectly suited for commercial applications.

Features:

– MVC Pattern – Model support data handling, with the model class you can insert, update, delete or read the data from the database.

– ORM features, converting data between incompatible type systems in databases and object-oriented programming languages

– Proper class inheritance

– Easily extend with Components, Helpers, Behaviours, and Plug-ins

  1. Symfony

No doubt, Symfony is a stable and sustainable PHP framework. It is a flexible, scalable yet powerful. It has a huge community of Symfony fans committed to take PHP to the next level. Symfony has plenty of reusable PHP components that can be used like security, templating, translation, validator, form config and more. It’s easy to install and configure on most platforms and it’s database engine-independent.

Features:

– Based on the premise of convention over configuration–the developer needs to configure -only the unconventional

– Compliant with most web best practices and design patterns

– Enterprise-ready–adaptable to existing information technology

– Stable enough for long-term projects

No doubt, some of our readers will either agree, disagree or have other PHP Frameworks, which they consider the best. But that’s already nice that you’ve read this post and perhaps could contribute to it. So please feel free to add a comment or through light why this or that framework is so popular and why it should or shouldn’t be :)

Aliona Kavalevich

Aliona Kavalevich
Aliona.Kavalevich@altabel.com
Skype ID: aliona_kavalevich
Senior Business Development Manager (LI page)
Altabel Group – Professional Software Development

 

The competition in the server side programming department is getting tougher with each month, especially with the recent popularity of NodeJS. However let`s look how everything began.

PHP appeared about 20 years ago, in 1995 and ever since then it has been a number one language for back-end developers and has gathered a big community behind it. For a long time there wasn’t any good reason why not to use PHP: it`s rather easy to use PHP, it`s supported by the majority of hosting companies and it has become the most commonly used language in terms of number of websites powered by it.

NodeJS was created in 2009 and it was very unique to all the other back end languages. It`s an efficient and scalable software platform that can execute JavaScript code on a server. NodeJS uses event-loops rather than traditional threading, which makes it faster and less memory-intensive than traditional platforms. Thus the ability to use Javascript on both the client and the server and the ability of NodeJS to run asynchronously have undoubtedly lead to the rise of NodeJS and its popularity within developers and customers.

Of course, everyone has his own truth: one coder will praise the speed of NodeJS while the other will be devoted to the stability and long history of PHP. But let`s have a look at strong sides of both for you to decide whether to concern yourself with the so popular nowadays NodeJS or not.

PHP strong sides:

– Huge community and tons of materials for all programmers, from a beginner to an advanced coder.
– Deep code base. The most popular platforms for building websites (WordPress, Drupal, Joomla) are written in PHP. Not only are the platforms open source, but so are most of their plug-ins.
– Easy to find a hosting company. PHP has been the industry standard since the stone age and any hosting company still surviving is bound to be compatible with it. For Node.JS you still need to make a little research.
– Simplicity. PHP can be run inside of the same file as html.
– Speed of coding. For most developers, writing PHP for Web apps feels faster: no compilers, no deployment, no JAR files or preprocessors — just your favorite editor and some PHP files in a directory.
– Mixing code with content. You just open up PHP tags and start writing code. No need for templates, no need for extra files or elaborate architectures.
– No client app is needed. All of the talk about using the same language in the browser and on the server is nice, but what if you don’t need to use any language on the browser? PHP is a way out.

NodeJS strong sides:

– Speed. NodeJS is blazing fast compared to PHP. This is where Node really kicks assJ.
– Separation of Concerns. NodeJS separates fundamental components up giving a clear separation of concern across controllers / routes, models and views.
– New and fresh. It’s newer in comparison to PHP and has been developed by programmers who have full knowledge and understanding of modern web applications, from the server to the client, and that means more modern features.
– Modern syntax. Javascript isn’t perfect and it may drive developers crazy, but overall it’s a modern language that supports modern syntax such as closures, and you can easily extend Javascript and make any object configured to exactly how you need it.
– JSON. NodeJS is a powerhouse for JSON. Accessing SQL is possible and there’s plenty of plugins that make it possible, but JSON is the lingua franca for interacting with many of the latest NoSQL databases.
– Gridlock. NodeJS uses a callback structure to pass logic from one asynchronous call to the next meaning we never have to worry about spawning new threads or even considering the deadlock process. Almost no function in Node directly performs I/O, so the process never block which is a major implication for scalable systems.

That is a difficult decision when it comes up to decide which language or tool to choose. But NodeJS worth considering and it`s proved by the fact that Node is getting more and more popularity every day. And what is your opinion on NodeJS, is it the future of web?

Anna Kozik

Anna Kozik
Anna.Kozik@altabel.com 
Skype ID: kozik_anna
Business Development Manager (LI page)
Altabel Group – Professional Software Development

Building a website wasn’t so easy earlier as it is now. Fortunately the time has passed when you had to hand-code HTML and PHP scripts in order to get an easy and fully functional website. Now content management systems (CMSs) do most or all of the heavy lifting for site creators. There are a number of CMSs for serious site creators, but the most common for websites today are considered to be three open-source tools: Joomla, Drupal and WordPress.

WordPress is a free and open source blogging tool and a CMS based on PHP and MySQL. It got its start as a blogging platform in May 2003 and gradually evolved, first into a blogging system that let users add Web pages outside of the blog and then into a full-featured, popular CMS. Of the three most popular open-source CMSs – WordPress, Joomla and Drupal – WordPress is both the most popular and the fastest growing by far, according to Web technology tracker W3Techs.

Earlier anyone could hardly think of using WordPress as the blogging platform. But now the situation has changed completely. Every second site owner using a CMS chooses WordPress. But to be objective let’s see what the facts are that speak in favor of this star-CMS. And what are there against it?

WordPress Pros

* Open-source
It means you get access to its source code and can study, modify and improve it according to your needs. However, it doesn’t mean you can do anything at all with the code. WordPress is issued under GPL license, which restricts certain actions (like limiting access to the code for others etc).

* Installation doesn’t cost anything
However, you may need to pay for customization, app development, premium themes etc, but the basic installation is at no cost.

* Easy set-up
That’s not even advertised anymore. It is simple and it is also quick. WordPress is known for 5- minute’s installation time.

* “Friendliness” with users
What can be a better way to gain popularity among users that become friends with them? WordPress is well suited for all types of users, even those who had never suspected a site can possibly have a backend. If you are able to google WordPress site and register your account, if you know how to use a text processor, you’re sure to get well with your new WordPress blog or website.

* No problems with customization
With the number of free themes and plug-ins for adding functionality to your site bigger than in any other CMS, a user gets the rich choice of website appearance and features that don’t come by default. And their integration is usually as easy as installing WordPress itself.

* Community support
WordPress has the enormously big community of users – from new born WordPressers to seasoned pros. They do great job helping each other via community support forums and discussion boards. Apart from that, WordPress provides exhaustive documentation on every possible issue, to ease the life of its followers.

* Multisite feature
WordPress allows its users not to be limited with just one website or start every new site with the new WordPress installation. With Multisite feature that’s available with all versions starting from WordPress 3.0 you can manage your several sites within one admin interface. However, to use this feature successfully, you need to study the WordPress codex well and have certain administration skills.

WordPress Cons

– Insecure
The security of WordPress leaves much to be desired, as with majority of open-source software. The thing is, when anyone gets access to the code, it’s easy to find flaws in it and use them to get into a site. But it doesn’t mean you’ve got to buy the most expensive software, you just need to use the techniques to enhance the protection of your site integrity.

– Advanced theming/features
If you know no HTML and coding and are satisfied with the looks of your blog by just switching to a new theme – you’ll be fine. If you desire to start off by changing everything to your taste – you may be in need for professional help. As to adding more functionality to your site via various plug-ins, in most cases, the common ones work out great, but if you experiment too much with them, you may get stuck when one plug-in is not compatible with the other, some need upgrade and some require tweaking the code to work correctly.

– Maintenance Costs
Although considered one of the most affordable CMSs, WordPress still may require money to be running successfully. For example, you pay for hosting, if it’s not self-hosted, exclusive themes or plug-in development in case nothing free suits you.

WordPress: what to expect?

During 2012, WordPress didn’t undergo any major changes. There wasn’t much new in WordPress 3.4 except easier theme customization. WordPress 3.5 had a mildly different new theme, some media improvements and not much else. In contrast, WordPress 3.6, which is set for a release sometime in April-May 2013 feels like a big step forward. There’s a bold new theme and several useful new features.

• Twenty Thirteen:
Twenty Thirteen will be the new default WordPress Theme with increasing support for post formats. Unlike previous default WordPress theme this theme is going to have lots of bold colors and will be fully responsive.

• Navigation Menus:
Lots of beginners complain that WordPress Menu system is quite hard to understand. In WordPress 3.6 this navigation menu options have been simplified and it will become easier to create and manage Menus in WordPress.

• WordPress Post Formats:
In WordPress 3.6 there will be a new User interface for Post Formats and theme authors will also have access to template the individual functions to change the structured data.

• WordPress Auto Save:
There will be some great enhancements related to Auto Save function. Posts are now auto saved locally so if the browser crashes, the server goes down or internet connection fails you will not lose the post and you will be able to resume editing right where you left it.

• WordPress Post Revisions:
Upcoming WordPress version will be a better handler for your post revisions. The changes will be highlighted with different colors so you can modify the usual things easily.

• Post Lock:
WordPress 3.6 will have a better editorial feature built in called Post lock. It will allow the authors or website administrators to lock a post to kick other person out of the editing and gambling between posts.

No site or platform is perfect, but WordPress has so much to offer and is very easy to use. In my opinion, the advantages outweigh disadvantages and with new version of it things are only getting better. Do you agree? Are there any other pluses and minuses of WordPress that are essential in your opinion and that I didn’t mention in the article? I’m eager to see your comments:)

Yuliya Tolkach

Yuliya Tolkach
Yulia.Tolkach@altabel.com
Skype ID: yuliya_tolkach
Business Development Manager (LI page)
Altabel Group – Professional Software Development

When planning the application you have to choose the right programming language to make your application work appropriate. The choice depends on many factors you need to consider. Such as but not limited: you need to think over on what platform the application will run, how easily new features would be added to the existing platform, the code size, performance, support and community etc.

There are various web programming languages and selecting the right one makes a website function properly. In my article I would like to focus on three of them, so called three “P”: PHP, Perl and Python to answer which of these languages is the best one.

Let’s have a look at them and try to make a comparison analysis

PHP – is free of charge open source scripting language and widely used in web environment. The best advantage of PHP is that it is easy to learn and easy to use. It is flexible and used for developing from small websites to giant business and organizational websites. Most common are informative forums, chatting platforms, CRM solutions, e-commerce shopping carts, community websites, e-business, shopping carts.

In terms of efficiency it is executed by the server and server parses the code at its source, executes and send properly formatted html to the client computer. Therefore it increases the speed of PHP applications.
What concerns the advantage of running, PHP is multiplatform language and compatible with all operating systems and platforms.

Being open source language, a large group of PHP developers help in creating a support community, so it’s maintained and when bugs are found, it can be quickly fixed.
A lot of websites including such giants as Wikipedia, Yahoo!, Facebiook, Digg, WordPress and Youtube are written in PHP. The popularity of PHP is based on its simplicity and coding style that is quiet easy to understand.

Nevertheless, the simplicity in developing, precisely principle so called «structure is not important» in PHP has its reverse side, precisely it’s hard to maintain for large applications since it is not very modular.

Also it’s weak in terms of security since its open source, all people can see the source code, and if there are any bugs it could be used to explore the weakness. About 30% of all vulnerabilities listed on the National Vulnerability Database are linked to PHP. The last summary on vulnerabilities you may find following the link: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-0427

Perl –refer to all purpose languages. Perl was developed as a text editor for converting or processing large amounts of data for tasks such as creating reports. Nowadays it intended improvements and suited for web development, game programming, GUI development, popular among system administrators etc.
The Perl reusable code structure provides flexibility in apps development and at the same time creates the problem of code reading after. As there are so many ways to do, there are a lot more ways to mess up in what you’ve done. If the code was written without proper care, the reading could even take 6 months.

So from one hand Perl is a good language for small programs because of its messy syntax structure it’s hard to write and maintain large programs. On the other hand if you’re planning to develop big web application you need to consider good coordination between developers work on discussing the code stile, mentoring and managing work in the team.

In terms of portability Perl code doesn’t use system specific features, so can be run on any platform.
Among popular websites created on Perl could be named bbc.co.uk, Amazon.com, LiveJournal.

In respect of vulnerability Perl takes the second place – 9.4%. I assume that it’s not bad taking into consideration its complexity and its long history.

It has fallen out of popularity lately a bit because of the slow development of Perl 6. Most people still use Perl 5.

Python – is considered to be very elegant programming language. It’s general purpose, high level programming language. On the one hand Python’s syntax and semantics are minimal; on the other it has complex standard libraries.

Python supports multiple paradigms: object-oriented, imperative and functional programming styles and has features including fully dynamic type system and automatic memory management.

In comparison with Perl Python is easy to read language. And its key idea is vice versa “there should be one—and preferably only one—obvious way to do it”. It means that the code written by one developer could be easily developed and supported by the others. Besides to delimit blocks Python uses whitespace indentation, rather than curly braces (C, C++, ….) or keywords (Delphi).

Python is often used as a scripting language, but is also used in 3D animation (Maya, Softimage XSI, Blender) and image editors (GIMP, Inkscape, Scribus, Paint Shop Pro). It was also used for writing several video games.

Python is actively used by Google, Yahoo!, CERN and NASA. But it has problems with popularity, precisely with spreading. The reason is that it’s less simple than PHP. Working with Python you need to learn numerical libraries. So that’s why some people prefer choosing PHP instead of Python. But only the betrayed ones could explain why they choose Python, the answer is easy the development on Python is faster on 30% and his vulnerability consists only 0.67% against 36% of PHP.

Conclusion

PHP at first sight seems to be a leader in this so called comparison race. It’s simple, easy to learn and efficient for building small and middle size websites. Going further with analysis in terms of scalable large system it turns out that here Python will perform better than PHP. The reason is in readability that makes Python easier to maintain and extend. Besides, Python is object-oriented. PHP is not. Moreover, Google supports Python with its Google App Engine where web sites can be hosted on Google’s server for free. What concerns Perl, analysis showed that it’s simple programming language with cross platform running and open source modular architecture that provides to develop interesting things. If the task is to perform administration scripts Perl is much better to use here than PHP.

After the analysis it follows that the choice any of three P is a good choice. Also it means that for a certain purpose there is a right tool to choose. Besides the analysis showed that all three “P” have in common the following:

• are cross platform;
• have open source code;
• have well written documentation;
• have large user communities;
• extend libraries and big amount of code written;
• have high-level frameworks (PHP – Symfony, php.MVC; Python-Django, CherryPy, Pylons; Perl -Catalyst, CGI::Application, Gantry);

So I hope that summary based on technical analysis we made could help to make a right decision in future web projects you might have.

Thank you for your attention and if you have anything to add, please feel free to leave a comment.

Katerina Bulavskaya

Katerina Bulavskaya
Katerina.Bulavskaya@altabel.com
Skype ID: katy.bulavskaya
Business Development Manager (LI page)
Altabel Group – Professional Software Development

Debates about which programming language is the best are always hard and heated. Likewise, there’s no ideal language that works for all web application project requirements. Wikipedia is written in PHP. Gmail is written in Java. Python is number one choice of Google and YouTube. Ruby is used to create Twitter and Hulu. Slashdot is written in Perl. Stackoverflow is written in C#.

Browsing for the best web programming languages, among dynamic ones, you’ll mostly see PHP, Python and Ruby listed. Back in the days several years ago PHP was admitted the best tool for web job but since then both Python and Ruby have matured and grown robust libraries and frameworks around them that make them better candidates for many web projects now.

Today many consider PHP to be great for average everyday web systems. Python and Ruby are thought to be more suitable than PHP for most web applications in general and for more advanced things in particular. Just like PHP, they are free, open source, run on an open source stack (Apache and Nginx / linux, windows and BSD), and play well with any database engine. However, Ruby and Python have better syntax and they both enforce good programming habits by their nature, especially Python. PHP encourages sloppy spaghetti code by its nature. Also, the object oriented features in PHP are very ugly because of its arcane, retarded syntax.

Let’s get deeper insights into these two web programming languages from various standpoints:

As mentioned before, Python and Ruby are two of the most popular dynamic programming languages used in high level application development. In fact, Ruby was built using some of the design elements from Python. Developers often prototype using these two languages before implementing on compiled languages because of their modularity and object oriented features. Many use Python or Ruby instead of Perl as simple scripting languages. Python and Ruby are popular among web developers as well because of their rapid development cycle, with Python boasting computation efficiencies and Ruby boasting code design.

a/ Philosophy
Python really believes that code readability is the most important thing. Hence, there is one-true way of writing code, or as it has been reformulated lately: “There’s a most understandable way to do something and that is how it should be done”. Python is designed to strongly emphasize programmer productivity and it likes things to be structured, consistent, and simple. Python syntax enforces strict indentation rules; in fact, indentation has semantic meaning in Python.
Ruby believes in giving programmer the flexibility, freedom and power. It was designed, first and foremost, to make programming fun for its creator, with guiding concepts as follow: “The Principle of Least Surprise” and “There’s more than one way to do the same thing”. The latter philosophy principle inherited from Perl is the reason why many Ruby methods have alternate names, which may lead to some API confusion among new practitioners. However, this flexibility enables Ruby to be used as a meta language for describing DSL. Also Ruby provides a better way to write concise and compact code. More into the expressiveness of the code and writing code that is clever.
Python people like libraries to be transparent and obvious how they work and hence is easier to learn, while Ruby people tend to provide clean and pretty interfaces with “magic” behind the scenes. This makes development very fast when you understand the magic, but frustrating when you don’t.

b/ Ease of Use
Python is known for its ease of use. It allows beginners to start building powerful sites more quickly, and has the power to grow in complexity keeping its ease of comprehension. For example, one of the hardest parts of coding is going back to what you coded long ago and trying to remember the logic of it. Because Python uses natural language with white spaces and indenting, it is much more clear and easier to read than languages like Ruby. That makes it easier to fix mistakes or do updates. Also, there are literally thousands of pre-built modules that can be snapped on to let you get up and running on the web immediately. Its intuitive introduction to object-oriented coding concepts, such as communities, modules, and libraries, allows you to move on to other related programming languages as they develop.

c/ Object Oriented Programming
Both Python and Ruby support object oriented programming. Still Ruby’s object orientation is considered to be more ‘pure’ in that all functions exist inside a class of some sort. Python’s object orientation is more akin to that of C++, which allows functions and statements that exist outside of classes. In Ruby, even global variables are actually embedded within the ObjectSpace object. Python doesn’t have global variables, instead using attributes of module objects. In Python and Ruby, an instance of literally any type is an object. However, where in Ruby all functions and most operators are in fact methods of an object, in Python functions are first-class objects themselves.

d/ Syntax
Ruby includes several syntactic features which make dynamic extension of and higher-order interaction with external (library) code more straightforward. In particular these are blocks and mix-ins. Most things implementable with block and mix-in syntax are also achievable in Python, they are simply less syntactically natural and clear, and so less commonly form the centerpiece of major libraries or common styles of programming. These features, combined with a lighter-weight syntax with fewer restrictions (whitespace flexibility, optional parentheses, etc), make Ruby more suitable to pervasive and relatively transparent use of metaprogramming.
At the same time, while this flexibility and the Ruby community’s tendency to use it for metaprogramming can facilitate aesthetically pleasing code, they can also create stylistic variation in how the language is used, and obscure the mechanisms by which code actually works. Python’s more restrictive syntax is intentionally designed to steer developers towards one canonical “pythonic” style to improve accessibility and comprehension.

e/ Style
Ruby code is organized into blocks, with blocks starting with various constructs and ending with the keyword “end”. Python code is indentation-sensitive, with successively larger indentation meaning tighter (nested) scopes. Python’s syntax has been described as executable pseudocode.

f/ Functional Programming
Both languages support some functional programming constructs, but Ruby is arguably better suited to a functional programming style. Lambdas in Python are generally very short, because lambdas in Python are restricted to expressions and cannot contain statements. Ruby’s lambda support is far more flexible, allowing for lambda expressions of arbitrary length.

g/ Speed
The standard CPython implementation is generally regarded as executing code slightly faster than Ruby.If speed is really an issue for a Python project, you also have the option to use Cython, Pyrex,Pypy (JIT) or the ShedSkin tools to compile your code into C or C++.

j/ Features
Both Python and Ruby are high level application development languages. Each of them is estimated to have a Capers Jones language level of at least 15. Both languages promote test driven development.
Both languages have full Unicode support, although the way that support is implemented varies. Python distinguishes between “Unicode strings” and “byte-strings”. Ruby, on the other hand, treats all strings as byte-strings with a semi-hidden flag which causes problems when dealing with badly-encoded data from third-party sources.
Both Python and Ruby support multithreading. Python has the Global Interpreter Lock (GIL), which negates much of the potential advantage of using threads; Ruby has a comparable Global VM Lock (GVL).
There are a number of functions that are available by default in Ruby but for which in Python it is necessary to import a module from the standard library. Python supports generators and generator expressions.

k/ Community
There are great communities behind both frameworks. Some people believe that Python has a more developed community in terms of libraries suited for data analysis, machine learning, natural language processing, scientific libraries. As for community folks, Python ones are believed to be conservative and afraid of change, while Ruby guys welcome changes and love new shiny stuff even if it breaks older things. Consequently, Python world is more stable, and you can update your installation without much troubles, but that also means new technology is only added very slowly.

l/ Frameworks
There are a number of Web frameworks based on both Ruby and Python. The most notable and leading are Ruby on Rails (Ruby) and Django (Python) based on MVC. Django is more declarative, with it you’ll have a clearer understanding of what’s actually going on. It lets you specify most configuration details yourself. Django creates a much simpler project structure. On the other hand, the centerpiece of Rails’s philosophy is called convention over configuration. Rails provides you with more defaults.

m/ Popularity
Python is generally more widely used than Ruby, according to most measures, but in the wake of the rising popularity of the Ruby on Rails Web application development framework Ruby’s popularity too has seen rapid growth.
Python is more mature general purpose nature vs Ruby’s more niche (Rails) usage. Python is stronger and sees use in automating system administration and software development, web application development, data manipulation, analyzing scientific data (with help of numpy, scipy, and matplotlib modules), biostatistics, and teaching introductory computer science and programming. Ruby+Rails holds a slight edge over Python+Django for web development and sees use in general programming, and has more mindshare.
In terms of cloud deployment, Python can run on Google-Cloud (Google-App engine). Though Ruby has very strong cloud deployment options in the shape of Heroku and Engine Yard.

Would you prefer Python or Ruby over PHP for implementation of your web project? And is it indeed a philosophy that you chose while selecting between Python and Ruby? Interested to hear your thoughts.

Helen Boyarchuk

Helen Boyarchuk
Helen.Boyarchuk@altabel.com
Skype ID: helen_boyarchuk
Business Development Manager (LI page)
Altabel Group – Professional Software Development

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

When selecting a web application framework for a particular development project, it’s very important to compare and consider the advantages and disadvantages of the different frameworks that are available. With so many PHP based web application frameworks, it can be difficult to choose one. For this blog post I’ll be focusing on a very promising PHP based web application framework Kohana.

Kohana is a PHP 5 framework that uses the Model View Controller (MVC) architectural pattern. It provides a rich set of components for building web applications. Its main purpose is to be safe, simple and easy to use, and so it is.

A little of history

Kohana was created as a branch of the PHP framework CodeIgniter. It was originally known as the Blue Flame. The main reason for “splitting” into two separate projects was a shift to a more open to the public development model due to the fact that many people were unhappy with the speed of development and fixing errors in CodeIgniter. Rick Ellis – creator and owner of CodeIgniter – was happy to see a fork of his project, but refused to help. He pushed a new project to create its own documentation and advised to rename the project. In July 2007 Blue Flame was renamed into Kohana to avoid copyright problems in the future. Developers began to look through the dictionaries of Native Americans to select a word that doesn’t violate copyright rights. Finally the name “Kohana” was chosen which in Sioux language means “swift”, which is absolutely true about this framework.

Why Kohana is an awesome framework

Although Kohana reuses many common design patterns and concepts, there are some things that make Kohana awesome and stand out. These are the most important of them:

1. Quick and easy development process. Kohana is really a very fast framework. With it you may build applications easily and quickly. There are many common components such as translation tools, database access, code profiling, encryption, validation, and more. Extending existing components and adding new libraries is very easy. While benchmarking a framework is hard and rarely reflects the real world, Kohana stands out as it is very efficient and carefully optimized for real world usage.

2. Community manageability. What is great about this framework is that it is community, not company, driven. Kohana development is driven by a team of dedicated people that need a framework for fast, powerful solutions. There exists a very active community forum and IRC (Internet Relay Chat) channel means that most questions are answered very quickly. Moreover, as it uses the BSD license (permissive free software license), you can use and modify it for commercial purposes.

3. A simple routing structure. Kohana has an excellent routing mechanism with which we can manage different kinds of URLs. For a URI, the routing mechanism will search for the first matching rout and the remaining will be ignored.

4. Kohana is OOP framework. It means that everything is built using strict PHP 5 classes and objects. It offers many benefits such as visibility protection, automatic class loading, overloading, interfaces, abstracts, and singletons.

5. Simple and effective debugging and profiling tools. Kohana has very simple and effective debugging and profiling tools that help to identify and solve performance issues very quickly.

6. No code generators and endless configuration files.There are no code generators and endless configuration files, so setting up is fast and easy.

7. Extremely lightweight. Kohana has no dependencies on PECL extensions or PEAR libraries. Large, monolithic libraries are avoided in favor of optimized solutions.

8. True auto-loading of classes. True on-demand loading of classes, as they are requested in your application. There are no namespace conflicts. All classes are suffixed to allow similar names between components, for a more coherent API.

9. Cascading resources offer unparalleled extensibility. Almost every part of Kohana can be overloaded or extended without editing core system files. Modules allow multi-file plug-ins to be added to your application.

10. Customization potential. Kohana has powerful event handler. Observer-style event handlers allow for extreme levels of customization potential.

To sum it up, Kohana is really an excellent framework because of many nice features incorporated in it. It is more scalable, flexible and light weight than many other well known frameworks. It is very fast, very efficient and carefully optimized for real world usage. So if you are looking for a feature rich, flexible, fast and sensibly configurable PHP framework, then look no further than Kohana.

Thank you for attention! As usual, please feel free to share your thoughts in comments.:)

Yuliya Tolkach

Yuliya Tolkach
Yulia.Tolkach@altabel.com
Skype ID: yuliya_tolkach
Business Development Manager (LI page)
Altabel Group – Professional Software Development


%d bloggers like this: