Thursday 29 September 2016

Understanding the concepts of Functional Programming & Imperative Programming

Functional Programming

  • Functional programming is programming paradigm it's a style of coding in which most of the codes to be written in the from of functions.
  • In functional programming, we do everything with functions such as it takes something as input and gives an output. 
  • Functional programming is a form of declarative programming.
  • The functional programming paradigm was explicitly created to support a pure functional approach to problem solving.
  • Pure functional approach means a function that does not have side effects and also does not rely on the mutable state. In a simple word everything should reside inside the function such that when some change made to function it will have no side effects to the whole program. 
  • Easier testing and debugging. Because pure functions can more easily be tested in isolation, you can write test code that calls the pure function with typical values, valid edge cases, and invalid edge cases.
  • In functional approach, program flow control is based on Function calls, including recursion.

Advantages of Functional Programming

  • Bugs-Free Code
  • Efficient Parallel Programming
  • Better Performance
  • Better Encapsulation
  • Increase Reusability
  • Better Modularity
  • Increase Readability and Maintainability
  • Increase Testability
  • Robust & Reliable Code


Imperative Programming

  • Imperative Programming is one of the popular programming paradigms which executes a sequence of steps/instructions/statements in some order.
  •  In Imperative programming, you tell the computer what to do.Like "Computer , add x and y" or "Computer, do that do this" and the computer goes and does it.
  • An imperative language uses a sequence of statements to determine how to reach a certain goal. These statements are said to change the state of the program as each one is executed in turn.
  • In Imperative approach, primary flow control is based on Loops, conditionals, and function calls.
  • Examples of Imperative Programming are C, C++, JAVA etc.

Characteristics of Imperative Programming

  • Sequence of Statements.
  • Order of execution of Statements is very important.
  • They contain state.
  • They use both immutable and Mutable Data.
  • They can change state.
  • They may have Side-effects.
  • They directly change the state of Program.
  • They represent the state with Data Fields.

Example for both Functional and Imperative programming approach:


Imperative Approach:

A program to add a series of three numbers.

int total = 0;
int number1 = 5;
int number2 = 10;
int number3 = 15;
total = number1+number2+number3;

Functional Approach:

A program to add a series of three numbers.

int addSeries(int num1,int num2,int num3)
{
     int total = 0;
     int number1 = num1;
     int number2 = num2;
     int number3 = num3;
     total = number1+number2+number3;
     return total;
}

I hope by going through this simple example on functional and imperative programming approach will help you clear your doubts.

Tuesday 13 September 2016

Understanding the basic difference between Recursion & Iteration.

RECURSION

  1. Recursion - The process of calling a function by itself.
  2. Recursion uses selection structure.
  3. Infinite recursion occurs if the recursion step does not reduce the problem in a manner that converges on some condition.(base case)
  4. Recursion terminates when a base case is recognized.
  5. Recursion is usually slower than iteration due to the overhead of maintaining the stack.
  6. Recursion uses more memory than iteration.
  7. Infinite recursion can crash the system.
  8. Recursion makes code smaller.

ITERATION

  1. Iteration - these are loop-based repetitions of a process.
  2. Iteration uses repetition structure.
  3. An infinite loop occurs with iteration if the loop condition test never becomes false.
  4. Iteration terminates when the loop condition fails.
  5. Iteration does not use stack so it's faster than recursion.
  6. Iteration consumes less memory.
  7. Infinite uses CPU cycles repeatedly.
  8. Iteration makes the code longer.

Illustration of Recursion & Iteration:


Recursion Vs Iteration
Remember any recursive problem can be solved iteratively. But you can't solve all problems using recursion.

Friday 9 September 2016

Understanding Difference Between Static and Dynamic Websites.

Understanding Static Web Sites


  • A static website is stored on a server using HTTP server software
  • Client sends HTTP Request with a URL(Uniform Resource Locator)
  • Server locates and sends requested file as an HTTP Response
Static Websites Request-Response
  • The code & text for each Page is written out separately
  • Each Page is saved on the server, just like it is displayed
  • Changes must be made by hand in each Page's code

Understanding Dynamic Web Sites

