Wednesday, 28 January 2015

Why is PHP better than other programming languages

PHP was initially started as C Shells for the web programming and performing other small chores. But today it has evolved as an efficient and effective web programming language that is at the same time is easy to understand and implement. The extent of the popularity of the PHP language can be seen from the fact that most of the websites in today scenario are built on the PHP Frameworks. Even the most popular social networking website Facebook is built on the PHP frameworks. Now, here we are giving you some of the features of this language that has been inspired from the others languages like C, Java or Python. a. A successful product of the open source initiative which means that there is community support along with an extensive set of libraries that can be used to enhance the functionality of the language. b. Easily integrated with several other open source softwares and programs without requiring any extra plugins or libraries. The language provides in built support for Apache modules and MySQL and PostgresSQL database. c. A large and extensive support for the regular expressions that are used heavily for matching patterns and substitutions. You can perform a variety of string related tasks like compression, manipulations, etc. d. Support for the Raw HTTP headers that are frequently used in redirections, authentications and other high level site designs. e. Access logging support provides the real time access monitoring and maintains a quick summary of the pages that are owned and maintained by specific users. f. In built Access Control Mechanism will allows to create rules and regulations for different persons that are using your website or application. Some pages can be password protected while other can be made restricted based on the user accessing it g. Besides this the language has all the features that a modern language should possess. It has all the features of OOPS as well procedural languages

PHP v/s ASP v/s JSP – Quick Comparison:

The first and foremost feature that sets PHP apart from the other two is the community support. Being associated with the Open Source Initiative, PHP has a large user base of developers, testers, documenters and reviewers. ASP is based on the .Net framework that is owned outrighly by Microsoft. JSP is also gaining ground but it has a large way to go. It is also now an open source product. b. When it comes to the speed of the website then ASP is slightly ahead of the two. The main reason due to the existence of a compiler for interpretation of ASP code. JSP also uses precompiled and dynamically generated code. PHP is an interpreted language and uses no third party accelerators to improve on the performance. c. There are a lot of free and premium hostings for PHP. But there are only paid hostings for ASP and JSP. PHP and JSP can be run any kind of servers but the ASP.net requires only Windows based servers only. So php appears to be a better language and there are the highest no. of jobs in the field. But still it depends on person to person what he feels for a langauge.

10 Useful CSS Tips For Beginners

Cascading Style Sheets (CSS) is the style sheet used to define the HTML elements. This can be also applied to any kind of XML document, including plain XML, SVG and XUL. These styles are normally saved in external .css files. These external style sheets can save lot of your time while editing the layouts of all the pages in a website.
Here are some important and useful CSS tips and tricks that can be helpful for developers.

1. Use reset.Css

When it comes to rendering CSS styles, browsers like Firefox and Internet Explorer have different ways of handling them. reset.css resets all fundamental styles, so you starts with a real blank new stylesheets.

2. Use Shorthand CSS

Shorthand CSS gives you a shorter way of writing your CSS codes, and most important of all – it makes the code clearner and easier to understand.
Instead of creating CSS like this
It can be short-handed into the following:

3. Understanding Class And ID

These two selectors often confuse beginners. In CSS, class is represented by a dot “.” while id is a hash ‘#”. In a nutshell id is used on style that is unique and don’t repeat itself, class on the other side, can be re-use.

4. Forget <Table>, Try <Div>

One of the greatest advantage of CSS is the use of <div> to achieve total flexibility in terms of styling. <div> are unlike <table>, where contents are ‘locked’ within a <td>‘s cell. It’s safe to say most <table> layouts are achievable with the use of <div> and proper styling, well maybe except massive tabular contents.

5. CSS Debugging Tools

It’s always good to get instant preview of the layout while tweaking the CSS, it helps understanding and debugging CSS styles better. Here are some free CSS debugging tools you can install on your browser: FireFox Web Developer, DOM Inspector, Internet Explorer Developer Toolbar, and Firebug.

6. Knowing !Important

Any style marked with !important will be taken into use regardlessly if there’s a overwriting rule below it.
In the example above, background-color:blue will be adapted because it’s marked with !important, even when there’s a background-color:red; below it. !important is used in situation where you want to force a style without something overwriting it, however it may not work in Internet Explorer.

7. CSS @Import Vs <Link>

There are 2 ways to call an external CSS file – respectively using @import and <link>. If you are uncertain which method to use, here’s few articles to help you decide.

8. Typography Measurement: Px Vs Em

Having problem choosing when to use measurement unit px or em? These following articles might give you a better understanding on the typography units.

9. Understanding Media Types

There are few media types when you declare CSS with <link>. print, projection and screen are few of the commonly used types. Understanding and using them in proper ways allow better user accessibility. The following article explains how to deal with CSS Media types.

10. Keep CSS Codes Clean

We have some CSS that has snuck into our <head> section. This is a grievous foul because not only does it muddy our markup but it can only apply to this single HTML page. Keeping your CSS files separate means that future pages can link to them and use the same code, so changing the design on multiple pages becomes easy.