Thursday, 30 August 2012

New Programming Languages in 2012



LanguageWho is behind it?Primary DriverLicensing
Red Hat - Home pageReadability, Predictability, Tool-ability, Modularity, Meta-programmability.Runs on JVMGPL v2
Cray - Home pageProgrammability of parallel computersRun on Cray supercomputers and various high-performance clusters.Portable to most Unix-style systems, Mac OS X and WindowsBSD
Rich HickeyHome pageConcurrency using Functional programming paradigm.Runs on JVM, CLR, and JavaScript enginesEPL
Google - Home pageA replacement for JavaScript on the browserFaster, easier to maintain, and less susceptible to subtle bugs.Dart VM needs to be compiled – can run on Linux, Mac and WindowsNew BSD
Microsoft - Home page
Multi-paradigm: Functional + Imperative + Object-oriented.Runs on CLR and Mono
Apache
Brian Frank, Andy Frank - Home pagePortability, support for functional programming and concurrency.Runs on JVM and CLR. Is also compiles to javaScript. Future targets might include Objective-C for the iPhoneAcademic Free License
Google - Home pageCompiled with the ease of programming of a dynamic language, concurrency and communication, speed of compilation.Compiler available for Linux, Mac OS X, WindowsBSD style + patent grant
Nicolas Cannasse - Home pageMulti-platform support.Compiler for JavaScript, Flash, NekoVM, PHP, C++. C# and Java support is expectedGPL v2
MLstateHome pageTargeted for cloud computing. Client-side UI, server-side logic, and database I/O are all implemented in a single languageRuntime environment own Web server and DBMS.Runs on 64bit Linux and MacAGPL
EPFLHome page
Scalability for multicore and distributed computing. For large team. Multi-paradigm: Functional and O-O. Extensible.Runs on JVM, Android, CLR
BSD
IBM - Home pageDesigned specifically for parallel programming, performance and scale.Runs on IBM AIX, Linux, Mac OS X, WindowsEPL
Bram MoolenaarHome pageAims to be fast, concise, portable, and easy-to-read and support  GUI application to an OS kernel.Compiles to ANSI CApache v2
Finally...

Wednesday, 29 August 2012

Tips to reduce code size

  • Keep the number of classes/interfaces to a minimum. Class overhead is over 200 bytes, so fancy OO designs with plenty of patterns and interfaces are not appropriate.
  • Keep the number of methods to a minimum. Increasing member visibility eliminates the need for the usual get/set methods. Not very nice, but efficient.
  • Try to use no more than 3 parameters for virtual methods and 4 for static methods. This way, the compiler will use a number or bytecode shortcuts, which help reduce code size: :aload_x (1 byte) instead of aload x (2 bytes), etc. (1 byte) instead of aload x (2 bytes), etc.
  • Use the switch-case control structure with care. It generates very verbose bytecode.the switch-case control structure with care. It generates very verbose bytecode.
  • Reuse local variables instead of declaring new ones. Reuse local variables instead of declaring new ones.
  • Hunt down unused but initialized local variables.  aload_ Hunt down unused but initialized local variables.

Coding vs Programming

Coding is a mere typing exercise to express the logical sequence of steps in the form of a well indented paragraph. It is specific to syntax and the language.

Programming is problem solving exercise, which forces you think continuously. Its a two step process.

First and the most crucial step is to “Define the Problem Statement”. This is the most important and difficult ste
p as all the use cases which needs to be satisfied must be clearly identified. The accuracy of the solution will depend on this step. This doesn’t depend on how you express. It could be a flow chart or diagrams depicting the problem statement.

Second step is to provide a logical sequence of the steps. The elegance, re-usability and scalability of the solution will depend on this step, as domain/technology specific knowledge is essential.

Full form of code

Code - Client-Server Open Development Environment

How to reduce execution time of c program

Try to do things in approximately the following order. 

1) Use the right algorithms. Look into the Big O efficiency of any algorithms you are using, and make sure there aren't more efficient algorithms available. 

2) Think about trading using more memory for a faster algorithm. Perhaps pre-computing tables of intermediate results. 

3) Use a profiler to see where the bottle necks are and try improving them. 

4) Optimize the inner most loops using assembly language to get the last little bit faster. 

5) Run it on a faster computer. 

6) Make it run in parallel across many computers or CPUs. This is especially good on the newer Intel chips where you have access to multiple CPUs on one chip. Distributed network computing sometimes is a good idea. Cloud computing is another possibility these days. 

7) Make sure that C really is the right answer. It might not be in all cases. 

A more specific question might yield a more specific answer.

Monday, 27 August 2012

Top 10 Programming Languages in 2012

1.C
2.Java
3.Objective C
4.C++
5.C#
6.Php
7.Visual Basic
8.Phython
9.Perl
10.Ruby





Saturday, 25 August 2012

How to increase code efficiency and optimization


  • Design your code before you start writing it!
  • Seek to simplify the problem/design/code wherever possible. This makes it easier to understand, code correctly, and maintain.
  • Try to break the design/code into small well defined functional units (folders, files, namespaces, classes, methods) to keep the codebase logically organised and well structured
  • Encapsulate behaviour where possible so that the implementation is hidden from the end user.
  • Get a coding style guide - there are loads on the web. Read many and pick out the best ideas from them (Don't just follow a rule because someone says you should - look for a good reason for every rule)
  • Document the code. Writing down how it works to a level where another programmer understands how to use it without having to ask any questions forces you to think about it, and often highlights problems.
  • Single-step your code so you fully understand how it actually works (as opposed to how you meant it to work)
  • Unit & regression test
  • When you find a bug, don't just fix it; work out why it happened and learn from the mistake.
  • The best way is to work as a team. Learn from each other, and the code others write. (Work on other people's code, pair program, discuss ideas in dev meetings, do code reviews)

Related Posts Plugin for WordPress, Blogger...