Status
Not open for further replies.

Liverpool_fan

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

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

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

Super Moderator
Staff member
Just a re-emphasis:

*i.imgur.com/MAHP8.jpg

*i.imgur.com/zJo0i.jpg
 

digit.sh

Journeyman
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

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

Super Moderator
Staff member
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.
 

Reaper_vivek

BAN...KAI
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
 

ico

Super Moderator
Staff member
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

Master KOD3R
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.
 
Last edited:

abhijangda

Padawan
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

Master KOD3R
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.
 
Status
Not open for further replies.
Top Bottom