Tag Archives

Archive of posts published in the category: programming
Apr
1

Java Programming Basics – GeeksforGeeks

Java is one of the most popular and widely used programming language and platform. A platform is an environment that helps to develop and run programs written in any programming language.
Java is fast, reliable and secure. From desktop to web applications, scientific supercomputers to gaming consoles, cell phones to the Internet, Java is used in every nook and corner.

However to become proficient in any programming language, one Firstly needs to understand the basics of that language.

Therefore, below are the basics of Java in the format in which it will help you the most to get the headstart:

  1. Java Environment: The programming environment of Java consists of three components mainly:

    Learn about setting up the Java environment here: Setting up the environment in Java

  2. Java Basic Syntax: Every programming language has its own set of rules to declare, define and work on its components. Reading and learning about all of them together is difficult. Therefore here is a simple task of printing “Hello World” in Java. During this process, major components and their syntaxes are explained clearly.

    Learn about printing “Hello World” in Java here: Beginning Java programming with Hello World Example

  3. Comments in Java: In a program, comments take part in making the program become more human-readable by placing the detail of code involved and proper use of comments makes maintenance easier and finding bugs easily. Comments are ignored by the compiler while compiling the code.

    Learn about Comments in Java here: Comments in Java

  4. Data Types in Java: Each variable in Java has an associated data type. Each data type requires different amounts of memory and has some specific operations which can be performed over it.

    Learn about different data types in Java here: Data types in Java

  5. Variables in Java: A variable is the name given to a memory location. It is the basic unit of storage in a program.

    Learn about Variables in Java here: Variables in Java

  6. Keywords in Java: Keywords or Reserved words are the words in a language that are used for some internal process or represent some predefined actions. These words are therefore not allowed to use as variable names or objects. Doing this will result in a compile-time error.

    Learn about Keywords in Java here: Keywords in Java

  7. Operators in Java: Operators are the foundation of any programming language. Thus the functionality of Java programming language is incomplete without the use of operators. We can define operators as symbols that help us to perform specific mathematical and logical computations on operands. In other words, we can say that an operator operates the operands.

    Learn about Operators in Java here: Operators in Java

  8. Decision Making (Control Statements) in Java: Decision Making in programming is similar to decision making in real life. In programming also we face some situations where we want a certain block of code to be executed when some condition is fulfilled.
    A programming language uses control statements to control the flow of execution of the program based
Apr
1

The Nice programming language

SourceForge

Presentation

Nice is a new programming language. It extends the ideas behind
object-orientation in order to better support modular programming and
static type safety. It also incorporates features from functional
programming, and puts into practice state-of-the-art results from
academic research. This results in more expressivity, modularity and
safety.

Safety

Nice detects more errors during compilation than existing
object-oriented languages (null pointer accesses,
casts exceptions).
This means that programs written in Nice never throw the infamous
NullPointerException nor
ClassCastException.
This aspect is developed in more details in
this article.

Modularity

In object-oriented languages, it is possible to add a new class
to an existing class hierarchy.
In Nice, it is also possible to add methods to
existing classes without modifying their source file.
This is a special case of multi-methods.

Expressivity

Many repetitive programming tasks can be
avoided by using Nice’s advanced features.
Ever got bored
of writing tons of loops, casts, overloaded methods with default
values, anonymous classes, … ?

In addition to traditional object-oriented features, Nice offers:

Parametric types

This is especially useful for containers
(lists, hash-tables) and allows for shorter and safer code.
Values of primitive type (int, float, …) can be used in polymorphic code,
in which case the wrapping and unwrapping is done automatically by the
compiler.

Anonymous functions

Functions can be created and manipulated as
first-class expressions, just like in Lisp and ML.
This is much lighter than Java’s anonymous classes in many situations,
for instance with listeners in a GUI.

Multi-methods

They allow methods to be defined outside classes.
This means that new methods can be defined on classes that
belong to a different package (even in java.*).
This allows for a more modular style: you don’t need to pack classes with
all possibly useful methods, but you can split them into several packages
dealing with different aspects. Development can then happen independently
in each package.

Multi-methods also extend usual methods with the possibility to
dispatch on every argument, instead of only the receiver class.
This article shows why using multi-methods
is preferable to applying the Visitor pattern.

Tuples

This allows in particular methods to return several values.

Optional parameters to methods

Optional parameters have a default value that is used when the parameter
is not present in the call. This is much simpler than in Java, where one
has to write several versions of the method for each combination of
parameters. The names of the arguments can also be specified at the call
site, improving readability and making argument order irrelevant.

Contracts and assertions

