Author Topic: Learning to Code  (Read 4134 times)

0 Members and 1 Guest are viewing this topic.

Online The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Frequent Poster
  • *****
  • Posts: 3935
Re: Learning to Code
« Reply #30 on: January 29, 2017, 04:56:33 PM »
You get through the whole book you'll know more programming than I do.

That was my primary motivation in learning to code. ;)
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline superdave

  • Stopped Going Outside
  • *******
  • Posts: 4910
  • My name is not dave.
Re: Learning to Code
« Reply #31 on: January 29, 2017, 05:04:29 PM »
You get through the whole book you'll know more programming than I do.

That was my primary motivation in learning to code. ;)

It's not that high a bar...but I'm happy if you get there!
One of the great things about coding is that it doesn't take that long to get up to a pretty functional* level.


*no pun intended.

Offline werecow

  • Cryptobovinologist
  • Frequent Poster
  • ******
  • Posts: 3219
  • mooh
Re: Learning to Code
« Reply #32 on: January 29, 2017, 05:07:32 PM »
You get through the whole book you'll know more programming than I do.

Programming is more than just knowing syntax and basic data structures though. Developing an intuition about how to use those data structures and how to separate and refactor different parts of your code to keep it modular, maintainable, readable, and to maintain a proper separation of concerns takes much more time (and that's also why the precise language is less important than the way of thinking).
Mooohn!

Online The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Frequent Poster
  • *****
  • Posts: 3935
Re: Learning to Code
« Reply #33 on: January 29, 2017, 07:01:12 PM »
You get through the whole book you'll know more programming than I do.

Programming is more than just knowing syntax and basic data structures though. Developing an intuition about how to use those data structures and how to separate and refactor different parts of your code to keep it modular, maintainable, readable, and to maintain a proper separation of concerns takes much more time (and that's also why the precise language is less important than the way of thinking).

That's what I like about "Think Python": its exercises are designed in such a way that they build on each other and allow you to reuse code and functions.  If you do them all in order, you really start to see the benefits of modular structures and breaking down problems into their parts. I'm already importing functions from previous homework exercises into my programs.

And Python is great because it forces you to write in readable ways with its indented code blocks; and I doubt it would be particularly hard to start surrounding code blocks in braces if I pick up a second language.
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline werecow

  • Cryptobovinologist
  • Frequent Poster
  • ******
  • Posts: 3219
  • mooh
Re: Learning to Code
« Reply #34 on: January 29, 2017, 07:23:44 PM »
You get through the whole book you'll know more programming than I do.

Programming is more than just knowing syntax and basic data structures though. Developing an intuition about how to use those data structures and how to separate and refactor different parts of your code to keep it modular, maintainable, readable, and to maintain a proper separation of concerns takes much more time (and that's also why the precise language is less important than the way of thinking).

That's what I like about "Think Python": its exercises are designed in such a way that they build on each other and allow you to reuse code and functions.  If you do them all in order, you really start to see the benefits of modular structures and breaking down problems into their parts. I'm already importing functions from previous homework exercises into my programs.

And Python is great because it forces you to write in readable ways with its indented code blocks; and I doubt it would be particularly hard to start surrounding code blocks in braces if I pick up a second language.

Whenever I switch from Java to Python, I keep adding {}s and ;s to all my code blocks and lines. And when I switch back, I keep adding :s to my function and class declarations. But that only lasts for a few days. }|xop
I do like python's forced readability, but be careful to be consistent and not to mix up your tabs and spaces (just don't use tabs/auto-replace them by 3 or four spaces), because that can be really annoying.
Mooohn!

Offline Johnny Slick

  • "Goddammit, Slick."
  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 11990
  • Fake Ass Skeptic
Re: Learning to Code
« Reply #35 on: January 29, 2017, 07:25:09 PM »
Wow. WOW.

DO NOT LISTEN TO THIS CHARLATAN ALWAYS USE TABS
Speak what you think now in hard words, and to-morrow speak what to-morrow thinks in hard words again, though it contradict every thing you said to-day.

- Ralph Waldo Emerson

Offline werecow

  • Cryptobovinologist
  • Frequent Poster
  • ******
  • Posts: 3219
  • mooh
Re: Learning to Code
« Reply #36 on: January 29, 2017, 07:36:58 PM »
Wow. WOW.

DO NOT LISTEN TO THIS CHARLATAN ALWAYS USE TABS

Them's fightin' words!

Mooohn!

Online The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Frequent Poster
  • *****
  • Posts: 3935
Re: Learning to Code
« Reply #37 on: January 29, 2017, 08:42:59 PM »
Wow. WOW.

DO NOT LISTEN TO THIS CHARLATAN ALWAYS USE TABS

I'm using PyCharm.  I tab to indent and backspace to de-indent, but it actually inserts 4 spaces per indent level instead of using tabs.  That's in accordance with PEP 8, which eschews the use of tabs except for consistency in legacy code.
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Online PANTS!

  • One leg at a time.
  • Reef Tank Owner
  • *********
  • Posts: 9123
  • What seals? I auditioned for this job.
Re: Learning to Code
« Reply #38 on: January 29, 2017, 09:19:53 PM »
So I've now worked through Chapter 10 (Lists) and I'm on to Chapter 11 (Dictionaries).  As I go, I'm realizing what everyone means when they talk about language being almost irrelevant.  The biggest revelation to me is just how few the essential instructions of a computer language are, and how common they are to all languages.  It's been an enlightening process.

Now off to code a program to find words whose pronunciations don't change when you remove either their first or second letters.

I think some Mathematicians boiled it down to 3 essential instructions.  All else is fluff.  Pretty useful fluff, mind you.
Now where I come from
We don't let society tell us how it's supposed to be
-Uptown, Prince 👉

We cross our bridges when we come to them and burn them behind us, with nothing to show for our progress except a memory of the smell of smoke, and a presumption that once our eyes watered.

Online PANTS!

  • One leg at a time.
  • Reef Tank Owner
  • *********
  • Posts: 9123
  • What seals? I auditioned for this job.
Re: Learning to Code
« Reply #39 on: January 29, 2017, 09:21:43 PM »
Wow. WOW.

DO NOT LISTEN TO THIS CHARLATAN ALWAYS USE TABS

Them's fightin' words!

Wait, I had not even considered that someone might use spaces.  This is like when I learned that some people lie about standing up to wipe their ass.
Now where I come from
We don't let society tell us how it's supposed to be
-Uptown, Prince 👉

We cross our bridges when we come to them and burn them behind us, with nothing to show for our progress except a memory of the smell of smoke, and a presumption that once our eyes watered.

Offline werecow

  • Cryptobovinologist
  • Frequent Poster
  • ******
  • Posts: 3219
  • mooh
Re: Learning to Code
« Reply #40 on: January 29, 2017, 09:32:37 PM »
Wait, I had not even considered that someone might use spaces.

You people are barbarians.
Mooohn!

Offline superdave

  • Stopped Going Outside
  • *******
  • Posts: 4910
  • My name is not dave.
Re: Learning to Code
« Reply #41 on: January 30, 2017, 09:31:25 AM »
So I've now worked through Chapter 10 (Lists) and I'm on to Chapter 11 (Dictionaries).  As I go, I'm realizing what everyone means when they talk about language being almost irrelevant.  The biggest revelation to me is just how few the essential instructions of a computer language are, and how common they are to all languages.  It's been an enlightening process.

Now off to code a program to find words whose pronunciations don't change when you remove either their first or second letters.

I think some Mathematicians boiled it down to 3 essential instructions.  All else is fluff.  Pretty useful fluff, mind you.

standard indent for python is 4 spaces.

but i believe, and i could be wrong, that all you need for a fully functional programming language are variables, loops and if statements.

Online The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Frequent Poster
  • *****
  • Posts: 3935
Re: Learning to Code
« Reply #42 on: January 31, 2017, 09:02:05 PM »
I'm in Chapter 13, now.  One thing I've noticed which is probably obvious but I think worth noting anyway: it's very important to plan ahead before starting in on a problem. I've started breaking down the problem into small parts that are logically one step before I start, defining the functions and arguments and documenting what I plan for each to do in a docstring before I code a single function (I use a pass instruction as a placeholder).  I can then tackle, code, and test each function independently before trying to integrate everything.
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell

Offline Johnny Slick

  • "Goddammit, Slick."
  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 11990
  • Fake Ass Skeptic
Re: Learning to Code
« Reply #43 on: January 31, 2017, 11:22:33 PM »
Yeah, that's one of the big paradigm shifts you make when you learn to code. You start with a big project, break it down into components, and then keep breaking it down and breaking it down until you've got a bunch of tiny, easily manageable parts. In fact, one of the great things about functional and OOP is that once you've written something and tested it out, you can treat that thing like a black box and never really have to worry about what it's doing on a daily basis again (well, until something breaks it but that's another story for another time).
Speak what you think now in hard words, and to-morrow speak what to-morrow thinks in hard words again, though it contradict every thing you said to-day.

- Ralph Waldo Emerson

Online The Latinist

  • Cyber Greasemonkey
  • Technical Administrator
  • Frequent Poster
  • *****
  • Posts: 3935
Re: Learning to Code
« Reply #44 on: February 01, 2017, 07:48:17 PM »
Yeah, that's one of the big paradigm shifts you make when you learn to code. You start with a big project, break it down into components, and then keep breaking it down and breaking it down until you've got a bunch of tiny, easily manageable parts. In fact, one of the great things about functional and OOP is that once you've written something and tested it out, you can treat that thing like a black box and never really have to worry about what it's doing on a daily basis again (well, until something breaks it but that's another story for another time).

I'm seeing that already with my code.  Again, that's one of the reasons I like this book so much: the exercises are structured in such a way that I am constantly able to functions I've perfected in previous lessons.
I would like to propose...that...it is undesirable to believe in a proposition when there is no ground whatever for supposing it true. — Bertrand Russell