# Book For Beginner



## lovedonator (Apr 28, 2012)

Hi guys,I'm in class 12th and I've been a reader of digit for 3 years.I've done case modding & other hardware related stuff,compiled android roms but I have zero programming knowledge as of now.I've decided to start from Python.Is this a right choice?If yes then please recommend a suitable book keeping in mind that I have zero programming knowledge.
I've seen this book,is it good? 
Flipkart.com: Learning Python 8184048262: Book: Mark Lutz (9788184048261)


----------



## ritvij (Apr 28, 2012)

visit udacity.com and take their cs101 lesson.. its the best you can get and is way better than any ruddy book!


----------



## Sujeet (Apr 28, 2012)

^^Books arent ruddy.!Until and Unless a person judges so ....


@OP I would recommend to begin your journey in Programming with C,C++.
It would help you to strengthen your Object Oriented Programming Concepts which is  a must have skill for programmer.
If you are concerned with Creating Programs for Windows LATER Then too I would recommned to Start with C++ which would allow you to catch up with VC++.
Ivor Horton's Beginning Visual C++ 2010
One Book To Rule both C++ And VC++.


----------



## sarthak (Apr 28, 2012)

Better start with C or C++.


----------



## nims11 (Apr 28, 2012)

its better to learn python as your first language.


----------



## Sujeet (Apr 28, 2012)

Python Syntax is easier to catch but For Complex Programs it may prove less efficient in comparison OOP like C++/Java.

@OP
Your Choice.Just Make Sure that you keep you basics and fundamentals clear!
The concepts are same in every programming language under the Sun.


----------



## Liverpool_fan (Apr 28, 2012)

Sujeet said:


> Python Syntax is easier to catch but For Complex Programs it may prove less efficient in comparison OOP like C++/Java.


A beginner programmer will not give two hoots about "less efficiency". And most programs would barely benefit from that "performance". A misguided programmer would be more likely to write an inefficient program in C++ than Python anyway.
If fact it's a lot better to be platfrom neutral as a beginner programmer than a pseudo-performance junkie. (yes that means no Visual C++ or any C#.NET and any such platform restricted technology)

@OP: Download "A Byte of Python" (for Python2) and follow Udacity CS-101 classes You'll be good.


----------



## pranav0091 (Apr 28, 2012)

Liverpool_fan said:


> @OP: Download "A Byte of Python" (for Python2) and follow Udacity CS-101 classes You'll be good.



Agree. 

Better start with python I guess. Its much simpler than C, C++.
Will help you understand certain concepts like lists, dictionary etc better. 
I suggest you hold back from buying that book.
First set off and register at Udacity.
Then use A Byte of Python for things that CS101 doesnt teach.
I have personally found that online resources and ebooks available for python are quite good.


----------



## abhijangda (Apr 28, 2012)

Yeah, I would also recommend go for Python rather than C/C++, these are complicated languages. Moreover, Python is not that inefficient. If programmed wisely then Python programs are also efficient. Also, remember one thing practice practice and practice. Also, Python in a Nutshell is also a very good book.


----------



## $$Lionking$$ (Apr 29, 2012)

Start with C. 

Its extremely easy and more powerful than any other language listed on this page.
Once you are familiar with the syntax you will have many different choices - U could make faster programs the same ones u made earlier or you could do some low level advanced stuff or go into Windows API and make simple apps like Notepad, Paintbrush etc.. or programming for even more advanced graphics using DirectX11 etc...

C Rockks dude! 

With python u will have limited scope.

You could download The C Programming Language by Kernighan & Ritchie. 
Good book for beginners...


----------



## Sujeet (Apr 29, 2012)

Liverpool_fan said:


> A beginner programmer will not give two hoots about "less efficiency". And most programs would barely benefit from that "performance". A misguided programmer would be more likely to write an inefficient program in C++ than Python anyway.
> If fact it's a lot better to be platfrom neutral as a beginner programmer than a pseudo-performance junkie. (*yes that means no Visual C++ or any C#.NET and *any such platform restricted technology)
> 
> @OP: Download "A Byte of Python" (for Python2) and follow Udacity CS-101 classes You'll be good.


Refrence was made to Java and C++ not to VC++ and C#.
The Visual C++ book that has been referenced is also very good for Native C++ for beginners.

The most important thing is to be acquainted with OOP which can learnt and understood quite well by using C++/C/Java.

Learning Most Powerul Language in first Go wont Hurt.

_Lets not talk about how easy or hard it is to catch up a language.It depends on learners efficiency not on language._


----------



## Liverpool_fan (Apr 29, 2012)

Sujeet said:


> Refrence was made to Java and C++ not to VC++ and C#.
> The Visual C++ book that has been referenced is also very good for Native C++ for beginners.


There are better books.



> The most important thing is to be acquainted with OOP which can learnt and understood quite well by using C++/C/Java.


Python does every bit as good in OOP as any of these languages. 



> Learning Most Powerul Language in first Go wont Hurt.


Power in terms of what? Performance? I've spoken about it already. I'll go and say Python gives programmer the power and it is infinitely more powerful in that sense than C or C++. 



Sujeet said:


> _Lets not talk about how easy or hard it is to catch up a language.It depends on learners efficiency not on language._


It does my friend, it does.

P.S.: The term learners' "efficiency" is a load of bull, especially talking about beginners.

P.P.S.: Are you a C/C++/Java/C# only programmer?


----------



## Sujeet (Apr 29, 2012)

Liverpool_fan said:


> There are better books.


I didnt say thats the best book!Did I?
Alternatives always exists.


Liverpool_fan said:


> Python does every bit as good in OOP as any of these languages.





Liverpool_fan said:


> Power in terms of what? Performance? I've spoken about it already. I'll go and say Python gives programmer the power and it is infinitely more powerful in that sense than C or C++.


Explain.


Liverpool_fan said:


> P.S.: The term learners' "efficiency" is a load of bull, especially talking about beginners.


I am talking about learners Efficiency not Language's.Jeez.!



Liverpool_fan said:


> P.P.S.: Are you a C/C++/Java/C# only programmer?


+
Python+html5/cs3+Unrealscript+Jquery(Javascript).
If that matters.


----------



## $$Lionking$$ (Apr 29, 2012)

> Power in terms of what? Performance? I've spoken about it already. I'll go and say Python gives programmer the power and it is infinitely more powerful in that sense than C or C++.



Can you access the binary data at any particular sector on your harddisk directly using python? Power in terms of what the language can enable you to do is also important. There are a lot of things that are just beyond python comparing it to C/C++ is insane.




> P.S.: The term learners' "efficiency" is a load of bull, especially talking about beginners.



Really?? How?! Explain dude!!!


----------



## pranav0091 (Apr 29, 2012)

^
You'd like to learn about numbers before jumping into number theory.
IMO it makes more sense for the OP to learn a simple language like python to kick off his programming journey. You can always go into the nitty gritties later. But if you mess up your fundamentals when trying to learn, trust me, its a lot harder to get it right later on.

 BTW doesnt the OS module of python handle things like you mentioned?

edit: Online sources indicate that reading sectors of the HDD is OS dependent, not language dependent.


----------



## $$Lionking$$ (Apr 29, 2012)

^I dont really think u can do that with python. 

In C u cud use inline assembly and INT13H & INT21H(C shud probably have a function for this too..) both provide ways to do read/write on HDD directly... 

What you read about OS dependency was that some OS might block direct access to HDD via any software... probably a security feature... 

@this is OS dependant not language dependant ?? r u actually saying these words out loud?

THIS IS ALL OFF TOPIC. POINT IS C IS MORE POWERFUL THAN PYTHON DUDE!!!

this nitty gritty was only an example... u shudnt have taken it so literally... I was just giving an example of low level programming that will probably not be possible to do in python considering its a high level language...

1st language is very important... it should be C.


----------



## ico (Apr 29, 2012)

Reading posts, one thing I'm dead sure. Everyone saying C/C++ in this thread for a beginner have zero idea about Python. And the people who are saying Python, very well know about C/C++ to make the right judgment.

With C/C++, just after a small bit of learning, you're going to spend most of your time with pointers/memory addressing. C is the most "jugaadu" language out there. Shouldn't be your first step at all.


----------



## Liverpool_fan (Apr 29, 2012)

Sujeet said:


> I didnt say thats the best book!Did I?


All right.



> Explain.


I am not going to write programs to demonstrate that. If you know Python you'll know the answer (re OOP). As far as programmer having "infinitely more power" is concerned Python has very rich set of libraries, documentation, and everything to do what a programming language is supposed to do - Make writing programs possible for humans with ease. And Python does compile to bytecode, before the bytecode is interepreted to the Python VM, so it's not like Python is very slow or what.



> I am talking about learners Efficiency not Language's.Jeez.!


I was talking of the same in that quote.



> +
> Python+html5/cs3+Unrealscript+Jquery(Javascript).
> If that matters.


No it doesn't but it doesn't tally that you're asking me to explain OOP features of Python when you have programmed with it.




$$Lionking$$ said:


> Can you access the binary data at any particular sector on your harddisk directly using python? Power in terms of what the language can enable you to do is also important. There are a lot of things that are just beyond python comparing it to C/C++ is insane.


How many programs would actually want to access binary data at any particular sector on your hard disk? That's lol. And Python can interface with C libraries to achieve everything a C program can do. And to add to that no beginner would be fiddling with the bits in your hard disk. 
This is like saying a bulldozer is more powerful than a car, so it should be used rather than a car.



> Really?? How?! Explain dude!!!


Self-evident.



$$Lionking$$ said:


> ^I dont really think u can do that with python.


See above.



> In C u cud use inline assembly and INT13H & INT21H(C shud probably have a function for this too..) both provide ways to do read/write on HDD directly...
> 
> What you read about OS dependency was that some OS might block direct access to HDD via any software... probably a security feature...
> 
> @this is OS dependant not language dependant ?? r u actually saying these words out loud?


A modern programmer fiddling directly with the BIOS? What the hell? What do system calls exist for? AFAIK the OS will intercept these call and use their own mechanism.



> THIS IS ALL OFF TOPIC. POINT IS C IS MORE POWERFUL THAN PYTHON DUDE!!!


Writing in All Caps doesn't validate your point but makes you look like a 12 year old. That point being bull doesn't help either.


> this nitty gritty was only an example... u shudnt have taken it so literally... I was just giving an example of low level programming that will probably not be possible to do in python considering its a high level language...


You're quoting an example which is:
1. FAIL
2. No one will use
3. No one should use
4. No beginner would use it anyway



> 1st language is very important... it should be C.


And you can't back that up. And bet you haven't written a single line in Python.




ico said:


> Reading posts, one thing I'm dead sure. Everyone saying C/C++ in this thread for a beginner have zero idea about Python. And the people who are saying Python, very well know about C/C++ to make the right judgment.
> 
> With C/C++, just after a small bit of learning, you're going to spend most of your time with pointers/memory addressing. C is the most "jugaadu" language out there. Shouldn't be your first step at all.



This. Nothing needs to be said more. Heck while C++ does away with some of the difficulties with C, but the sad thing is most C++ "programmers" don't have a clue about STL, and often end up doing C programming in C++.


----------



## nims11 (Apr 29, 2012)

Statements like "C++ is better than python" or vice versa are invalid.

unlike C++, python doesn't give you low-level control. Also C++ is much faster than python, the reason being C++ programs are pre-compiled unlike python programs which are interpreted everytime they are executed.

Python on the other hand operates at a higher level and offers better Rapid development environment. It is much easier to learn and read as well.

I am a C++ progammer and i am not very much into python, but still i recommended python because a new programmer doesn't need to know about low level memory manipulation and OOP. He needs a language which is easier to write and understand and most importantly teach him how to program.



Liverpool_fan said:


> This. Nothing needs to be said more. Heck while C++ does away with some of the difficulties with C, but the sad thing is most C++ "programmers" don't have a clue about STL, and often end up doing C programming in C++.



This.
I am sick of my batchmates misunderstanding C++ as just a "better C" and nothing else. forget STL, their OOP knowlegde is limited to classes as a collection of data and functions, and inheritance is just a theory to them. To most of them, polymorphism is only about function overloading!


----------



## Sujeet (Apr 29, 2012)

ico said:


> With C/C++, just after a small bit of learning, you're going to spend most of your time with pointers/memory addressing




For Beginner that shouldn't be a major concern.
Why do you think one will get stuck with pointers.
They are simple to catch and not essentials  for Small programs.
If you are talking about managing variable with dynamically allocated storage then that's a different thing.


----------



## $$Lionking$$ (Apr 29, 2012)

> And Python can interface with C libraries to achieve everything a C program can do.


You're making  my case here - why rip off C libraries when you can just - use C!



> A modern programmer fiddling directly with the BIOS? What the hell? What do system calls exist for?


Fiddling with BIOS?? lol? Maybe you could read a book on C! 



> Writing in All Caps doesn't validate your point but makes you look like a 12 year old. That point being bull doesn't help either.



It was in caps to increase visibility to mods. 
If using block letters to better the visibility makes you feel I'm 12y.o. then I just don't care, and you need to seek help!!  



> A beginner programmer will not give two hoots about "less efficiency". And most programs would barely benefit from that "performance". A misguided programmer would be more likely to write an inefficient program in C++ than Python anyway.



This might clear your doubts too - Clearly the syntax is not so different and C is ~23x faster than python. ~3 seconds to do things that can be done in python in ~50 seconds. 

Here -

Quick post: Python vs C in compute-bound workloads | Future Chips

Anyways I have a life - bye bye!!!


----------



## lovedonator (Apr 29, 2012)

Oh my god,I see that my question has started quite a debate here. 
Thanx all of you for your replies.I have decided to learn python first and I will stick with that decision.I'm not much concerned about efficiency at this stage as I'm just going to begin.Your suggestion to not buy the book and instead join aforementioned online courses is duly noted.Thanx a lot evryone


----------



## Liverpool_fan (Apr 29, 2012)

$$Lionking$$ said:


> You're making  my case here - why rip off C libraries when you can just - use C!


A programming language is a tool. Every language is tailored for a particular task, with interfacing a high performance C library with a python program, we get best of both the worlds of ease of programming and performance. While C-only fools can fiddle with pointers and cleaning up memory, a clever programmer is building products using the best tools in hand.



> Fiddling with BIOS?? lol? Maybe you could read a book on C!


So you don't have clue about what you post yourself. Maybe you should start reading your own posts?



> It was in caps to increase visibility to mods.
> If using block letters to better the visibility makes you feel I'm 12y.o. then I just don't care, and you need to seek help!!


"I need" to seek help, since you behave like a kiddo? Ok then.


> This might clear your doubts too - Clearly the syntax is not so different and C is ~23x faster than python. ~3 seconds to do things that can be done in python in ~50 seconds.


Oh dear. 


> Here -
> 
> Quick post: Python vs C in compute-bound workloads | Future Chips


The author is using entirely different data structures, array v lists and this is not entirely a fair test. And yes C is indeed much faster for number crunching and similar stuff but that's not the entire use case of a language especially for a beginner.
Programming is not about just number crunching, and certainly not with idiotic algorithms. And of course as I said you can always externally use an efficient implementation in C to achieve speed. 
*stackoverflow.com/questions/3533759/performance-differences-between-python-and-c




> Anyways I have a life - bye bye!!!


You mean you are going somewhere else to troll and spread FUD. Tatty bye bye son.



Sujeet said:


> For Beginner that shouldn't be a major concern.
> Why do you think one will get stuck with pointers.
> They are simple to catch and not essentials  for Small programs.
> If you are talking about managing variable with dynamically allocated storage then that's a different thing.


Write a program that will enter a name of any length and output the name, using the C programming language. We'll see how concerns can come out.


----------



## lovedonator (Apr 29, 2012)

And one more thing,Should I install Python 2.7.3 or Python 3.2.3? Because 'A byte of Python' has Python 2.3.4 as reference


----------



## Liverpool_fan (Apr 29, 2012)

lovedonator said:


> And one more thing,Should I install Python 2.7.3 or Python 3.2.3? Because 'A byte of Python' has Python 2.3.4 as reference



A Byte of Python has both 2.x and 3.x versions. If you're following Udacity, Python 2.x since they focus on Python 2.x themselves. Python 2.x is well supported too, so it's a good choice to begin with. 
And when you want to learn Python 3.x once you learn 2.x, this reference would be useful for you (easy to do, only thing to rememeber is Python3 is not backward compatible).
Dive Into Python 3


----------



## Sujeet (Apr 29, 2012)

Liverpool_fan said:


> Write a program that will enter a name of any length and output the name, using the C programming language. We'll see how concerns can come out.


Like a boss.eeh!?


> #include<iostream.h>
> #include<conio.h>
> int main()
> {
> ...


Thats C++ implementation BTW.


----------



## Liverpool_fan (Apr 29, 2012)

Not cool bro.


----------



## Sujeet (Apr 29, 2012)

Codes are not meant to be cool.


----------



## Liverpool_fan (Apr 29, 2012)

Wait, you were serious with that program?


----------



## $$Lionking$$ (Apr 29, 2012)

> A programming language is a tool. Every language is tailored for a particular task, with interfacing a high performance C library with a python program, we get best of both the worlds of ease of programming and performance. While C-only fools can fiddle with pointers and cleaning up memory, a clever programmer is building products using the best tools in hand.



Yes, these fools are generally found in MS, Google, EA etc.. You cud even find a whole bunch of these fools working on Free Software world over too!!... But you're clever!! Hahahaha!  



> So you don't have clue about what you post yourself. Maybe you should start reading your own posts?


No, I think you're too smart to understand the difference between fiddling with BIOS and fiddling with the services provided by it. I'm just another fool what to say!!!  




> "I need" to seek help, since you behave like a kiddo? Ok then.



I behave like a kiddo??? Well, I was expecting some mod(YOU) to behave like a cry baby and delete my post hence I had to mention it in block letters that I knew it was off topic and then I tried to bring the discussion back on track, but somehow you're still able to cry about it - Just extraordinary! 



> Oh dear.


Totally!!  



> The author is using entirely different data structures, array v lists and this is not entirely a fair test. And yes C is indeed much faster for number crunching and similar stuff but that's not the entire use case of a language especially for a beginner.



Yes, I understand, cry more!!! - That will make you right! 



> Programming is not about just number crunching, and certainly not with idiotic algorithms. And of course as I said you can always externally use an efficient implementation in C to achieve speed.



Programming is not about number crunching? You rockk dude!  



> You mean you are going somewhere else to troll and spread FUD. Tatty bye bye son.



No I just did not want to end up like you - 

*languagelog.ldc.upenn.edu/myl/llog/duty_calls.png

Njoi!  
I lose, you win! - Happy now?!


----------



## Liverpool_fan (Apr 29, 2012)

I thought you said you had a "life" and were going out of this thread.  . And your lol posts don't even deserve a reply. 
After all,


> Don't argue with idiots. They'll drag you down to their level and beat you...



Jog on, son.


----------



## $$Lionking$$ (Apr 29, 2012)

Liverpool_fan said:


> I thought you said you had a "life" and were going out of this thread.  . And your lol posts don't even deserve a reply.
> After all,
> 
> 
> Jog on, son.



So what you're saying is that you got me to come back here and then beat me with your experience??  

You got me there dude!!!


----------



## nims11 (Apr 29, 2012)

Sujeet said:


> Like a boss.eeh!?
> 
> ```
> [B]#include<iostream.h>
> ...



WTF dude!


----------



## ico (Apr 29, 2012)

Sujeet, after reading that code, I'd advise you to never claim yourself to be a C++ programmer.

Just a small example for uninformed ppl of what Python excels at:

An auto-login script (not mine) which is used to log-in to Reliance broadband. (useful for DD-WRT routers.) (yea, you have to log-in through a web-portal in Reliance)


```
#!/usr/bin/env python
# encoding: utf-8

import urllib2, urllib, cookielib

username = 'username'
password = 'password' 

jar = cookielib.FileCookieJar("cookies")
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))


response = opener.open("*10.239.89.15/reliance/startportal_isg.do")
login_data = urllib.urlencode({'userId' : username, 'password' : password, 'action' : 'doLoginSubmit'})

resp = opener.open('*10.239.89.15/reliance/login.do', login_data)
```

This is beginner stuff in Python actually. Now do it 50x faster in C.


----------



## Sujeet (Apr 29, 2012)

^^That was to show that you need not concern about pointers in a beginner program.



Liverpool_fan said:


> Wait, you were serious with that program?


Do you think i was?!!



ico said:


> Sujeet, after reading that code, I'd advise you to never claim yourself to be a C++ programmer.


Show me the light!
I think thats the simplest thing one can write if we neglect the basic principles of OOP.


----------



## Liverpool_fan (Apr 29, 2012)

Sujeet said:


> Do you think i was?!!


Yes. I am not not sure how to break it to you but your C++ concepts are a victim of exactly the stuff which i have concerns about the way a beginner will be misguided particularly in the background of the Indian education system. Please read my original post in sticky thread on C/C++.
Here is the link. *www.thinkdigit.com/forum/programmi...de-post-basic-questions-here.html#post1288801
Please read every word. Especially the post which follows it. Sincerely.   

Hint: Try compiling your "C++" program in on IDEone -> *ideone.com/


----------



## ico (Apr 29, 2012)

Sujeet said:


> ^^That was to show that you need not concern about pointers in a beginner program.


No man. Not at all.

conio.h? gets()?

It's wrong. Your code is not portable. It doesn't conform to ANSI C++ standard.

An ancient library like conio.h? A dreaded function like gets()?

Time to wake up. Turbo C++ is shite.

Things to Avoid in C/C++ -- gets() , Part 1 - GIDNetwork

What are your thoughts on getch() and void main()?


----------



## Sujeet (Apr 29, 2012)

^^Code was not meant to be portable in first place.
Secondly conio.h is standard library header file.
 cout.writleline and cin in place of gets and puts thats could have been used but for demo purpose does that matter.
I could have ran an entire loop to read each key individually and then you would have started complaining baout a "slow" program IMO.
firstly try compiling the program in a compiler if the program does anything stupid due to absence of getch() then you should complain
BTW from where did Turbo jump in/.


----------



## ico (Apr 29, 2012)

Sujeet said:


> *^^Code was not meant to be portable in first place.*
> *Secondly conio.h is standard library header file.*
> cout.writleline and cin in place of gets and puts thats could have been used but for demo purpose does that matter.




Say no more.



Sujeet said:


> BTW from where did Turbo jump in/.


From your code only.



			
				Wiki said:
			
		

> *conio.h is a C header file used in old MS-DOS compilers to create text user interfaces.* It is not described in The C Programming Language book, *and it is not part of the C standard library,* ISO C nor is it defined by POSIX.


----------



## Sujeet (Apr 29, 2012)

> #include  < iostream >
> using std::cin;
> using std::cout;
> using std::endl;
> ...


Just answer one more question.
Is this code also non ANSI compatble in your OPINION.
if yes then iam saying goodbye to this thread.
Visual Studio was use to compile it so dont bother about namespace sh#t.
Just say that i dont know c++.Please.I will be a happy guy once again.


BTW that code was compiled in Turbo honestly but it was from memory.Not written at hand.I didnt knew that conio.h doesn't come with IS0 C++ (That deserves a face palm for me seriously which apparently i have received few moments back )library and later i moved onto VC++ so never bothered to look back at it.But thats what a beginner will eventually get to learn IMO


----------



## ico (Apr 29, 2012)

Sujeet said:


> Just answer one more question.
> Is this code also non ANSI compatble in your OPINION.


Finally code which will work if you fix those spaces. < < 


Sujeet said:


> if yes then iam saying goodbye to this thread.


Shouldn't have said "Hi thread." in the first place.


----------



## Liverpool_fan (Apr 29, 2012)

This program is correct though you should really use std::string rather than char array but that's not a problem except you're making your life harder while handling strings.

Anyway you have proven my point.


----------



## Sujeet (Apr 29, 2012)

Got to learn something at least by saying Hi.
*@liverpool_fan* and the point was ....letme guess..emm ..c++ makes life sht..right>no offence meant.



Liverpool_fan said:


> *This program is correct though you should really use std::string* rather than char array but that's not a problem except you're making your life harder while handling strings.
> 
> Anyway you have proven my point.



The code has been wriitten in haste and frustration as you may have guessed  but still i tried to keep ba
lance not to let some noobishness creep in this time.



ico said:


> Finally code which will work if you fix those spaces. < <
> 
> Shouldn't have said "Hi thread." in the first place.



There were no spaces when i compiled it in VS.
Now There are spaces after every < or > even in header file statement.


----------



## Liverpool_fan (Apr 29, 2012)

The point there is a larger probability that the beginner programmer will get misguided and learn wrong syntax, use antiquated libraries, and develop very dangerous programming practices, due to the poor quality of teachers, and books which float around for them. And also being "lower level"; even if got right it will give a newbie too much power, something of which a beginner would not be able to correctly use either. Then there are complexities of compilers, undefined behaviour, compiler-specific behaviour, vendor specifiec libraries, which the programmer will inadvertedly misuse and base his/her skills upon.
Hence neither C or C++ are not at all a good choice for a beginner programmer. That doesn't mean they are bad languages. Quite the contrary in fact.


----------



## ico (Apr 29, 2012)

Just a re-emphasis:

*i.imgur.com/MAHP8.jpg

*i.imgur.com/zJo0i.jpg


----------



## Liverpool_fan (Apr 29, 2012)

And
*i.imgur.com/5Ls0Z.jpg


----------



## digit.sh (Apr 29, 2012)

I heard someone is writing an OS exclusively using python!! Poor Torvalds! There was no python that timeIf it was, he surely would write the process sceduler, memory management codes in python, cause its oh-so-easy to write 'portable' and working code with python! Hail python


----------



## Liverpool_fan (Apr 29, 2012)

And with that this thread is done. Threshold of retardness crossed.

Saner minds read this.
Why Python? | Linux Journal

P.S.: @OP, If you have any queries, feel free to start a new thread.


----------



## ico (Apr 30, 2012)

digit.sh said:


> I heard someone is writing an OS exclusively using python!! Poor Torvalds! There was no python that timeIf it was, he surely would write the process sceduler, memory management codes in python, cause its oh-so-easy to write 'portable' and working code with python! Hail python


This is Captain Obvious stuff. But you do realise, it's irrelevant to this thread? 

Fact is - we are dealing with a beginner here.

I started off with C/C++. Then learned PHP and a bit of Python. After learning a _bit_ of Python. Asked a simple question to myself - "why didn't I learn as my first language?" I consider myself a C/C++ programmer rather than Python. Same for Liverpool_fan.

Try explaining Lists in C to an absolute newbie. Now try explaining Lists in Python to someone. Append/Pop and all that. In fact, Head First Python begins with a topic like Lists.

You'll get the point - how "easy" it is in Python. How you don't have to deal with pointers/memory everytime.

May be you know Python. May be not.

Let people who know both be the fair judge.


----------



## celldweller1591 (May 9, 2012)

I would recommend Python and should go for 'Head First' books for programming languages (best for beginners).


----------



## Reaper_vivek (May 13, 2012)

This debate(fight) helped me a lot..I now have clear perspective of Python, always regarded it as a "not needed" language, but now I know what my next language is gonna be..

@Ico and @Liverpool_fan, u guys made my day


----------



## ico (May 15, 2012)

$$Lionking$$ said:


> This might clear your doubts too - Clearly the syntax is not so different and C is ~23x faster than python. ~3 seconds to do things that can be done in python in ~50 seconds.
> 
> Here -
> 
> ...


Do this in C, 23X faster:

**www.thinkdigit.com/forum/chit-chat/157002-contest-voting-thread.html* <=== votes.



nbaztec said:


> *Krow Vote Calc*
> *For real-time updates *



*Source code:* #1057 &bull; Text.Krow.Me


----------



## nbaztec (May 15, 2012)

Well from the looks of it - I'm late. :/

I won't get started on using gets()/getch()/conio, or the rather blasphemous statement of conio being a standard.
I won't get started on C being the almighty language of the Gods.
I wont get started on whether C's syntax is similar to Python...wait what?! Ok I just might...

Krow Vote Calc Source

```
vote_count = {}
    while page_index < page_count:
        url =  root_url[:-5]
        if page_index > 0:
            url += '-'+str(page_index+1)
        url += '.html'
        page_index += 1
        print url
        response = urllib2.urlopen(url)
        page = response.read()        
        response.close()
        parsed_page = BeautifulSoup(page)
        pat = re.compile("^post_message_.*")        
        page_count_txt = ''.join(parsed_page.find('div', attrs={'class': 'pagenav'}).find('td', attrs={'class': 'vbmenu_control'}).findAll(text=True));        
        page_count = int(page_count_txt[len(page_count_txt)-page_count_txt[::-1].index(' '):])
        
        
        result=parsed_page.findAll('div', attrs={'id': pat})[1:]

// Omitted for brevity
```

Now, does that look even remotely similar to C? (Please don't answer that -it's rhetorical)
I mean, sure, you can _print 'Hello Python'_ and _prinf('Hello C')_ and claim presto! They're roughly the same, while not even considering that C is a strongly typed language while Python is duck typed. Sheesh. If you still consider the syntax of both the languages is same, Ronaldo here wants to have a word with you:
*3.bp.blogspot.com/-HfgcRU7iVF4/TqLq3nHIwPI/AAAAAAAA-WM/fJe6pvuqaUI/s400/c%2Bronaldo%2Bfunny%2B%25281%2529.jpg

Well, know what I lied. I'm gonna pick up on speed now. You say C is fast - Really? You don't say. What gave it away? The fact that it is closer to ASM constructs or the fact that it's compiled? You don't need a fvking review/benchmark to know that C is faster than Python. Ok, I'll use your figures, 


> Clearly the syntax is not so different and C is ~23x faster than python. ~3 seconds to do things that can be done in python in ~50 seconds


When you finish your cookie, you might realize that you missed one thing - the programmer's plight.  Confused? Lemme rephrase.


> Clearly the syntax *is very* different and *writing programs in* C is ~23x *harder *than in python. ~50 seconds to do things that *are done* in python in ~3 seconds



I'd say, that sums it up. Sure C's faster but at an expense. You take more time to write programs in C than in Python. Same goes for debugging them too.

I'll admit I have a soft spot for C++ as it was the very first language I learnt, but the truth be told I no longer develop in it unless it absolutely calls for the very low level tasks (Low Level Hooks and stuff). When it's only a matter of learning logic, algorithms and getting accustomed to constucts - Python is easier than C/C++. Sure, anyone should then jump to C++ to experience what it is (a different beast in totality), but terming other languages as slow/bad/crap just goes to show the intellect of an individual. I'd quote it again (I happen to quote this a lot - oddly enough it fails to register on people)


> There are no good or bad languages but the right tools for the right job.


----------



## abhijangda (May 17, 2012)

nbaztec said:


> I mean, sure, you can _print 'Hello Python'_ and _prinf('Hello C')_ and claim presto! They're roughly the same, while not even considering that C is a strongly typed language while Python is duck typed.



Hey, wait a minute C is weakly not strongly typed. Python is strongly typed and duck typed too.


----------



## ico (May 17, 2012)

abhijangda said:


> Hey, wait a minute C is weakly not strongly typed. Python is strongly typed and duck typed too.


Read the sentence after the pic.


----------



## nbaztec (May 17, 2012)

abhijangda said:


> Hey, wait a minute C is weakly not strongly typed. Python is strongly typed and duck typed too.



When did I say otherwise? I just highlighted that it was duck-typed. Call it tip-toeing around the argument. 
Both are strongly typed. Python just has duck typing as a bonus.


----------