Contracts can be attached to methods, to better describe their specification
and detect illegal uses automatically at runtime, in debug mode.
Contracts and assertions can be disabled, in which case they cause
no slow down of the running program. Furthermore, they can be used on any
version of the JVM, even prior to 1.4.

The current implementation is tightly integrated with the Java environment,
which offers several advantages.
The huge amount of Java libraries can be used

Apr
1

The two most hated programming languages among developers

Coding is intrinsic to the job of a developer, but find out what they really think about some of the most common languages.

Must-read Developer content

As more organizations turn to data analytics for optimizing operations, developer demand only heightens. Working with programming languages is embedded in the job, with Python, Java, and JavaScript being some of the most widely used. 

SEE: Programming languages: Which was most popular each year? (free PDF) (TechRepublic)

While those languages might be popular among organizations, that does not mean they are the most loved by programmers themselves. Java and JavaScript were actually two of the least favored languages, according to professional developers. 

“This may be an unpopular opinion due to JavaScript’s immense popularity, but it’s often quite a mess to work with in reality,” said Jack Mannino, CEO of nVisium, an application security provider.  

“By design, JavaScript encourages anti-patterns such as the use of global variables and JavaScript’s type coercion approach often baffles developers when the results are unexpected,” Mannino said. 

As for Java, “the code is unsustainable; it becomes quickly convoluted and hard to maintain,” according to Thomas Hatch, CTO and co-founder of SaltStack, an intelligent IT automation software provider. “The irony is that it was designed with the goal of making it easy to maintain with large teams.” 

Every programming language has its own purpose, and oftentimes the language usage depends on the context of what the developer is programming, said Katie Levy, a senior software engineer at Intuit. 

“It all depends on what you need to do,” said Will Goode, lead instructor at Coding Dojo. “If I wanted to write more performance-optimized applications to run on an OS, I’d appreciate a lot of what C++ gives me. If I wanted to write an OS kernel, I’d appreciate what I can do with C. And if I wanted to write code that needed to access special instruction sets of my hardware, Assembly would be great.”

However, there are common qualities that make one language better to work with than another. 

Qualities of a good programming language 

“An ideal programming language has straightforward syntax, a strong set of core libraries, and doesn’t bury you in unnecessary complexity,” Mannino said. 

“A good language provides you with enough flexibility to solve problems in different ways, but also provides you with easily implemented features in the event you want to default to the language’s opinionated implementation,” he added. 

At its core, a solid programming language is one that is easy to work with. 

“Why do I really dislike Java? Because I am not very good at it. Very few languages are fundamentally good or bad, the creation of a programming language is so complex that you quickly need to start to make compromises,” Hatch noted. 

“The best quality of a language is that it is understandable, that the developer knows it, and the developer can easily communicate to another developer how the program is constructed,”  Hatch said. 

Python was the clear crowd favorite amongst most of

Apr
1

Programming in C

Programming in C
Programming in C 
ANSIHistoryCultureLiterature 
  
  
  
What’s new?

  ANSI C

ISO/IEC JTC1/SC22/WG14 and
N843, the official committee document

The first chain of abbreviations is the committee responsible for
maintaining and updating the C language definition; the second, N843, designates
the Final Committee Draft of what will one day be the next C standard.
As usual, there are versions in
gzipped PostScript
and
Adobe
Acrobat format
.
Gábor Egressy is hosting a hyperlinked version of N794, a slightly earlier draft.

A brief description of Normative Addendum 1,
by Clive Feather

Rather than delay the Standard to add full internationalization features,
ANSI agreed to add minimal features immediately, with ISO designing
a proper extension at a later date.  This work
– 4 years in the doing – has culminated in Normative Addendum 1.

Normative Changes to ISO/IEC 9899:1990
in Technical Corrigendum 1

Four years after the adoption of the ANSI C standard as
an International Standard in 1990, answers to the first batch of
defect reports have been formally accepted: the C standard has changed.

David R. Tribble: C99 vs. C++98

David R. Tribble has tracked down all the
subtle differences between ISO C and ISO C++, as well
as the features that once differed but have been aligned,
and lists them with references to the two defining documents.

Paul Eggert summarizes Technical Corrigendum 2

ISO C Technical Corrigendum 2 (TC2) has been approved.
Even leaner than its predecessor TC1, it
consists only of small changes in response to Defect Reports,
and will be of interest mostly to compiler and test suite vendors.

Instant C9x: Doug Gwyn’s Q8

“Aside: Why “Q8″? That was used as a system external symbol
prefix in old CDC Fortran implementations, to avoid link-time
name-space collisions with user-defined symbols, on the
assumption that no user would ever think of using such a name.”

