fan_eunice: (Default)
fan_eunice ([personal profile] fan_eunice) wrote2015-04-10 02:36 pm

Adventures in Python and Pi(e)

Goal: post daily, even if it's just a 'yup, still here' message.

I warn in advance, the way I am coping with a lot of my brain stuff is super random so if there is subject matter it is likely to be all over the place on any given day. Also, probably boring. Sorry? I plan to (subject to change, because who knows when a long whiny post about being crazy might suddenly seem like a good and cathartic idea) not post about the brain stuff itself, though.

Today it's programming. Specifically that programming has been added to my list of 'stuff I'd like to learn'. That's a long list, which I tend to jump around a lot on, getting obsessive for awhile and then jumping to something else on the list for awhile and then jumping back and ending up with a lot of 'knows a little about a lot' rather than a lot about anything, but anyhoo. I like to learn stuff?

Python is my starting point, and so far I'm having fun even though I have not progressed much beyond "Hello, world!". Current observation on learning materials for beginning programmers: oh my god, y'all, not all of us want to learn programming because we are also math geeks. Some of us enjoy logic and problem solving but loaaaathe math.

So making so many of your beginning examples with the assumption that I either already know how to do shit like calculate the angle of a polygon on paper, or would ever want to is a bit counterproductive. If you're me. Because the actual concept you're trying to teach me has nothing to do with calculating the radius of a circle and everything to do with being able to translate 'thing I know I want the computer to do' into 'the language I use to tell the computer so it understands to do the thing'.

If I don't know how to do or understand the thing you want me to want the computer to do, I'm going to spend half my time trying to figure out what doing that thing looks like so I can then tell the computer to do it, and that leads to me crying into my variables whimpering 'No seriously, I only care about pi when it's being used as a a joke about Dean Winchester and snacks' and then it takes me twice as long to get to the part where I understand how to tell the computer to do a thing. So:
def dean_wants_pie(tasty_treat):
    if tasty_treat=="pie":
        print("No more single manpain tears, PIE FIXES EVERYTHING")
    else:
        print("Dean hates you now")

dean_wants_pie(input("What kind of tasty treat do you have?"))


Makes TOTAL sense to me if it was an example (it...actually works when I run it through the interpreter, though I'm sure I did something wrong or I could make it much cooler if I knew more, and as it stands if the hypothetical user typed in 'blueberry pie' instead of just 'pie' at this point Dean would erroneously be hating on them. But you notice how there's NO MATH, and yet I made the computer do a thing? I wish more programming resources embraced this concept. Perhaps with less manpain tears. But definitely more pie.

Anyhoo, this is your random ramble on my adventures in learning to program today.
frayadjacent: peach to blue gradient with the silouette of a conifer tree (!ooh shiny)

[personal profile] frayadjacent 2015-04-10 09:40 pm (UTC)(link)
So, I have a degree in physics, but this irritates me too! Because a fair number of programming examples involve math that is fun for math geeks, which I also am not even though I'm comfortable with math, and not at all the kind of math that physical sciences types do. I don't give a shit about Pascal's triangle and examples like that frustrate me for similar reasons! So, basically what I'm saying is I feel your pain.

I like your program! :D Once you learn about indexing you could have it check if the last 3 characters of the input are "pie", which is not a perfect solution (someone could enter "pies" and get the wrong response) but it might be heading in the right direction?
nonelvis: (Default)

[personal profile] nonelvis 2015-04-10 09:49 pm (UTC)(link)
I think programmers tend to assume they're speaking to other programmers, which is the exact opposite of helpful in your situation. But FWIW, I've been teaching design students responsive web coding and basic jQuery this term, and not one of my examples has to do with math. (Which is good, because the examples that do involve even a tiny bit of math have made their eyes glaze over.)

… of course, I am not actually a programmer myself, which may have something to do with my approach ;)

Anyway, If you ever want to learn Foundation or jQuery, let me know, and I'll be happy to email you my code samples and talk you through things. Just, er, not until Project From Hell is over.
kass: Eleven and Amy hug. (hug)

[personal profile] kass 2015-04-10 10:59 pm (UTC)(link)
Hi! *hug*
killabeez: (kitties snuggle)

[personal profile] killabeez 2015-04-10 11:11 pm (UTC)(link)
*sneaks in and glomps you!*
laurashapiro: a woman sits at a kitchen table reading a book, cup of tea in hand. Table has a sliced apple and teapot. A cat looks on. (Default)

[personal profile] laurashapiro 2015-04-10 11:21 pm (UTC)(link)
I am so glad to see you! I've been thinking of you often, hoping you're feeling better and finding ways to have fun. :: hugs you up ::

Wow, programming! I am mightily impressed. Always knew you were super smart.
heresluck: (Default)

[personal profile] heresluck 2015-04-11 01:35 am (UTC)(link)
Learning programming is fun! Not that I have tried anything anywhere near as complicated as Python, but in principle, I feel you. Also, your example cracks me up. :D

grammarwoman: (Default)

[personal profile] grammarwoman 2015-04-11 05:22 am (UTC)(link)
Preach it, sister! I majored in Comp Sci, but the math classes almost sunk me (calculus suuuuuuucks), so trust me when I say you can go far without a love or talent for math. Logic is much more useful, all about the if clauses.

Programming is so much fun, IMHO, and I'm lucky enough to have made a living from it, so feel free to ask me stuff.

Ooo! If you want to learn how to code websites using HTML, CSS, and Javascript, check out Dash. It's a simple, step-by-step approach to programming, using concrete examples with immediate results, and a minimum of math. The language can be a little ra-ra at times, but I love the positive "you can do it!" attitude.
echan: rainbow arch supernova remnant (Default)

[personal profile] echan 2015-04-12 08:15 am (UTC)(link)
Hi!

I recently had to learn some python quick-like for my job. I used "python the hard way" which is kinda misnamed; in my opinion it is kinda like the immersion way of learning a foreign language, every lesson just has you doing it, and bit by bit you learn it in pieces. Python is fairly popular lately; personally I find it a bit painful but useful for some things.
jetpack_monkey: (Default)

[personal profile] jetpack_monkey 2015-04-12 08:48 pm (UTC)(link)
*drive-by hugs*

Learning Python is awesome! (is a PHP geek himself)