What's the easy programming language for a beginner

???????? ?????
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: What's the easy programming language for a beginner

Post by Saman » Tue Mar 06, 2012 8:14 pm

No Nandika. That will never happen. C++ is the oldest common programming language and still it is the mostly used and most popular language in the world.

If you take Operating Systems, almost all are developed using C++ including Windows 7, Ubuntu, Android, iOS, etc...
If you take firmware development, other than assembly, C++ is the mostly used programming language.
If you take compilers of other languages such as Java are written using C++.

So in simple terms, almost all are running on low level layers written using C++.

If there is no C++, that's the end of software world. That's guaranteed :)
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: What's the easy programming language for a beginner

Post by SemiconductorCat » Wed Mar 07, 2012 9:22 am

Nandika wrote:
SevenZero wrote:VB6 is a superb language. No doubt in that.
But it's kind of dead language now. It lacks support to latest operating systems such as Windows 7. VB6 is already treated as a legacy programming language by Windows 7. Most of the features are disabled for that. VB6 is a Microsoft specific programing language. That means you can't run VB6 programs on Linux, etc..
Will be this fate for C++ ?
i think,yes...in feature... :(
as Saman told above, C++ standard will never dies.
It's fate is C++0x the next version of C++, it includes Threads, Semphores , and smart pointers in the
STL language level support.

Another Microsoft only alternative is C++/CLI , it got a language level garbage collector and executes on
managed code. [pure C++ don't support Managed Code Extensions].
http://en.wikipedia.org/wiki/C%2B%2B/CLI

Another alternation to the C is "Objective C" used by MacOS to write high performance UI to it's
operating system.


So C++ will remain it's place as it is. So do Basic too.
For a example.
GW Basic becomes visual basic , and now visual basic becomes visual basic .Net.
and do you know the same basic grammar rules are used in microcontroller's too.
ex:- TinyBasic for 8051 family microcontrollers.

That's why I'm saying , Just learn the core language. Then lean it's platform extension.
Even before that [if you willing to learn something like VB.net] learn Object Oriented
concepts,otherwise you will never know what your doing.

so anything can be done with "C" can done with basic , write Operating systems , Application programs,
embedded/microcontroller development , etc etc.
But as Saman told, C is the common platform for writing OSes and drivers and
embedded development. The reason is it's more suitable.

Basic/C/Pascal are just like speaking languages, when you need to express something
you can use any. There are some places people speak it and there are places people
won't speak it or people speak multiple languages. That theory is true for computing too.
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: What's the easy programming language for a beginner

Post by SemiconductorCat » Fri Mar 09, 2012 12:31 am

Code: Select all

Have a look at this Microsoft employee's answer. I think that will remove your confusion.
http://social.microsoft.com/Forums/is/windowshpcacademic/thread/65a1fe05-9c1d-48bf-bd40-148e6b3da9f1

Most lower bits are written in assembly, the bit on top of it must be raw C (compiled using the C++ compiler anyway  ;) ) and the code on top of it can be anything like C++, C#, etc...


that project manager of HPC team told there that nothing about compiling C code with C++ compiler there.
where he told that thing? He told we use both C and C++ in writing windows operating system.

if you ever write a operating system using C then you probably know why we use C, because C name managing
or name decoration is very simple. But C++ name mangling is little bit complicated(because it supports
overloading, let me remind you C does not support overfloading, you probablly know this already anyway).
because of that simplicity , we could use them very easily in linker editor scripts.And inside call
C functions inside assembly.So lower parts and even the bootcode, developers prefer C instead of C++.
But it doesn't said you can't do the same thing using C++ anyway.



I'm not interested to go in to much details on gcc C compiler as it is not the only C compiler in the world. I only use it to compile my apps in Linux, nothing more than that. Besides gcc is a compiler collection that provides few compilers bundled together. So within the bundle, it has named the structure as Front, Middle and Back that I have no interest to learn since its kind of an internal naming for them. But I would have gone in to lexical analyser stage on the C compiler to check whether how it distinguish between C and CPP syntax.
So did you see same scanner is used for both C++ and C, dude font end means scanner+parser, and lexical
analyzer don't deal with the syntax , it just torkanize the things in source file into tokens.For a example , '
if we input this file ,

Code: Select all

int main()
{
    return 1;

}

the lexer will out like this.bellow V

Code: Select all

<keyword,int>
<identifier,main>
<(>
<)>
<{>
<keyword,return>
<literal,int,1>
<;>
<EOF>
it does not parse and generate the IR (intermediate representation at all) to the backed.
Simply in modern compiler implementations parser is calling the scanner(get_next_lex() ) or
something like that. If the gcc codebase is soo complicated then I suggeset you to
read the source code of the example compiler implementation of Tiny C in Compiler Construction
Principles and Practice book by Keneth C. Louden, you could find it in the book appendix.

I have attached the sources of both C++ lexer and C lexer bellow.
C++ lexer file is just "lex.c" and C lexer is "c-lex.c". Please take the time and go through
those.


can you see the differences and similarities of each other?
could you?

And there are two parser scripts for parser generator too. They are different in C vs C++ too.
So their font-end are very very different. I do suggest you to go through both of them carefully,
if you felt complicated go back to the Compiler Construction Principles and Practice by
Kenneth C. Louden book and read the appendix example Tiny C implementation and come back to
read this.

and neo could you please put these four posts in another thread to keep our robot.lk managed !

--Thanks in advance--
Attachments
lex.c
C++ lexer lexer of the gcc toolchain.
(128.77 KiB) Downloaded 335 times
c-lex.c
C lexer of the gcc toolchain.
(56.49 KiB) Downloaded 335 times
Post Reply

Return to “???????? ?????”