Altabel Group's Blog

Posts Tagged ‘C#

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: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

This time as a part of cross platform development I’d like to make a short review of Mono project’s implementations/frameworks – MonoTouch and Monodroidthat allow creating applications using .NET framework and languages.

MonoTouch is a framework that allows developers create iPhone applications using the compilation of C# and reusing the existing .NET source code, libraries and skills.
The MonoTouch includes:
• Mono for the iPhone, iPad and iPod Touch
• C# and .NET compilers – on the iPhone you will need to compile the existing C# code and tools with the help of MonoTouch compiler to make sure that all the assemblies are referenced.
• .NET Bindings to Native APIs – MonoTouch compiler turns to compile the .NET libraries and base assemblies to create native iPhone applications.
• Mac oriPhoneSDK -includes the Xcode IDE, iPhone Simulator, and a suite of additional tools for developing applications for iPhone, iPad and iPod Touch.
• MonoDevelop Integrationhelps developers to integrate all features/toolsets from the integrating.NET platform to the target iPhoneenvironment from zero in no time
• Libraries that bind the native CocoaTouch APIs – toolsets that help to create native application interfaces for iPhone, iPad and iPod Touch

Mono for Android (MonoDroid)is a software development environment kit that allows to create the applications that run on Android phones and tablets.
Mono for Android consists of the core Mono runtime, the Mono for Android bindings to the native Android APIs, a Visual Studio 2010 plug-in to develop Android applications and an SDK that contains the tools to build, debug and deploy your applications. The Visual Studio 2010 plug-in allows developers to use Visual Studio 2010 to develop, debug and deploy their applications to an Android simulator, an Android device, or the Android Application Store.

What’s new?

Being the customer of Mono product you get one-year subscription to its product updates. The updates engaged the bug fixes and API changes. You could check the latest updates for Mono on the website called Xamarian Developer Center following this linkhttp://docs.xamarin.com/.
One of the latest upgrades released in May of 2012 by Xamarian Mono for Android is considered the research project called XobotOS.
XobotOS – the attempt to put C# code in the place of removed Java code in Android operating system. The idea is to write native code using C# instead of Java seems to extend the opportunities of Mono project. As the developers say the transition from Dalvik to Mono virtual machine performed good results like high-performance and low-battery consuming. Sharpen was chosen as the tool convertor for porting million lines of Java code to C#. It was upgraded for XobotOs and presented as its part release. The next goal of the company isto provide the direct access to the graphics library Skia for building applications.

What is the pricing?

Monotouch/MonoDroidare available in Professional Edition and Enterprise Editions: Monotouch/MonoDroid costs $399 for the entry level Professional edition and $999 and $2,499 for the Enterprise and Enterprise Priority version. A trial version is available which isn’t time limited but only allows deployment to an iPhone simulator.

Summary

The development of applications using cross platforms development approach seems to give the right idea for the developers how to manage with different environments and languages. Having reviewed the Mono project frameworks the advantages both of them may be summed up as follows:
- Applications written in C# for Android (MonoDroid) could be easily ported to iOS (MonoTouch);
-The source code written on C#, could be reused in MonoDroid and MonoTouch;
- The full support of C#: Language Integrated Query (LINQ), delegates, lambdas, events, garbage collection and many other features
- The support of Visual Studio and XCodefor bothMonoDroid and MonoTouch
- New challenges and updates guides

If you know something about programming with MonoTouch/ModoDroid and you have anything to add to my review, please, feel free to share your thoughts and experience on this point.

Best regards,
Katerina Bulavskaya
Altabel Group – Professional Software Development

Before you read the article I would like to notice that it’s just a subjenctive opinion :-)

So, what is PHP4 and ASP.Net? ASP.NET – is not a continuation of ASP, but is conceptually a new Microsoft technology, created as part of ideology. NET. Key stakeholders of .NET are scalability, cross-language interaction and shaky concept of “safe programming”.

PHP is conversely an open and free technology. Of course, it would be wrong to decipher PHP as Personal Home Page today, but we still can hear echoes from the past to these days. PHP is a scripting language, created exclusively for dynamic HTML output. This does not mean that it is impossible to create a major project, this means that a large project for PHP is expensive and difficult.

Programming in PHP does not require an expensive programming environment. It would be enough a textbook to learn how to write more or less workable scripts. But it doesn’t work with ASP.NET. There is nothing to do without Visual Studio, MSDN and sometimes access to internet. Most part of time anovice developer spends on studying MSDN. By that time when he have learnt heaped model of classes and all the necessary functions, Microsoft probably will come up with something new. But if you could learn it…

Using ASP.NET with Visual Studio it looks like to work with Delphi. The main languages ​​in which applications written in ASP.NET are Visual Basic.NET and C #, respectively, are the heirs Visual Basic и Java/C++.Theoretically, under ASP.NET, you can write programs in any language for which there is a corresponding compiler. However, in practice, to create ASP.NETapplications are mainly used Visual Basic.NET and C #. “Native” environment of ASP.NET is IIS, running Windows. And yes, IIS is not known as the most stable web server, and Windows – is not the most stable operating system.

ASP.NET does not suit for small projects, and even more – for a few triggered groups that do not require precise control. The causes are many – from the high cost of the platform and ending with the complexity of the model classes.NET. When you collide with .Net you could think who could understand and learn it all? But then you understand – nobody. The credo of .Net is not to go to own business, write your module, learn its functions, know your place – this principle works fine in the collective .

In the ideology of Microsoft a programmer is a small cog in a well-established mechanism, singles have never been considered. Thus large projects accrue for .Net.

Thus there are no places for PHP programmers in such projects. Why? Because they will require a lot of coordinators, who must be paid. Most part of coordination in .Net takes over itself. PHP technology is fundamentally different from ASP.NET. PHP resembles a mixture of C and Perl with a little spice of Basic and Pascal. But ASP.Net looks like a classic

PHP4 trusts developers so much and there are no types, to declare variables is not necessary. PHP syntax is made for a quick and simple solution of common problems. The entire responsibility of dangerous stunts belongs to the programmer, what in particular leads to the widespread phenomenon, as the discovering of serious errors in the code one month after delivery of the project. The sphere of PHP is not large, it is small projects, which developed by either one specialist or a closely work group . As PHP is free the language has become an ideal choice for SMB or copyrights

Speed. Theoretically, ASP.NET must run faster as we deal with once compiled binary code, whereas PHP-scripts are re-processed each time. However, PHP work on IIS and Apache with a great load (although artificially induced) and always produces better results than ASP.NET even better then .ASP classic.The ligament PHP + MySQL + Apache works better and faster than ASP.NET + IIS + Microsoft SQL Server 2000.

Does it mean that ASP.NET is worse? I don’t think so. The speed is assured that all PHP applications run in a single address space, when ASP.NET checks and double checks the data repeatedly, keeping each application in a separate address space.The first pproach is faster but less reliable, the second – is more reliable, but there is a price. Unfortunately miracles do not happen L.

About work . Briefly describe the feeling to work with PHP it is constant process of debugging this is to the fact that the language contributes serious logical errors.

Even primitive typo (highlighted in red) leads to a logical error, which would not be in C# in principle. In general, there is not any declaration of variables in PHP, which is a big minus.

Also as a rule, updating version of PHP on the server is a headache for customers and programmers. Sometimes it is very difficult to find a mistake, especially if it appears only under certain circumstances, so that it could be never revealed to the delivery of the project. It is strength and weakness of PHP. When you plan in C# and write different classes , interfaces for collections to create a page in one fell swoop for ten minutes then. In PHP you could create the page several. Still every next page is created in 10 mins on ASP.Net when in PHP you would spend the same time again and again.. If you need to change smth on the page visually, you would need 5 mins in ASP.Net, but in PHP you would need look for and change HTML.

Thus small and medium projects are fate for small groups of PHP programmers; when medium and medium and large – the inheritance of large groups, using products of Microsoft, and giant projects share between HP, IBM, Sun, Oracle, and prices are too higher, but this is another story J

Thus in conclusion I would like to notice at the beginning pace of ASP.Net development should fall sharply, then grow steadily and eventually stop at a certain level, whereas the opposite is true in PHP.

Thank you for your attention!

Kind regards,
Elvira Golyak – Business Development Manager (LI page)
Elvira.Golyak@altabel.com | Skype ID: elviragolyak
Altabel Group – Professional Software Development

Windows Azure is Microsoft’s cloud-based application platform for developing, managing, and hosting applications off-site. Azure consists of several components: the cloud operating system itself; SQL Azure, which provides database services in the cloud; and .NET services. Below we’ll look at the reasons to consider using Windows Azure as your cloud computing platform.

Familiarity of Windows
Azure is based on Windows, so you can write applications in the same programming languages you’ve used for Windows apps: Visual Basic, C++, C#, etc. This makes it easy for organizations to find developers who already have the skills to create applications for the Azure platform. And due to the fact that the Azure environment is much like the standard Windows environment, it’s easier to develop a cloud version of an existing Windows application.

Scalability and flexibility
Using Azure, you can easily create applications that run reliably and scale from 10 to 10 thousand or even 10 million users — without any additional coding. Azure Storage provides scalable, secure, performance-efficient storage services in the cloud. After you create a Web app, you can specify the number of processors for the application to use. If the application needs to scale up to meet growing demand, it’s easy to change the settings to use more processors. The “pay as you go/pay as you grow” approach lets you bring your new apps to market sooner and respond more quickly to changes in your customers’ needs.

Cost benefits and pricing model
Taking advantage of resources in the cloud allows you to decrease your costs for building and expanding your on-premises resources. You can also reduce the cost of IT administration because the hardware is being taken care of for you, off-premises. The cost of creating, testing, debugging, and distributing Web-based applications goes down because you have to pay only for the computer processing time and storage space you need at a given time.

Data center in the cloud
SQL Azure provides organizations with all the benefits of an enterprise-class data center without the hassle, headaches, and cost of maintaining such an entity. You get high availability and reliability with redundant copies of your data and automatic failover. No more worries about backing up data yourself.

Interoperability
With Azure, you can develop hybrid applications that allow your on-premises applications to use cloud services, such as the cloud database and storage services. Communications services work between on-premises applications and the cloud, as well as mobile devices. Azure supports open standards and Internet protocols, such as HTTP, XML, SOAP, and REST. There are SDKs for Java, PHP, and Ruby, for applications written in those languages, and Azure tools for Eclipse.

Security
Knowing that security is one of the biggest concerns for companies considering a move to the cloud, Microsoft designed Azure with security in mind. The .NET Access Control Service provides a way to integrate identities, and Security Assertion Markup Language (SAML) tokens are used by applications to determine whether a user is allowed access. Microsoft has designed its compliance framework to meet regulatory requirements.

As you can see Windows Azure is an open and flexible cloud platform that gives you possibilities to create, deploy and manage applications and services affectively.

What do you think about this platform? Do you have anything to add?

Natalia Kononchuk

Natalia Kononchuk
Natalia.Kononchuk@altabel.com
Skype ID: natalia_kononchuk
Senior Business Development Manager (LI page)
Altabel Group – Professional Software Development

Mobile apps and HTML5 are two of the hottest technologies right now, and there’s plenty of overlap. Web apps run in mobile browsers and can also be re-packaged as native apps on the various mobile platforms. With the wide range of platforms to support, combined with the sheer power of mobile browsers, developers are turning to HTML5 as a “write one, run many” solution. But is it really viable? There are still compelling reasons to go native, and clearly, many developers are indeed going that route.

1. We can divide mobile functionality into two dimensions: the experience of the app itself, and the way it hooks into the device’s ecosystem, e.g. for Android, this would be features like widgets and notifications. In terms of app experience, native apps can do more.

2. It’s true that many in-app features are simply beyond reach for an HTML5 app. No matter how hot your web skills are, if your app is stuck in a sandbox with no camera API, it won’t be taking snaps anytime soon! Making a hybrid – native plus web – app is hardly an ideal solution. It adds complexity and applies only to web apps wrapped as native apps, rather than traditional websites accessed from a mobile browser. But it mightn’t be necessary for long. Web standards are evolving rapidly, and modern mobile browsers are keeping pace. Offline storage, geolocation, canvas graphics, and video/audio playback all enjoy widespread support among modern smarpthones, for example. Even camera is starting to be supported — as of Android 3.1, it’s possible to capture photos and videos using web standards. And the latest iOS browser supports WebSocket for 2-way streaming, as well as device orientation detection.
Overall, mobile is evolving. But the web is also evolving, and fast. Among desktop browsers alone, there are five major browser vendors evolving standards and adding features at lightning pace. While it’s not a trivial process to port these features to mobile, many of them have already made their way into the mobile browsers.
Native is a fast-moving target, but the web is closing the gap.

3. Native apps use robust programming languages (e.g. Java, Objective C, C++) which were designed for complex application development and have a proven track record. The APIs were designed ground-up to support the platform at hand. You can easily debug apps in desktop emulators which provide a close representation of the target device.
What makes web development particularly troublesome is the huge diversity of browsers and runtimes. When your app runs, it’s no guarantee feature X will be available. And even if it is, how will the browser implement it? Standards are open to interpretation. On the other hand Web is often easier to develop, especially if targeting multiple devices.

4. One of the defining features of any platform is its look and feel. Users come to expect controls to be presented consistently and manipulated in the same way. There are certain idioms which vary from platform to platform, e.g. what happens when the user performs a “long hold” (keep touching an element for several seconds)? Platforms have standard idioms for such things, and you can’t satisfy them all with a single HTML5 app.
Furthermore, platform look-and-feel is orchestrated by the platform’s native software library, whose widgets encapsulate the kind of look and feel users expect. You get a lot of the expected look-and-feel “for free” just by using the native toolkit.

5. App distribution mechanisms, like Android’s Market and Apple’s App Store, have been overwhelmingly popular in recent years and are a major driving force for the entire mobile industry. Any developer can submit their native app to the marketplace, where users can discover it through a combination of browsing, searching, and getting recommendations. Not only that, but if you’ve done your job right, the glowing ratings and comments will convince users to hit the all-important install button.

It would be nice to declare a winner here, but right now, there is no clear winner. Some apps are best suited for native and some are best suited for the web. The web stack arguably has more momentum, but in terms of capabilities and execution qualities, native apps are moving fast too. And unless there comes a time when web technologies are a first-class citizen on the majority of mobile OSs, native will always be an important consideration.

Kind Regards,
Lina Deveikyte
Altabel Group – Professional Software Development


%d bloggers like this: