Status
Not open for further replies.

$$Lionking$$

In the zone
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!!! :)
 
OP
lovedonator

lovedonator

Ambassador of Buzz
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

Sami Hyypiä, LFC legend
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.
 
OP
lovedonator

lovedonator

Ambassador of Buzz
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

Sami Hyypiä, LFC legend
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

Undead!!!
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.
 

$$Lionking$$

In the zone
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

Sami Hyypiä, LFC legend
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$$

In the zone
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

BIOS Terminator
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

Chosen of the Omnissiah
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

Undead!!!
^^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

Sami Hyypiä, LFC legend
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

Chosen of the Omnissiah
^^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

Undead!!!
^^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

Chosen of the Omnissiah
^^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

Undead!!!
#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
 
Last edited:
Status
Not open for further replies.
Top Bottom