David M. Keaton’s home page
and FTP site (Danish mirror)

First the official X3J11.1 (NCEG subgroup) server, then
the official ANSI X3J11 server,
David M. Keaton’s FTP site
has now become the official ISO SC22 WG14 archive; it holds
electronic copies of all current proposals
for C9X,
the next revision of the ISO C standard.  Lately,
Dave has been venturing out onto the World­Wide Web and has marked
up two proposals he wrote with David Prosser:
Designated Initializers
and Compound Literals.

The Dinkum C Library Reference

P.J. Plauger, author of many books on C and software engineering
and until recently convener of the ISO/IEC workgroup in charge
of C as an international standard, is licensing HTML versions
of some of his books, among them the Standard C library reference.

The ANSI C Rationale

“This Rationale summarizes the deliberations of X3J11, the Technical Committee
charged by ANSI with devising a standard for the C programming language.”

Dennis Ritchie on
type qualifiers
  (1988)

“Noalias must go.   This is non­negotiable.
It must not be reworded, reformulated or reinvented.”

Proposal X3J11.1 93­006: Restricted Pointers

“The X3J11 committee attempted to solve the aliasing problem in C

Apr
1

10 Most Popular Programming Languages In 2020: Learn To Code

For beginners in the world of programming, the biggest dilemma is to decide where to begin or which popular language one should master for career benefits. At times, professional coders also face a situation where learning a new language seems more fruitful.

Whatever may be the reason, here is a list of the most popular programming languages across the world to know which languages are ruling the charts. This list of top programming languages is based on the data sourced from TIOBE Programming Community Index, which is a popular indicator of the popularity of programming languages.

TIOBE calculates the ratings by analyzing data from Google, Yahoo!, Bing, Wikipedia, Amazon, Baidu, and YouTube. Variables like the number of professional developers worldwide, training courses, and third-party vendors have also factored in this list.

March 2020 headline:

The TIOBE Programming Community index is updated every month and the results for March 2020 are here. The top three most popular programming languages, namely Java, C, and Python continue to maintain their first, second and third position respectively. All top three languages are growing incrementally in terms of popularity each month. Let’s take a look at the other big changes:

Delphi to fall off TIOBE index top 20

The year 2020 seems to bring a farewell for the well-beloved Delphi language. Delphi has maintained its place in the top 20 since the beginning of the TIOBE index (which started in June 2001). In the early 2000s it was one of the most popular languages and IDEs. But now its popularity has declined drastically.

Go programming language is catching up quickly

In the previous Tiobe Index that was released a couple of months ago, Go was placed at 18th position. However, there has been a sharp rise in the popularity of this programming language since then as the rankings have upgraded from 18th to 10th position. This is by far, the biggest change in popular programming language rankings.

C# displaces Visual Basic .Net

C# has overtaken Visual Basic .Net by a small margin. At the same time, VB’s popularity has also shrunk this year. Recently, Microsoft announced that it will start deprecating VB .Net. Microsoft says that it will support Visual Basic on .NET 5 but also that it has no plans to evolve the language.

Top 10 Programming Languages In 2020

The following list contains the top 20 programming languages and their performance in comparison to last year’s ratings. After that, the top 10 languages have been individually described in brief:

Mar 2020 Mar 2019 Change Programming Language Ratings Change
1 1 Java 17.78% 2.90%
2 2 C 16.33% 3.03%
3 3 Python 10.11% 1.85%
4 4 C++ 6.79% -1.34%
5 6 C# 5.32% 2.05%
6 5 Visual Basic .NET 5.26% -1.17%
7 7 JavaScript 2.05% -0.38%
8 8 PHP 2.02% -0.40%
9 9 SQL 1.83% -0.09%
10 18 ↑↑ Go 1.28% 0.26%
11 14 R 1.26% -0.02%
12 12 Assembly language 1.25% -0.16%
13 17 ↑↑ Swift 1.24% 0.08%
14
Apr
1

C programming Exercises, Practice, Solution

What is C Programming Language?

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations.

C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, and used to re-implement the Unix operating system. It has since become one of the most widely used programming languages of all time, with C compilers from various vendors available for the majority of existing computer architectures and operating systems.

The best way we learn anything is by practice and exercise questions. We have started this section for those (beginner to intermediate) who are familiar with C programming.

Hope, these exercises help you to improve your C programming coding skills. Currently, following sections are available, we are working hard to add more exercises …. Happy Coding!

List of C Programming Exercises :

[ Want to contribute to C exercises? Send your code (attached with a .zip file) to us at w3resource[at]yahoo[dot]com. Please avoid copyrighted materials.]

Popularity of Programming Language
Worldwide, March 2020 compared to a year ago:

Source : http://pypl.github.io/PYPL.html

TIOBE Index for February 2020

Source : https://www.tiobe.com/tiobe-index/

List of Exercises with Solutions :

  • HTML CSS Exercises, Practice, Solution
  • JavaScript Exercises, Practice, Solution
  • jQuery Exercises, Practice, Solution
  • jQuery-UI Exercises, Practice, Solution
  • CoffeeScript Exercises, Practice, Solution
  • Twitter Bootstrap Exercises, Practice, Solution
  • C Programming Exercises, Practice, Solution
  • C# Sharp Programming Exercises, Practice, Solution
  • PHP Exercises, Practice, Solution
  • Python Exercises, Practice, Solution
  • R Programming Exercises, Practice, Solution
  • Java Exercises, Practice, Solution
  • SQL Exercises, Practice, Solution
  • MySQL Exercises, Practice, Solution
  • PostgreSQL Exercises, Practice, Solution
  • SQLite Exercises, Practice, Solution
  • MongoDB Exercises, Practice, Solution
  • Euler Project

Source Article

Apr
1

14 Best Programming Software For Writing Code [2020]

Development tools come in dozens of forms, including compilers, linkers, assemblers, debuggers, GUI designer, and performance analysis tools. The right tool can significantly increase your productivity and can help you easily maintain the workflow of the project.

One of the most basic programming software is the source code editor, which is used ubiquitously and continuously. It is basically a text editor program designed for writing and editing programming code.

Code editor can either be a standalone application or built into a web browser or integrated development environment (IDE). Since there are literally hundreds of Code Editors available in the market, it is difficult for developers to choose one.

To make this job easier, we have gathered a few best programming software that can speed up your coding process while offering plenty of useful features.

14. Eclipse

Price: Free
Platform: Linux, macOS, Windows

Eclipse is an IDE that supports an extensible plug-in system for customizing the environment. Although it is primarily used for developing Java applications, you can use to write apps in other programming languages as well (via plug-ins).

It checks compile-time errors while writing the code. And since it provides suggestions and has a great online community to help users, you can increase your pace of coding with this tool.

Eclipse manages multiple files and projects efficiently, and support a broad range of file formats with type-specific syntax formatting. It provides connectors for multiple databases and supports common DB access methods. Moreover, project integration into GIT is virtually seamless.

13. Geany

Price: Free
Platform: Linux, macOS, Windows

Geany is an open-source, lightweight text editor, specifically designed to have short load times with limited dependencies on external libraries or separate packages.

It supports many programming and markup languages, including C, C#, C++, PHP, HTML, CSS JavaScript, Python, Perl, Haskell, and Pascal. Other common filetypes like Diff-output, SQL files, and ini-style config files, are also supported.

Unlike other code editors, you don’t have to search through numerous syntax styles just to be able to change the used font. And since it features real syntax parsing (not just coloring), it can display inner classes and methods in source code.

12. gedit

Price: Free
Platform: Linux, macOS, Windows

gedit is a lightweight yet powerful general-purpose text editor of the GNOME desktop environment. As per the philosophy of the GNOME project, it has a clean and simple GUI for editing source code and structured text like markup languages.

In addition to syntax highlighting for various programming languages, it also comes with spell checking features and all other basic options like Goto line, find and replace.

The tool could run fast on low-end PCs: it uses little memory and CPU resources while reading very large logs.

11. Brackets

Price: Free
Platform: Linux, macOS, Windows

Brackets is an open-source code editor developed by Adobe Systems. It primarily focuses on HTML, CSS, and JavaScript editing functionality.

The Live Preview pushes your code edits instantly to the browser to display an updated webpage as you modify the code.

Apr
1

The Journal of Logic and Algebraic Programming

The Journal of Logic and Algebraic Programming is an international journal whose aim is to publish original research papers, survey and review articles, tutorial expositions, and historical studies in the areas of logical and algebraic methods and techniques for programming in its broadest sense. All…

Read more

Source Article

Apr
1

What is Structured Programming?

Structured programming (sometimes known as modular programming) is a programming paradigm that facilitates the creation of programs with readable code and reusable components. All modern programming languages support structured programming, but the mechanisms of support, like the syntax of the programming languages, varies.

Where modules or elements of code can be reused from a library, it may also be possible to build structured code using modules written in different languages, as long as they can obey a common module interface or application program interface (API) specification. However, when modules are reused, it’s possible to compromise data security and governance, so it’s important to define and enforce a privacy policy controlling the use of modules that bring with them implicit data access rights.

Structured programming encourages dividing an application program into a hierarchy of modules or autonomous elements, which may, in turn, contain other such elements. Within each element, code may be further structured using blocks of related logic designed to improve readability and maintainability. These may include case, which tests a variable against a set of values; Repeat, while and for, which construct loops that continue until a condition is met. In all structured programming languages, an unconditional transfer of control, or goto statement, is deprecated and sometimes not even available.

Difference between structured and unstructured programming languages

A structured programming language facilitates or enforces structured programming practices. These practices can also be supported with unstructured languages, but that will require specific steps in program design and implementation. Structured programming practices thus date to the emergence of structured programming languages.

The theoretical basis for structured programming goes back to the 1950s, with the emergence of the ALGOL 58 and 60 languages. Up to then, code clarity was reduced by the need to build condition/action tests by having programmers write linked tests and actions explicitly (using the goto statement or its equivalent), resulting in what was often called spaghetti code. ALGOL included block structure, where an element of code included a condition and an action.

Modular programming, which is today seen as synonymous with structured programming, emerged a decade later as it became clear that reuse of common code could improve developer productivity. In modular programming, a program is divided into semi-independent modules, each of which are called when needed. Purists argue that modular programming requires actual independence of modules, but most development teams consider any program that divides logic into separate elements, even if those elements exist within the same program, as modular.

Modern programming languages are universally capable of producing structured code. Similarly, they’re also capable of producing code fairly described as unstructured if used incorrectly. Some would say that an unstructured programming language contains goto statements and, thus, does not require a “call” to a separate module, which then returns when complete, but that definition is unnecessarily restrictive. It’s better to say that the mechanisms for enforcing structure vary by language, with some languages demanding structure and other accepting less-structured code.

Types of structured

Apr
1

Guide to Programming Languages | ComputerScience.org

What are Computer Programming Languages?

Computer programming languages allow us to give instructions to a computer in a language the computer
understands. Just as many human-based languages exist, there are an array of computer programming
languages that programmers can use to communicate with a computer. The portion of the language that a
computer can understand is called a “binary.” Translating programming language into binary
is known as “compiling.” Each language, from C Language to Python, has its own distinct
features, though many times there are commonalities between programming languages.

These languages allow computers to quickly and efficiently process large and complex swaths of
information. For example, if a person is given a list of randomized numbers ranging from one to ten
thousand and is asked to place them in ascending order, chances are that it will take a sizable amount
of time and include some errors.

There are dozens of programming languages used in the industry today. We’ve compiled overviews
of the 12 most important, relevant and in-demand of these languages below.

Python

Python_small

Python is an advanced programming language that is interpreted, object-oriented and built on flexible
and robust semantics.

Who uses it?

  • Professions and Industries: 
    • Python developers, software engineers, back end developers, Python programmers
    • Used by employers in information technology, engineering, professional services and design
  • Major Organizations: Google, Pinterest, Instagram, YouTube, DropBox, NASA, ESRI
  • Specializations and Industries: Web and Internet development (frameworks, micro-frameworks
    and advanced content management systems); scientific and numeric computing; desktop graphical user
    interfaces (GUIs)

What makes learning it important?

Python lets you work quickly to integrate systems as a scripting or glue language. It’s also suited
for Rapid Application Develop (RAD).

  • The game Civilization 4 has all its inner logic, including AI, implemented in Python.
  • NASA uses Python in its Integrated Planning System as a standard scripting language.
  • Features:
    • Simple to learn and easily read
    • Associated web frameworks for developing web-based applications
    • Free interpreter and standard library available in source or binary on major platforms

Where did it start?

Python was developed in the late 1980s at CWI in the Netherlands and first released to the public in
1991.

Forums

Try it out!

Java

Java_logo_small

Java is a general-purpose, object-oriented, high-level programming language with several features
that make it ideal for web-based development.

Who uses it?

  • Professions and Industries:
    • Software engineers, Java developers
    • Used by employers in communications, education, finance, health sciences, hospitality, retail
      and utilities
  • Major Organizations: V2COM, Eclipse Information Technologies, eBay, Eurotech
  • Specializations and Industries: Internet of Things (IoT), Enterprise Architecture, Cloud
    Computing

 

What makes learning it important?

Java is used to develop enterprise-level applications for video games and mobile apps, as well as to
create web-based applications with JSP (Java Server Pages). When used online, Java allows applets to
be downloaded and used through a browser, which can then perform a function not normally available.

  • Programs that use or are written in Java include Adobe Creative Suite, Eclipse, Lotus Notes,
    Minecraft and OpenOffice.
  • Java is the core foundation for developing Android apps.
  • Features:
    • Application