Altabel Group's Blog

Posts Tagged ‘Java

Working with many startups I was wondering recently why Python and Ruby are so popular and common with young and promising startups, especially Scandinavian ones as my experience shows. I am curious if anyone has analyzed the trend towards Python over Ruby with startups? Also I would like to find out what are the advantages of Python over Ruby if they are so?

I think a lot about choices and decisions at startups. Picking the language/platform to use at a startup is one of the harder decisions. Here I would like to mention the fact that most of startups today make their choice toward Python or Ruby over PHP or Java. From what I have read, PHP is just an inferior language to Python and Ruby. Even though a lot of people are using PHP because it is easy to get started, it seems to be easier to develop bad habits with PHP. Why jump on a bandwagon when you obviously know is broken? I’ve come to realize that the main reason why PHP gets into trouble with the purists is that there are just so many ways of doing one thing — it is not that standardized. I think it became the most popular language only because it’s so easy to pick up!

Python/Ruby win over Java on speed of development, and conciseness of code. This generally makes Python/Ruby a better choice for small startups for whom speed to market, and ability to implement new features matters most. Most of the modern sites chose Python when they were small startups. Only later did they have to scale. Websites tend to be horizontally scalable, meaning that for a surprising range of volumes of traffic you can just throw more webservers at it and the bottlenecks will be at other layers (for instance the database).

Searching for relevant information to compare both Pyton vs Ruby languages and analyzing customers’ demand on the software development market I found out that Python appeared to be the more popular choice for startups trying to get a minimum viable product launched and seek out potential venture capital.

This has less to do with the merits of either language and more to do with the philosophies of the frameworks represented by either language. RoR really can’t be beat as a rapid application development framework, and developers discussing Ruby on the web are generally referring to RoR. Django purports to do the same, but the overall philosophy of the python community is more minimalistic – python developers generally prefer to make their own selection of tools such as ORMs, Persistency layers and libraries.  A lot of people start Python web development with Django but move on to something more minimalistic like Flask, simply because the community seems predisposed to building its own stack in this way. RoR is more opinionated, and developers who are more predisposed to hitting the ground running, especially in the startup field, often take the Ruby fork in the road.

There is a “coming of age” point for startups coming from RoR or PHP, however.  I’ve heard about several companies who had this exact same experience and ended up moving towards something like Python or Scala.  I’m not certain this is specific to python, but I can say that as startups grow and become more ambitious, they move into problem domains poorly represented strictly by web frameworks/languages.  Search features and data extraction increasingly rely on advanced data mining techniques utilizing things like natural language processing and find they need to reengineer their stack a little to accommodate new ideas. Increasingly I see companies not abandoning their RoR/PHP/Django frontends, but creating separate REST APIs that almost always use bare python or a JVM language to take advantage of more complex computation outside of the HTTP req/response model.  Ruby could be used for this kind of offline processing, but the toolkits are just better and more mature in other languages since RoR is so prevalent in the Ruby community and consumes a great deal of the mindshare.

The fact of the matter is that most web startups represent feature sets early on where development speed is the prime concern, and so the language/framework with the biggest potential hire base and best RAD features typically win out early on.

As my personal point of view that no single language can answer every problem satisfactorily, and it is foolish to stubbornly stick to a single language for every case. Nevertheless a lot of our clients stick to Python when starting up their business. Let’s try to see what are the advantages of Python over Ruby?

The two are more similar than they are different, in everything from design to disadvantages to common uses – you can’t really go wrong either way, and shouldn’t base your decision on syntactical differences.

As Ruby developers say, Python’s main advantage has nothing to do with the language’s features. It’s more subjective: it seems that Python has more momentum amongst serious computer scientists. It’s increasingly popular in academic and scientific applications, and a lot of the technologists I respect the most seem to prefer it. By comparison, the Ruby community feels more designer-y and relatively more novice.

What this means is that while the Ruby world has very slick out-of-the-box product solutions, the Python world seems to produce more exceptionally well-written components like Tornado (web framework). Combined with it being used at Google and the potential for stuff like LiveNode to be released as open-source, I’d cast my lot with Python if I were starting today.

Thinking Python may be the best choice of startups, what is your opinion on this?

Looking forward to hearing from you!

 

Polina Mikhan

Polina Mikhan
Polina.Mikhan@altabel.com 
Skype ID: poly1020
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: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Some people will argue that it’s not worthy comparing Tomcat and JBoss, because one of them is a superset of the other. In fact JBoss is bundled with a forked version of Tomcat. So JBoss is Tomcat plus:

