DIGIT-ARC read-only archive · snapshot: July 23, 2026

Book For Beginner

56 posts · originally from https://geek.digit.in/community/threads/book-for-beginner.156195/

lovedonator
lovedonator Original post #1
Apr 28, 2012 at 12:04 PM
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
ritvij #2
Apr 28, 2012 at 1:07 PM
visit udacity.com and take their cs101 lesson.. its the best you can get and is way better than any ruddy book!
Sujeet
Sujeet #3
Apr 28, 2012 at 2:13 PM
^^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++.
S
sarthak #4
Apr 28, 2012 at 2:15 PM
Better start with C or C++.
nims11
nims11 #5
Apr 28, 2012 at 2:27 PM
its better to learn python as your first language.
Sujeet
Sujeet #6
Apr 28, 2012 at 3:09 PM
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 at 4:28 PM
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 at 4:36 PM
@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.
A
Apr 28, 2012 at 5:05 PM
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 at 12:03 AM
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
Sujeet #11
Apr 29, 2012 at 12:29 AM
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 at 12:31 AM
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++.

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
Sujeet #13
Apr 29, 2012 at 12:56 AM
There are better books.
I didnt say thats the best book!Did I?
Alternatives always exists.
Python does every bit as good in OOP as any of these languages.
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.
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.!

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 at 1:14 AM
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 at 1:58 AM
^
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.

:offtopic: 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 at 2:52 AM
^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.
skeletor
skeletor #17
Apr 29, 2012 at 7:42 AM
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 at 9:17 AM
I didnt say thats the best book!Did I?
All right.

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.


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.

^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.


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
nims11 #19
Apr 29, 2012 at 11:23 AM
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.

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
Sujeet #20
Apr 29, 2012 at 1:33 PM
With C/C++, just after a small bit of learning, you're going to spend most of your time with pointers/memory addressing

:rolleyes:
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 at 1:47 PM
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! :p

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 at 3:00 PM
Oh my god,I see that my question has started quite a debate here. :twisted:
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 at 3:43 PM
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! :p
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. :lol:
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.

:rolleyes:
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 at 3:43 PM
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 at 3:50 PM
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
Sujeet #26
Apr 29, 2012 at 4:22 PM
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()
{
char name[];
cout<<"Enter name";
gets(name);
cout<<"The name you entered is";
puts(name);
return 0;
}
Thats C++ implementation BTW.
Sujeet
Sujeet #28
Apr 29, 2012 at 4:25 PM
Codes are not meant to be cool.
Liverpool_fan
Apr 29, 2012 at 5:09 PM
Wait, you were serious with that program?
$$Lionking$$
Apr 29, 2012 at 5:24 PM
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! :D

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!!! :D


"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! :)

Totally!! :D

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! :D

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! :D
I lose, you win! - Happy now?! :D
Liverpool_fan
Apr 29, 2012 at 5:31 PM
I thought you said you had a "life" and were going out of this thread. :lol: . 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. :lol:
$$Lionking$$
Apr 29, 2012 at 5:53 PM
I thought you said you had a "life" and were going out of this thread. :lol: . And your lol posts don't even deserve a reply.
After all,


Jog on, son. :lol:

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!!! :D
nims11
nims11 #33
Apr 29, 2012 at 6:02 PM
Like a boss.eeh!?
Code:
[B]#include<iostream.h>
#include<conio.h>
int main()
{
char name[];
cout<<"Enter name";
gets(name);
cout<<"The name you entered is";
puts(name);
return 0;
}[/B]
Thats C++ implementation BTW.

WTF dude!
skeletor
skeletor #34
Apr 29, 2012 at 6:52 PM
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)

Code:
#!/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. :lol:
Sujeet
Sujeet #35
Apr 29, 2012 at 7:39 PM
^^That was to show that you need not concern about pointers in a beginner program.

Wait, you were serious with that program?
Do you think i was?!!

Sujeet, after reading that code, I'd advise you to never claim yourself to be a C++ programmer.
Show me the light!:wink:
I think thats the simplest thing one can write if we neglect the basic principles of OOP.
Liverpool_fan
Apr 29, 2012 at 7:40 PM
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/
skeletor
skeletor #37
Apr 29, 2012 at 7:41 PM
^^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
Sujeet #38
Apr 29, 2012 at 7:51 PM
^^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/.
skeletor
skeletor #39
Apr 29, 2012 at 7:56 PM
^^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.
:facepalm:

Say no more.

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
Sujeet #40
Apr 29, 2012 at 7:59 PM
#include < iostream >
using std::cin;
using std::cout;
using std::endl;

int main()
{
const int MAX(80);
char buffer[MAX];
char* pbuffer(buffer);

cout < < endl
< < "Enter a string of less than "
< < MAX < < " characters:"
< < endl;

cin.getline(buffer, MAX, '\n');
while(*pbuffer)
pbuffer++;
cout < < endl
< < "The string \"" < < buffer
< < "\" has " < < pbuffer - buffer < < " characters.";
cout < < endl;

return 0;
}
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
skeletor
skeletor #41
Apr 29, 2012 at 8:10 PM
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. < < :)
if yes then iam saying goodbye to this thread.
Shouldn't have said "Hi thread." in the first place. :)
Liverpool_fan
Apr 29, 2012 at 8:11 PM
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
Sujeet #43
Apr 29, 2012 at 8:18 PM
Got to learn something at least by saying Hi.:smile:
@liverpool_fan and the point was ....letme guess..emm ..c++ makes life sht..right>no offence meant.:smile:

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.

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 at 8:19 PM
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.
skeletor
skeletor #45
Apr 29, 2012 at 9:56 PM
Just a re-emphasis:

*i.imgur.com/MAHP8.jpg

*i.imgur.com/zJo0i.jpg
Liverpool_fan
Apr 29, 2012 at 10:17 PM
And
*i.imgur.com/5Ls0Z.jpg
digit.sh
digit.sh #47
Apr 29, 2012 at 10:45 PM
I heard someone is writing an OS exclusively using python!! Poor Torvalds! There was no python that time:cry:If 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:mrgreen:
Liverpool_fan
Apr 29, 2012 at 10:59 PM
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.
skeletor
skeletor #49
Apr 30, 2012 at 9:41 AM
I heard someone is writing an OS exclusively using python!! Poor Torvalds! There was no python that time:cry:If 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:mrgreen:
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 at 10:17 PM
I would recommend Python and should go for 'Head First' books for programming languages (best for beginners).
Reaper_vivek
May 13, 2012 at 4:01 AM
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 :D
skeletor
skeletor #52
May 15, 2012 at 6:15 PM
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!!! :)
Do this in C, 23X faster:

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

Krow Vote Calc
For real-time updates :p

Source code: #1057 &bull; Text.Krow.Me
nbaztec
nbaztec #53
May 15, 2012 at 6:51 PM
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
PHP:
 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.
A
May 17, 2012 at 3:50 PM
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.
nbaztec
nbaztec #56
May 17, 2012 at 3:56 PM
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.