Dynamic Websites Request-Response 
  • Application server is installed on the same server as HTTP server software
  • Client sends HTTP Request with a URL(Uniform Resource Locator)
  • HTTP Server dispatches request to application server 
  • Application server dynamically constructs HTTP response
  • Each websites Page does not actually exist anywhere
  • In one place is the look-and-feel/ layout of the website
  • In another place is the content of the website(text,photos)
  • When a user wants to see a Page, the server creates it on the fly  

As Dynamic Websites have more advantages than static one so most of the websites you are looking is a dynamic one.

To build a Dynamic Web Application the top three server scripting languages are:
  1. ASP.NETASP.NET is an open-source server-side web application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic websites, web applications, and web services.
  2. PHPPHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
  3. JSPJavaServer Pages (JSP) is a server-side programming technology that enables the creation of dynamic, platform-independent method for building Web-based applications. JSP have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.

Monday 29 August 2016

Let's know what are the difference between Programming Language & Scripting Language ?

There is a huge confusion among the beginners between Programming Language & Scripting Language. That's why I am going to share with you guys the proper concepts of these so that you can understand it easily.

Before knowing this let's first understand what is Compilation & Interpretation of a program.

To understand this please take a look at the below picture:

Compiled Vs Interpreted

  • Programming Languages(Compiled Languages)
As we know computers do not actually understand the code we write. We need need to translate our human-readable code to machine-readable code. Our code need to be translated into bits and bytes that can be executed by computers. This translation process is called Compilation. Languages that require compilation are called compiled languages. C,C++ and JAVA are compiled languages.

  • Scripting Languages(Interpreted Languages)
And In other hand languages that not require compilation are called scripting languages. PHP,Perl,Python and Ruby are scripting languages. Those languages rely on  our source-code all the time. Scripting languages didn't have compiler or a compilation process. Those languages used interpreters to translate our source-code to machine executable code. This translation process is called Interpretation.

 Programming Vs Scripting Analysis

  • Compiled Languages Vs Scripting Languages
  1. The main difference between compiled languages and scripting languages is Scripting Languages are not compiled and Programming Languages are compiled its that simple.
  2. Compiled programs run faster then interpreted programs because they are first converted native machine code.
  3. Compilers  read and analyze the code only once and report the errors collectively that the code might have,but the interpreter will read and analyze the code statements each time it meets them and halts at that very instance if there is some error.

If you have any doubt while understanding this concept please do comment below I will definitely reply. 

Sunday 28 August 2016

How One can Get Started with Android App Development.

To Start with Android App Development is not a big deal. Anyone who is familiar with coding and having a little bit of  programming language concept can start building there Android Apps.

Android is an open source and Linux-based operating system for mobile devices such as smartphones and tablet computers.Android was developed by the Open Handset Alliance, led by Google. Recently Google has launched there latest release Android 7.0, Nougat on August 22,2016. 

nougat
Android 7.0,Nougat
 So, the question come how to get Started ?
Android programming is based on Java programming language so if you have basic understanding on Java programming then it will be a fun to learn Android application development.
JAVA Programming

Otherwise I am listing some cool JAVA learning Websites, Books & Video Tutorials which can help you to learn JAVA concepts very well.

  • Websites
  1. Oracle-JAVA:Getting Started
  2. Javapoint
  3. CodeSope
  4. Udacity
  5. Codeacademy
  6. Tutorialspoint
  • Books
  1. Head First JAVA
  2. Java: The Complete Reference By Herbert Schildt
  3. Java 8 Programming Black Book
  4. Introduction to Programming in JAVA By Robert Sedgewick

  • Video Tutorials
  1. thenewboston Videos & Tutorials
  2. CaveofProgramming
  3. Programming-Knowledge

Now after you had successfully mastered JAVA concepts you can start learning Android quite easily.

Android Programming
Once you have learned Java, the next step is to learn how to use Java to create Android apps. For that you will need the Android Software Development Kit (SDK). The Android SDK provides all the API libraries and tools you need build an Android app. Google offers the Android Developer Tools (ADT) bundle which includes the SDK, a version of the Eclipse IDE with the ADT plugins, and the Android Platform-tools with the Android emulator.
Developing an Android app is more than just Java, you need to understand how the Android UI is constructed (using XML), and how to access the different Android subsystems. Google has a series of tutorials about Android development. The  Getting Started tutorial shows you the bare essentials of Android app development.

If you want to learn from some cool sites then you can follow:-

For Video Courses in Android you may watch these:



But as per my recommendation I suggest you may follow this video course which is given below:


                                Udacity - Developing Android App

I hope these information and links are might be helpful for you to build your foundation in Android.



Saturday 27 August 2016

Know 12 Sites That Will Teach You Coding for Free

These 12 places offer coding courses for free:

1. CodeAcademy

One of the most popular free places to learn coding is CodeAcademy. In fact, more than 24 million people have already learned how to code through this educational company’s engaging experience. At CodeAcademy, you can dive right in and take courses that teach you everything from HTML & CSSJavaScriptjQueryPHPPython and Ruby.

2. Coursera

Founded in 2012, Coursera has grown into a major for-profit educational-technology company that has offered more than 1,000 courses from 119 institutions. While you can pay for certain programs to receive a certificate, there are a number of free introductory programming courses in various specializations from universities such as the University of Washington, Stanford, the University of Toronto and Vanderbilt.

3. edX

EdX is another leading online-learning platform that is open source instead of for-profit. It was founded by Harvard University and MIT in 2012, so you know that you’ll learn about cutting-edge technologies and theories. Today, edX includes 60 schools. You probably can’t go wrong with the free Introduction to Computer Science from Harvard University.

4. Udemy

Founded in 2010, Udemy is an online learning platform that can be used as a way to improve or learn job skills. While there are courses you have to pay for, there are plenty of free programming courses, which are taught via video lessons, such as Programming for Entrepreneurs - HTML & CSS or Introduction to Python Programming.

5. aGupieWare

AGupieWare is an independent app developer that surveyed computer-science programs from some of the leading institutions in the U.S. It then created a similar curriculum based on the free courses offered by Stanford, MIT, Carnegie Mellon, Berkeley and Columbia. The program was then broken into 15 courses: three introductory classes, seven core classes and five electives.
While you won’t actually receive credit, it’s a perfect introductory program for prospective computer programmers.

6. GitHub

Sometimes, you need to recall a reference book when you’re stuck on a problem. That's GitHub. You can find more than 500 free programming books that cover more than 80 different programming languages on the popular web-based Git repository hosting service, which means that it’s frequently updated by collaborators.

7. MIT Open Courseware

If you’ve already learned the basics, and went to get into something a bit heavier -- such as exploring the theory behind coding -- take advantage of MIT’s free courseware site that includes classes such as Introduction to Computer Science and Programming, Introduction to Programming in Java and Practical Programming in C.

8. Hack.pledge()

This is a community of developers, which include some high-profile developers such as Bram Cohen, the inventor of BitTorrent. There, you can perfect your programming skills by learning from some of the leading developers in the world.

9. Code Avengers

Based out of New Zealand, Code Avengers provides fun and interactive programming courses that will teach you how to code games, apps and web sites using JavaScript, HTML and CSS. Each course takes just 12 hours to complete and is available in English, Russian, Dutch, Spanish, Italian, Turkish and Portuguese.

10. Khan Academy

Created in 2006 by educator Salman Khan, Khan Academy is one of the original free online-learning institutions. With step-by-step video tutorials, you can  learn how to program drawings, animations and games using JavaScript and ProcessingJS, or learn how to create webpages with HTML and CSS.

11. Free Food Camp

Here you’ll learn HTML5, CSS3, JavaScript, Databases, DevTools, Node.js, Angular.js and Agile by networking and joining a community of professionals and students. You’ll even work together on your coding skills so that you can build apps for free. Here’s the catch: you’re learning those skills and building helps to help solve real-world problems. Code is available to nonprofits.

12. HTML5 Rocks

This Google project launched in 2010 to counter Apple’s HTML5. The site is full of tutorials, resources and the latest HTML5 updates. It’s open source, so developers can play around with HTML5 code. Because this is more advanced than most introductory courses, you may want to gain some knowledge and experience before jumping in.
Learning code used to require access to expensive books and classes, but no longer. I highly recommend that every entrepreneur learns to code. Still wondering if you need to code? Here is a programmer guide I put together to show you every step I took to become an entrepreneur that codes!

About TechyTalks

TechyTalks is basically a troubleshooting tips and tricks blog on several technical areas like PC, Laptop,Gaming Consoles,Programming Tips-(Android,JAVA,PHP,HTML5,CSS3),Networking Tips and much more you may say its a complete package.A bunch of stuff is here to help you.