* JMS messaging provider
* Web Services engine (JAX-WS and/or JAX-RS)
* Management capabilities like JMX and a scripted administration interface
* A powerful data grid solution (Infinispan)
* Advanced security, e.g. out-of-the-box integration with 3rd party directories
* A dynamic and powerful clustering engine
* Transaction management service

Still many decision makers have to choose between these two, so lets’ take a deeper look at them.

The JBoss AS is an application server based on Java. It is an open source server and is usable in any operating system supported by Java.

Apache Tomcat, or its more widely known name Tomcat, is a servlet container (meaning it is a Java class that operates under the strictures of the Java Servlet API – a protocol by which a Java class responds to an http request). This is an open source server, providing a ‘pure Java’ HTTP web server environment in which code written in Java is capable of running.

Tomcat is only a servlet engine and JBoss offers many more functionalities out of the box. Still JBoss is no longer a heavyweight monolithic container, but a modular application server featuring true classloading isolation, modules loaded on demand, domain management and exceptionally lightweight container. It has a pluggable architecture and if required, you can unplug features from JBoss to make it essentially a Tomcat servlet container.

At the same time the plus going in favour of Tomcat is that it is fairly lightweight, and it means less memory requirement and a faster response. At the same time if you need certain JEE features beyond the Servlet API, you can easily enhance Tomcat. For example, if you need JPA features you can include Hibernate or OpenEJB and JPA works nearly out of the box.

Tomcat is hassle free and might be the right choice when you are not using much of Java features. It is a very good fit if it comes to web centric, user facing applications.

In case backend integration comes into play, a JEE application server should be considered. Last but not least, migrating a WAR developed for Tomcat to JBoss should be a 1 day exercise.

Some people still argue that instead of using application servers, one can still deliver a full stack application using Tomcat + Spring adding the right frameworks and writing the Spring integration layer with these frameworks. That’s for sure true. Still the logical question is what price you will have to pay for that. The JBoss project can be focused around average – to junior developers. Mastering the same complex stack of technologies with Tomcat and Spring requires skilled and well paid developers.

To make it short, Tomcat is merely an HTTP server and Java servlet container. JBoss is a full-blown JEE application servers, including an EJB container and all the other features of that stack. On the other hand, Tomcat has a lighter memory footprint (~60-70 MB), while JBoss weigh in at hundreds of megs. Tomcat is very popular for simple web applications, or applications using frameworks such as Spring that do not require a full JEE server. Administration of a Tomcat server is arguably easier, as there are fewer moving parts.
However, for applications that do require a full JEE stack (or at least more pieces that could easily be bolted-on to Tomcat) JBoss is one of the most popular open source offerings. JBoss has a larger and deeper user community, and a more mature codebase.

So, we should not really care anymore about which is better, but focus on the application requirements. However, you can still use the best of these two worlds in your enterprise applications.

It would be great if your could share your opinions on this topic :) Thanks in advance for your comments!

Aliona Kavalevich

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

Scala is a statically typed and multi-paradigm programming language that runs on Java virtual machine and provides Java like syntax with a few improvements.

Being a multi-paradigm programming language, Scala allows for mixing multiple programming styles such as object oriented, imperative and functional programming. Whether it’s good or not, it is not a question that could be answered with a yes or no. Supporters would say that programmers can choose from a variety of styles and stick to the best depending on their needs. The others would argue that putting together some features found in many other programming languages can’t work well, mostly by increasing complexity and making a programming language obscure.

Scala code compiles to a byte code and runs on Java virtual machine, thus it is compatible with other Java applications. If most of your code and libraries are from Java world, this can be nothing but a good thing. At the same time some additional complexity in Scala is dictated by assuring compatibility with Java.

For some developers the Scala code is obscure, for others could be a nice and neat form of solving some specific problems.

One more positive aspect of Scala is its conciseness. We all know how Java verbose is and how many boiler code developers write everyday including constructors, getters, variable initialisation (type and generics), semicolons and many others.

Now let’s see some other aspects of working with Scala:

Performance
At first sight the performance in Scala is very good, comparable to Java. Scala code compiles to the same byte code as Java does and runs on the same Java virtual machine. Still how fast Scala code is may vary from case to case and usually it’s up to the way how the code is written. The awareness of how to write a high performance Scala code is especially important for Java developers who are not very experienced in both Scala and functional programming.

Tools
There are not too many development tools created specifically to serve Scala, but fortunately, thanks to compatibility with Java it doesn’t look so bad. One family of tools hardly usable in Scala are those, which do some sort of code analysis, for instance code coverage and static code analysis. Static code analysis tools are even less usable.

Language extensions
The two worth to mention native Scala extensions are Lift web framework and Akka actors platform.
The majority of libraries and frameworks from a Java world, should be possible to use quite smoothly, which among other things, is thanks to implicit conversions in Scala.

Interoperability
Interoperability between Scala and other programming languages, including Java/C/C++, is very good, mostly because of running on Java virtual machine. What Java may talk to, Scala can do as well. Taking into account support for implicit conversions described above, I would state that Scala is one of the leaders of interoperability among all programming languages.

Testing
Developers are provided with all they need to test Scala applications efficiently. To follow a Test Driven Development methodology, they can use popular in Java world Junit tool. If someone is more keen on Behaviour Driven Development then ScalaTest is a way to go.

Monitoring and maintenance
One of the main monitoring tools to analyze production Scala applications is JMX (Java Management Extensions). This tool does its job well when we want to analyse some predefined statistics, but sometimes we need to investigate some aspects of a production application while it’s running and JMX can’t provide all required data. To deal with such scenarios, Java provides Java Virtual Machine Tool Interface (JVM TI) that allows for inspecting running Java applications but it can be used for Scala too.

Support
Scala community, including forum, mailing list and blogs, is not the biggest in the world, but it’s very energetic. Most people who are part of a Scala community are very passionate developers, which are always happy to help others to solve their problems. Books are also great: Programming in Scala book by Marting Oderski, Lex Spoon and Bill Venners.

Scala skills
No one will argue that it is far behind other programming languages such as Java or C/C++. Still while looking for Scala developers we could search for Java developers with Scala interests as well. The learning curve is not massive as Scala follows Java syntax. In such case, at least on experienced Scala developer would help the team adopting new programming language.

Have you moved from Java to Scala? How do you find this language?

Thanks for sharing your opinion!

Aliona Kavalevich

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

Few people engaged in software development sphere would deny the popularity of Spring. As many would agree, it is not just what is called “one more framework” and it still preserves its popularity till now.

In this article let’s try to discuss why it is so popular and why use it. So let’s focus on the major advantages of this open source application framework for the Java platform.

Following are some of the major benefits offered by the Spring Framework:

* Spring Enables POJO Programming. Spring enables programmers to develop enterprise-class applications using POJOs. With Spring, you are able to choose your own services and persistence framework. You program in POJOs and add enterprise services to them with configuration files. You build your program out of POJOs and configure it, and the rest is hidden from you.
* Spring Provides Better Leverage. With Spring, more work can be done with each line of code. You code in a more fast way, and maintain less. There’s no transaction processing. Spring allows you to build configuration code to handle that. You don’t have to close the session to manage resources. You don’t have to do configuration on your own. Besides you are free to manage the exceptions at the most appropriate place not facing the necessity of managing them at this level as the exceptions are unchecked.
* Dependency Injection Helps Testability. Spring greatly improves your testability through a design pattern called Dependency Injection (DI). DI lets you code a production dependency and a test dependency. Testing of a Spring based application is easy because all the related environment and dependent code is moved into the framework.
* Inversion of Control Simplifies JDBC. JDBC applications are quite verbose and time-taking. What may help is a good abstraction layer. With Spring you can customize a default JDBC method with a query and an anonymous inner class to lessen much of the hard work.
* Spring’s coherence. Spring is a combination of ideas into a coherent whole, along with an overall architectural vision to facilitate effective use, so it is much better to use Spring than create your own equivalent solution.
* Basis on existing technologies. The spring framework is based on existing technologies like logging framework, ORM framework, JEE, JDK timers, Quartz and other view related technologies.

So you can’t but deny the fact that using of Spring framework gives you a number of advantages. Some consider it a kind of standard for enterprise Java development. The others would argue. You are certainly free to agree or disagree or choose it or not or which parts of it you want to use and which are useless. But the fact is that it may be rather effective and give you some benefits.

And what is your opinion of Spring framework? What do you see as its advantages? Please help me to make a list of them longer!:)

Thanks for your attention! Wait for your comments!

Kind regards,
Yuliya Tolkach – Business Development Manager (LI page)
Yulia.Tolkach@altabel.com
Altabel Group – Professional Software Development


%d bloggers like this: