Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

python, how?!

Name: Anonymous 2008-11-30 10:45

hi.
i want to learn programming, but in my area there ain't anybody that can help me, so i want to ask for something only, kind of beginners book, or anything, and in a language that is powerfull. i heard of python, but i dont know anything about this. help?

Name: Anonymous 2008-11-30 10:50

Structure and Interpretation of Computer Programs is a great place to start.  It teaches the fundamentals of computing.

http://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering/dp/0262011530

Name: Anonymous 2008-11-30 10:57

>>2
Enough. I am tired of this unscientific and ultimately destructive worship of SICP. Begone.

Name: Anonymous 2008-11-30 11:38

>>3
 How dare you!
 
 I challenge you to a bbcode fight.

Name: Anonymous 2008-11-30 12:06

1. DL Python
2. Install it
3. Read docs
4. ????
5. [b] [i] [u] EXPERT PYTHON PROGRAMMER [/b] [/i] [/u]

Name: Anonymous 2008-11-30 12:10

in my area there ain't anybody that can help me
ain't anybody

We speak proper English on this board son.

But yea, learn you a Python. Maybe learn you a Google first.

Name: Anonymous 2008-11-30 12:23

Read SICP.

Name: Anonymous 2008-11-30 12:34

Name: Anonymous 2008-11-30 13:06

Name: Anonymous 2008-11-30 14:02

in my area there ain't anybody that can help me

I can see why

Name: Anonymous 2008-11-30 16:54

>>1
ain't anybody
I do believe you meant to say, "ain't nobody". Anyway, yeah, learn Python. It's better than whatever your second choice was going to be.

Name: Anonymous 2008-11-30 19:44

NO

Learn C++ first.  It will teach you computer concepts much better then python.

Name: Anonymous 2008-11-30 20:18

>>6
We speak proper English on this board son.

>>12
much better then python

Name: Anonymous 2008-11-30 20:33

>>13
What >>12 is trying to say is that Sepples will teach you computer concepts much better, then [you should move on to] FIOC

Name: Anonymous 2008-11-30 21:09

>>14
Doesn't make any more sense.

Name: Anonymous 2008-11-30 21:49

>>15
It does when you consider the fact that YHBT

Name: Anonymous 2008-11-30 23:11

>>16
ohhh, now I see it

Name: Anonymous 2008-12-01 0:47

>>14
After all, why start with a middling quality language when you could learn important computer concepts such as "fuck this compiler", boilerplate, "why won't the damn thing work", "segfault", "in retrospect, that's still totally bonkers", and the syntax guessing game.

Name: Anonymous 2008-12-01 1:01

>>18
lol, but also truth

Name: Anonymous 2008-12-01 1:04

Countless hours of debugging is how programming prodigies are made.

Name: Anonymous 2008-12-01 1:09

I haven't programmed in a long ass time and I was afraid that I was getting rusty and decided to try to write a maze generator (prim's algorithm) in python a few days ago.
I wasn't successful but I learned a lot about how much I suck and how much I have to relearn and that little things that I'm used to doing the C++/C# way are really awkward in other languages

Name: Anonymous 2008-12-01 1:31

>>21
the C++/C# way are really awkward
Agreed.

Name: Anonymous 2008-12-01 1:34

>>18
I love me sum syntax guessing game.

Name: Anonymous 2008-12-01 1:37

>>21
>and that little things that I'm used to doing the C++/C# way are really awkward in other languages
This.
High-level languages are still awkward for me because of this, because I've learned not to trust a language helping me in any way, and doing it all by myself.
I'm also somewhat of a speed-kiddie, a habit which I've been trying to drop.

This is why it's important to start with a higher level language and not with C/ASM.

Name: Anonymous 2008-12-01 3:01

>>24
I've learned not to trust a language helping me in any way, and doing it all by myself.
That must be awful. Though I'm not sure I'd trust Sepples to do things for me either.

Name: Anonymous 2008-12-01 3:10

>>22
>>24
Example
The typical C/C++/C#/Java for loop idiom where you're going over an array and doing shit with it

int i;
for (i = 0;i < SomeUpperLimit;++i) {
  // gay nigger cocks
  transmogrify(AllThemDoodads[i]);
}

in Python you're going to be iterating over lists a lot, as a Python newfag you're going to naively write something like this
for i in range(SomeUpperLimit):
   # Chink jew vaginas
   dostuff('with', 'things', AllThemDoodads[i])

range(SomeUpperLimit) produces a huge list of however many integers you need and you'll end up wasting a shit-ton instead memory as a novice python programmer and people on IRC will make fun of if you do this because they're dicks
xrange(SomeUpperLimit) would be better because it's a generator that just returns another successive integer every time, but that's not 'Pythonic' enough, as python fags would call it. We can do even better.
for doodad in AllThemDoodads:
   # Ass dick kike
   dostuffwith(doodad) # lol look at this fag shit

Name: Anonymous 2008-12-01 3:15

Wow, Python is kind of shitty. Back to Lisp, please.

Name: Anonymous 2008-12-01 3:18

>>27
Lisp because you're a gay fag. Go to the Castro and suck gay furry nerd cock

Name: Anonymous 2008-12-01 3:30

>>26
C#
foreach (var i in list) {
    doStuff(i);
}

or

list.ForEach(i => doStuff(i));

Name: Anonymous 2008-12-01 3:35

26 here, more on that

So anyway I have a bunch of doodads and I only want to work on SOME of them, the others I just skip over. How the fuck should I work this?

First attempt

for doodad in AllThemDooDads:
   if not DoIReallyWantToWorkOnThis(doodad):
      continue # I don't, skip
   WorkOnThis(doodad)

That shit can eat my balls! Let's try again

for doodad in filter(DoIReallyWantToWorkOnThis, AllThemDooDads):
   WorkOnThis(doodad)

filter returns a list where the function calling DoIReallyWantToWorkOnThis on each element (doodad) in the list called AllThemDooDads is True

But that looks like ass! I thought Python was supposed to be elegant!! there exists a easy-to-read elegant way to do this but my mom's calling me for dinner so I leave it as is for now which works but is ugly as shit

Name: Anonymous 2008-12-01 3:48

for doodad in allthem
    wanttowork(doodad) and workon(doodad)

?

Name: Anonymous 2008-12-01 4:03

>>30

for doodad in all_them_doodads:
   if i_really_want_to_work_on_this(doodad):
      work_on_this(doodad)


is the idiomatic Python version, like it or not. If we want to get all functional, we can of course

[work_on_this(doodad) for doodad in all_them_doodads if i_really_want_to_work_on_this(doodad)]

or

map(work_on_this, filter(i_really_want_to_work_on_this, all_them_doodads))

provided the functions are redefined in a non-destructive way. There are no better FIOC solutions, and >>31 is a fucking moron.

Name: Anonymous 2008-12-01 4:11

>>32
>>31 is a fucking moron.
Well, well. Mad you didn't think of it, eh?

Name: Anonymous 2008-12-03 2:39

Name: Anonymous 2008-12-03 16:56

>>34

the only thing funny about that is the use of '[i][b][u][sup]bracist[sup][/u][/b][/i]'

Name: Anonymous 2008-12-03 21:37

if you want to learn something easy as fuck, go for Visual Basic. if you want something decent but simple to learn, Perl. Python has a funky syntax compared to other languages. i suggest Visual Basic for its simplicity.

Name: Anonymous 2008-12-03 21:40

>>36
1/10

Name: Anonymous 2008-12-03 23:42

>>37
4/10

Name: Anonymous 2008-12-03 23:52

>>36
0/10

Name: Anonymous 2008-12-04 0:25

>>39
the fuck on

Name: Anonymous 2009-02-25 7:23


The day that what   I think is   automatically transformed into   an application I   will always be   writing what I   think is automatically   transformed into an   infinite meme loop.

Name: Anonymous 2009-02-25 7:27

>>40
Back to /lounge/, please.

Name: Trollbot9000 2009-07-01 8:42


Nya nyan nya nyanya.

Name: ​​​​​​​​​​ 2010-10-26 12:35


Don't change these.
Name: Email:
Entire Thread Thread List