Re: Programming Advice Bleg, Ctd.

1

Ok, I'll comment in ogged's thread. Is ogged switching careers? I thought he was making traction as a professional blogger. Case of writer's block?


Posted by: text | Link to this comment | 01-16-14 12:53 PM
horizontal rule
2

Algorithms in C by Sedgewick. I liked Stevens' Unix book a lot, very helpful in thinking through a bunch of IPC issues. I don't know that either would help in writing an IOS app though.

For me, there's a tradeoff between just trusting some complex API and thinking about what the machine is doing. I always feel that this is a weakness, it should be possible to manage both perspectives simultaneously.


Posted by: lw | Link to this comment | 01-16-14 12:57 PM
horizontal rule
3

Have a look at the Python tutorial. It covers most of the things you'd want to know about, coming from another language, so looking at the topics it discusses should help you figure out the abstractions that make up most programming languages.

I will say that, at the level you're at right now, and given what you probably want to do, looking at algorithms is a waste of time. Once you've been coding for a while, it'll be worth it to go back and look at them so that you understand the underlying principles of the tools you've been working with (same with design patterns), but for right now you almost certainly don't need them.


Posted by: Josh | Link to this comment | 01-16-14 12:58 PM
horizontal rule
4

Read-eval-print loops are nice.


Posted by: nosflow | Link to this comment | 01-16-14 12:58 PM
horizontal rule
5

don't know that either would help in writing an IOS app though

Doesn't matter! On the contrary, being able to do other stuff is part of the point.


Posted by: ogged | Link to this comment | 01-16-14 12:58 PM
horizontal rule
6

4 gets is exactly right. Your workflow should almost always be to have a file open in one window and a REPL in another. It's like interactive debugging before you ever actually try to run your entire programming.


Posted by: Josh | Link to this comment | 01-16-14 1:01 PM
horizontal rule
7

I don't think they exist for Objective-C, though I could be wrong about that.


Posted by: nosflow | Link to this comment | 01-16-14 1:02 PM
horizontal rule
8

being able to do other stuff is part of the point.

I suppose in a similar vein learning to program might give you something to write about, if you're lacking.


Posted by: text | Link to this comment | 01-16-14 1:03 PM
horizontal rule
9

My programming style is to google what it is
I want to do and then cut, paste, and tweak what I find. I've written fairly large and complicated bits of code this way. The key is to add a buttload of comments to the borrowed code so that you can figure out what you're trying to do when you come back to it six months later.

In a sort of answer to your question I've heard "C by example" is helpful. Plus it has lots of code you can steal borrow.


Posted by: togolosh | Link to this comment | 01-16-14 1:04 PM
horizontal rule
10

I'm not sure I ever knew the REPL term but yeah, do things that way. Much harder with compiled languages.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 1:05 PM
horizontal rule
11

Definitely for app development in objective C (assuming you aren't doing something that's incredibly high performance) maximizing stealing is going to be important.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 1:05 PM
horizontal rule
12

Oh yeah, and if you're going to be working in a compiled language, find a good IDE and use it. It will save you massive amounts of time and energy, from automatic code generation to code browsing.

And possibly the most important bit of advice I can give you: FIND A CODE STYLE AND STICK WITH IT. There is *nothing* worse than trying to read inconsistently-formatted code, and it will make your life hell when you're trying to debug things later. (Most IDEs will do code style checking for you.)


Posted by: Josh | Link to this comment | 01-16-14 1:06 PM
horizontal rule
13

to square
repeat 4 [forward 50 right 90]
end


Posted by: SP | Link to this comment | 01-16-14 1:09 PM
horizontal rule
14

The key is to add a buttload of comments to the borrowed code so that you can figure out what you're trying to do when you come back to it six months later.

Possibly as important as having a consistent code style.


Posted by: Josh | Link to this comment | 01-16-14 1:10 PM
horizontal rule
15

This might be too baby school even for ogged but informative variable names and consistently applied version tracking (however you do it) are of course teh vital.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 1:12 PM
horizontal rule
16

informative variable names

I have lots of strong opinions about variable names. Informative, yes, but only reasonably so. For years after SAS started allowing longer names, I still tried to keep them all to eight characters. I don't do that anymore, but I still get annoyed when somebody calls a variable something like "The_one_where_we_recoded_by_Jones_criteria."


Posted by: Moby Hick | Link to this comment | 01-16-14 1:15 PM
horizontal rule
17

Informative program and output names are helpful too.

I've sifted through way too many emails in my inbox at work with attachments labeled "code.sas" or "report.xls", trying to find one particular thing someone sent me..


Posted by: Benquo | Link to this comment | 01-16-14 1:18 PM
horizontal rule
18

FIND A CODE STYLE AND STICK WITH IT
I've modified so many other people's code, I've forgotten what my style used to be.


Posted by: Eggplant | Link to this comment | 01-16-14 1:18 PM
horizontal rule
19

Find a linter and use it -- this may not apply if you're using XCode, which I think has one baked in. Check out things like Project Euler or Rosetta Code as bite-sized problems for learning a language and figuring out idiomatic ways in language $foo for solving common problems.


Posted by: snarkout | Link to this comment | 01-16-14 1:19 PM
horizontal rule
20

Learn to use a version control system, probably git.


Posted by: snarkout | Link to this comment | 01-16-14 1:19 PM
horizontal rule
21

I'm identifying what needs to be done, dimly recalling that my Objective C book had something that sounded relevant, checking the index or googling, and then figuring out how to apply the method to my situation.

This is a huge part of my development workflow, and has been for years. The only thing that really changes with time and practice is the breadth of topics and resources that you have a dim recollection of, and the number of times you've been burned by various pitfalls, which helps you to weed through the options a bit more effectively.


Posted by: Spike | Link to this comment | 01-16-14 1:20 PM
horizontal rule
22

Just today I did call a variable "Not_at_all_lit", but one can't let general principles get in the way of puns.


Posted by: Moby Hick | Link to this comment | 01-16-14 1:20 PM
horizontal rule
23

Is there not some math-y/logic-y/theory-y stuff I should know?

Find a linter and use it

See, what should I have read/learned about, that I would have known what a linter is?


Posted by: ogged | Link to this comment | 01-16-14 1:22 PM
horizontal rule
24

Two other things you must hammer into your head:

1) Premature optimization is the root of all evil.
2) Before you do something inside a loop, ask yourself if it really needs to be done every time through the loop.


Posted by: Josh | Link to this comment | 01-16-14 1:23 PM
horizontal rule
25

Is there not some math-y/logic-y/theory-y stuff I should know?

You're not at that point yet. I've been doing this professionally for more than a decade and I'm barely at that point.

(I mean, yeah, if you want to go get a job as a production developer somewhere, sure. But I don't think that's what you want to do, is it?)


Posted by: Josh | Link to this comment | 01-16-14 1:25 PM
horizontal rule
26

Re-factor mercilessly. Code isn't any good until its been re-written three times.


Posted by: Spike | Link to this comment | 01-16-14 1:26 PM
horizontal rule
27

Further to 25: But if you really really want to get into the theory, read this.


Posted by: Josh | Link to this comment | 01-16-14 1:27 PM
horizontal rule
28

When you start naming your variables things like "shitball" and "fucker_3", its time to go get some coffee.


Posted by: Spike | Link to this comment | 01-16-14 1:29 PM
horizontal rule
29

See, what should I have read/learned about, that I would have known what a linter is?

Linter. It's a tool that analyzes your code and flags it for things that look problematic. ("Static analysis" is the general term.) The one for python is called "pyflakes". It looks like Clang, which is the compiler used by XCode, has much of that sort of behavior built in.

Use Stack Overflow! Lots! I've been doing a ton of that in the last month because I got hastily drafted to do some front-end engineering work, which is definitely not a core strength of mine.


Posted by: snarkout | Link to this comment | 01-16-14 1:30 PM
horizontal rule
30

Actually, here's a good collection of reading lists for the kind of stuff you seem to be interested in.

(Boy I have a lot of opinions about this stuff. I should really get a job.)


Posted by: Josh | Link to this comment | 01-16-14 1:31 PM
horizontal rule
31

The one for python is called "pyflakes".

Pylint 4ever!


Posted by: Josh | Link to this comment | 01-16-14 1:32 PM
horizontal rule
32

SICP is a great book! I have heard good things about How To Design Programs as well.


Posted by: nosflow | Link to this comment | 01-16-14 1:33 PM
horizontal rule
33

Use Stack Overflow! Lots!

Do I ever.

("Static analysis" is the general term.)

Not to belabor a point, but how do you know (or how would I learn) what the general term is? I feel like I'm narrowly focussed on whatever specific issue I'm trying to solve, but don't have a broad view of the activity, at all, and that surely must cost me time/efficiency somewhere.


Posted by: ogged | Link to this comment | 01-16-14 1:33 PM
horizontal rule
34

Also add Stackoverflow to your list of oh, snarkout got there first.


Posted by: nosflow | Link to this comment | 01-16-14 1:33 PM
horizontal rule
35

here's a good collection of reading lists

Aha! Super helpful; thank you.


Posted by: ogged | Link to this comment | 01-16-14 1:35 PM
horizontal rule
36

Not to belabor a point, but how do you know (or how would I learn) what the general term is?

Research? Time? Follow links if you're online, read things on wikipedia and follow links there. Click around; read around.


Posted by: nosflow | Link to this comment | 01-16-14 1:35 PM
horizontal rule
37

Coders at Work is a book based on a bunch of interviews with famous developers. Some good stuff in there.

Stack Overflow, yes, but also the Stack Overflow Podcast. Listen to the early episodes, when it was Joel Spolsky and Jeff the Coding Horror Dude, discussing a lot of the technical considerations and philosophies that went into building Stack Overflow, as well as a bunch of other development-related topics.


Posted by: Spike | Link to this comment | 01-16-14 1:35 PM
horizontal rule
38

Not to belabor a point, but how do you know (or how would I learn) what the general term is?

Find a meetup group in your area, or a mailing list. Or hop on Stellar and look for links to posts/presentations/etc. Or, hell, just keep posting questions here. The best way to find this stuff out is to talk to other developers.


Posted by: Josh | Link to this comment | 01-16-14 1:37 PM
horizontal rule
39

The Lambda Papers are super great (though not in the good buttsex way).

Actually, do not start there remotely.


Posted by: nosflow | Link to this comment | 01-16-14 1:37 PM
horizontal rule
40

Further to 39: If you're not reading Lambda the Ultimate, you're barely a developer.


Posted by: Josh | Link to this comment | 01-16-14 1:38 PM
horizontal rule
41

I assume "an entire undergraduate program in CS" is not the answer you're looking for? From that, you could steal the ideas of SICP-or-similar-introduction (it's good because it's different! broadening!), algorithms/data structures stuff, heuristic problem solving, and then replace the lab sort of classes with the development you're doing now, where Google-leading-to-StackOverflow fills in for the role of the helpful TA.


Posted by: Nathan Williams | Link to this comment | 01-16-14 1:40 PM
horizontal rule
42

For what it's worth, I didn't take CS classes -- this was all stuff picked up from reading/mailing lists (because I am old)/asking idiot questions as a junior-level dev/frantically Googling because something blew up.


Posted by: snarkout | Link to this comment | 01-16-14 1:43 PM
horizontal rule
43

I had to teach myself SAS, which is pretty much like programming. I got by on books and pestering some guy who knew more than I did. I gave him my Weber grill when I moved.


Posted by: Moby Hick | Link to this comment | 01-16-14 1:49 PM
horizontal rule
44

It also helps if you spent ages 8-12 banging away in Basic on an Apple IIc.


Posted by: Spike | Link to this comment | 01-16-14 1:49 PM
horizontal rule
45

That's probably my problem. I didn't get an Apple IIc until I was 13 or so.


Posted by: Moby Hick | Link to this comment | 01-16-14 1:51 PM
horizontal rule
46

Well there's the problem. You got to discover computers before you discover girls.


Posted by: Spike | Link to this comment | 01-16-14 1:52 PM
horizontal rule
47

My early interpreters were for BASIC, but by the time I entered high school, I had already created a self-hosting compiler for a non-trivial subset of C (no preprocessor, though).


Posted by: snarkout | Link to this comment | 01-16-14 1:53 PM
horizontal rule
48

In high school I had one class in BASIC and another in Pascal. Unless Pascal doesn't exist and I just invented it to repress a memory of more BASIC.


Posted by: Moby Hick | Link to this comment | 01-16-14 1:55 PM
horizontal rule
49

I liked that article in 47, which someone put on Facebook. Other than that I haven't programmed anything other than I guess making the "turtle" move in Logo more than 25 years ago, but that hasn't stopped me from writing this comment.


Posted by: Robert Halford | Link to this comment | 01-16-14 1:56 PM
horizontal rule
50

(1) Don't just use StackOverflow to answer specific questions; subscribe to the RSS feeds for the language or languages you're learning and spend a little time each day browsing the questions and answers. It's the most efficient way I've found to learn the idioms and basic techniques of a new language, and you'll get to see a parade of horrible code in other peoples' questions, which is both educational in its own right and a good check on the tendency to self-doubt that comes along with self-study.

(2) Find complete, digestibly-sized programs and try to understand them in their entirety. If you're learning Python, smaller modules in the standard library are great; if C, try the smaller programs in GNU coreutils. (I don't know what an equivalent for Objective-C would be.) This will help develop your sense of how to organize code, and also provide some familiarity with the extra touches production code requires that are omitted from textbook and tutorial examples.


Posted by: lambchop | Link to this comment | 01-16-14 1:59 PM
horizontal rule
51

I suppose this is the correct thread to note the The Professor is no longer with us.


Posted by: CharleyCarp | Link to this comment | 01-16-14 2:01 PM
horizontal rule
52

He was more of a hardware guy.


Posted by: Moby Hick | Link to this comment | 01-16-14 2:03 PM
horizontal rule
53

but how do you know (or how would I learn) what the general term is?

Oh, yeah, knowing the general terms is super useful, good point. That helps enormously when picking up a new language, since you can google "general term + langname".


Posted by: Beefo Meaty | Link to this comment | 01-16-14 2:06 PM
horizontal rule
54

Coconuts are hard enough, I guess.


Posted by: CharleyCarp | Link to this comment | 01-16-14 2:07 PM
horizontal rule
55

At my high school computer lab there were (if I'm rememberging correctly) two terminals. They were taken over by a few computer nerds. Theoretically, students taking computer programming class would get to sign up for time on the terminals. What actually happened was that the nerds would offer to do your homework for you, if you would let them use the terminal. It was clearly too good an offer to refuse, so I never learned programming.


Posted by: peep | Link to this comment | 01-16-14 2:09 PM
horizontal rule
56

Man I have such a total paucity of useful advice to offer ogged. Hang around other people who know how to program, and listen to them. Try building shit. Google what breaks. It all seems so ad hoc and non-magical.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 2:15 PM
horizontal rule
57

You people learning programming in the age of search engines.


Posted by: Nathan Williams | Link to this comment | 01-16-14 2:15 PM
horizontal rule
58

God the ability to just dump the whole error string into google has completely reshaped the world.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 2:17 PM
horizontal rule
59

When I was a kid, if you wanted a game, you used to have to meticulously copy pages of Basic code from 321 Contact magazine. Then it wouldn't work, and you would be fucked because there was no way to Google the error message. Then your dad came and yelled at you to play outside.


Posted by: Spike | Link to this comment | 01-16-14 2:21 PM
horizontal rule
60

I was amused that in searching for some insight on an assignment from a programming class my daughter found someone asking about the exact same assignment but from an earlier semester. And further, that in the responses someone had said something like, "Ah, taking Professor Xyzzy's class in foo, I see."


Posted by: JP Stormcrow | Link to this comment | 01-16-14 2:23 PM
horizontal rule
61

God the ability to just dump the whole error string into google has completely reshaped the world.

Yeah, there's nothing like having Google confirm that you are, in fact, the only person to have ever encountered this particular error.


Posted by: Josh | Link to this comment | 01-16-14 2:23 PM
horizontal rule
62

Actually one thing that's really useful, ogged, is an intuition for which parts of your exact error message can be usefully replaced with wildcards in your google search (or alternately, which substring you should use to maximize generality while finding the same error).


Posted by: Beefo Meaty | Link to this comment | 01-16-14 2:28 PM
horizontal rule
63

62: What are you implying about my search skills?


Posted by: Josh | Link to this comment | 01-16-14 2:29 PM
horizontal rule
64

Why don't you try googling substrings of Sifu's comment to see if someone else knows what the implication is?


Posted by: nosflow | Link to this comment | 01-16-14 2:30 PM
horizontal rule
65

51 Irwin Corey? Damn!

Though he was almost 100 so not so surprising.


Posted by: Barry Freed | Link to this comment | 01-16-14 2:30 PM
horizontal rule
66

The gold standard is "The Art Of Computer Programming" by Donald Knuth.

https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming


Posted by: libertas | Link to this comment | 01-16-14 2:30 PM
horizontal rule
67

63: they are entirely unique.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 2:30 PM
horizontal rule
68

Ignore 66.


Posted by: lambchop | Link to this comment | 01-16-14 2:31 PM
horizontal rule
69

It also helps if you spent ages 8-12 banging away in Basic on an Apple IIc

Yeah, around 18 for me. And I've forgotten everything to boot.


Posted by: Barry Freed | Link to this comment | 01-16-14 2:34 PM
horizontal rule
70

58: It is interesting/weird to recall the IBM "manual rooms" with shelves of loose-leaf binders with every one of the 20 gazillion carefully-numbered System/360 system and error messages described (this stuff). It was a regular task for someone to update the changed pages on a regular basis. But I will say I never got a code or message that was not listed, unlike every other thing I've ever worked with in my life. Of course the cost of that was 1) lots of actual cost and 2) utter lack of agility or flexibility.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 2:38 PM
horizontal rule
71

Another suggestion: watch this lightning talk. Understand why it's funny.


Posted by: Josh | Link to this comment | 01-16-14 2:38 PM
horizontal rule
72

IEH102I
THIS VOLUME DOES NOT CONTAIN DATA SET dsname
Explanation:
The data set specified in the LISTVOC or LISTPDS statement is not contained in the specified volume's table of contents.

In the message text:

dsname
The data set name.
System action:
The request is ignored. The return code is 8.

Application Programmer Response:
Probable user error. Ensure that the data set name and volume are specified correctly. (If a volume was not specified, the system residence volume is assumed.) If the volume and data set name are correct, insert a LISTVTOC statement for the other system volumes to determine where the data set resides.

System programmer response:
If the error recurs and the program is not in error, look at the messages in the job log for more information. Search problem reporting data bases for a fix for the problem. If no fix exists, contact the IBM Support Center. Provide the JCL and all printed output and output data sets related to the problem.

Source:
DFSMSdfp


Posted by: JP Stormcrow | Link to this comment | 01-16-14 2:39 PM
horizontal rule
73

72: An example.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 2:40 PM
horizontal rule
74

There is all sorts of good advice on this thread that I'm never going to follow.


Posted by: Eggplant | Link to this comment | 01-16-14 2:42 PM
horizontal rule
75

74 But I've bookmarked it all the same.

65 Relieved to hear that the world's foremost authority is alive and, at 99, presumably well.


Posted by: Barry Freed | Link to this comment | 01-16-14 2:45 PM
horizontal rule
76

||
Gswift/Bostoniangirl/others bleg:

A friend's roommate just tore the thermostat off the wall and opened all the windows, saying "I will decide when the heat needs to go back on!" (It is cold here.) Heating has been a point of contention in this household.

What's the thing to do here vis-a-vis talking to the cops, etc? Sounds like, from other behavior (walking around the apt kicking kid's toys, etc.) that he is indeed having some kind of psychotic break or just short of that. Concerned for friend's safety, but she is not in good with the landlord. Thankfully, she is safe at a coffeeshop right now.

This is all such a mess.
||>


Posted by: William Howard Taft | Link to this comment | 01-16-14 2:47 PM
horizontal rule
77

I'm identifying what needs to be done, dimly recalling that my Objective C book some resource had something that sounded relevant, checking the index or googling, and then figuring out how to apply the method to my situation.

I'm pretty sure this is 100% of all I ever do.


Posted by: essear | Link to this comment | 01-16-14 3:03 PM
horizontal rule
78

The C Programming Language, by K&R. That is the single best book I've read on the topic. I've returned to it on multiple occasions.

Programming Perl, by Larry Wall, Et al. Even if you don't care about Perl, it is awesome, and really funny at times, something hard to pull off in technical documentation.

Choice and Consequence, by Shelling. There is nothing about programming there, but it is useful.

ESR's various rants are useful as well. He's an insane egomaniac, but very competent. you'll run in to that sort of thing in this industry.


Posted by: Grumbles | Link to this comment | 01-16-14 3:05 PM
horizontal rule
79

Reading K&R is pretty good, if you're programming in anything remotely C-derived. It's a good and brief book (that's part of why it's good). "The Practice of Programming" by K & Pike is a good followup, less about language detail and more about approach and style.

One of the list pages referenced above mentioned "The Mythical Man-Month", which is also a great read, and helps to explain 72 - his ideal programming team, admittedly in the 1970s, had about as many documentation/typist/secretaries on it as programmers.


Posted by: Nathan Williams | Link to this comment | 01-16-14 3:09 PM
horizontal rule
80

Also, The Design and Implementation of the 4.4 BSD Operating System. I loaned that to someone and didn't get it back, so I don't have authors on hand, but Bostic and McKusick were some of them. If you're serious, it is a must-read, even if you don't want to build an operating system.


Posted by: Grumbles | Link to this comment | 01-16-14 3:14 PM
horizontal rule
81

If you do wind up wanting to take classes, I've been getting an online CS degree from Oregon State University for the past year. The first two programming classes were in Java, but I'm told that they're now being taught in C.


Posted by: LizSpigot | Link to this comment | 01-16-14 3:24 PM
horizontal rule
82

Programmers are going to be myopic. That is what we do, after all. Good ones pay attention and provide a feedback cycle when management has lost their collective minds.


Posted by: Grumbles | Link to this comment | 01-16-14 3:26 PM
horizontal rule
83

To sum up, to begin to get a basic understanding, become intimately familiar with the superset of material that a dozen or so people working across a broad swath disciplines over many years have encountered and found valuable. Do that and then come back for further guidance.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 3:48 PM
horizontal rule
84

ogged,why won't you reveal what your app is?


Posted by: urple | Link to this comment | 01-16-14 3:51 PM
horizontal rule
85

It's like Grindr but for women interested in masturbating dogs.


Posted by: Robert Halford | Link to this comment | 01-16-14 3:52 PM
horizontal rule
86

Actually, its much simpler. Just virtual dog penis you can rub.


Posted by: Spike | Link to this comment | 01-16-14 4:00 PM
horizontal rule
87

If you do wind up wanting to take classes, I've been getting an online CS degree from Oregon State University for the past year. The first two programming classes were in Java, but I'm told that they're now being taught in C.

Liz, that program looks interesting. Any further impressions you could share?


Posted by: urple | Link to this comment | 01-16-14 4:05 PM
horizontal rule
88

83: Right, this is like the bike or cooking threads.


Posted by: Eggplant | Link to this comment | 01-16-14 4:07 PM
horizontal rule
89

83: I still have a huge backlog of books I intend to read because people have mentioned them favorably in threads here. I did recently get through The Rest is Noise, and now I'm reading the one about shipping containers.


Posted by: essear | Link to this comment | 01-16-14 4:13 PM
horizontal rule
90

Oh, and also the one about rocket fuels.


Posted by: essear | Link to this comment | 01-16-14 4:13 PM
horizontal rule
91

83: Just like planning to build a house of cob.


Posted by: Moby Hick | Link to this comment | 01-16-14 4:15 PM
horizontal rule
92

76: President Taft, I have no good advice. It all varies so much by state. Usually the standard is imminent threat to self or others for truly involuntary commitment. Often after an evaluation people will sign themselves in. Most of my experience with this is with people who are clients of our state's department of mental health, and once people are already "in the system" things are different.


Posted by: Bostoniangirl | Link to this comment | 01-16-14 4:19 PM
horizontal rule
93

It takes 10,000 hours to learn to blather about how everyone should spend 10,000 hours learning to code.


Posted by: Moby Hick | Link to this comment | 01-16-14 4:22 PM
horizontal rule
94

2) Before you do something inside a loop, ask yourself if it really needs to be done every time through the loop.

Also good advice for Congress.


Posted by: Ginger Yellow | Link to this comment | 01-16-14 4:28 PM
horizontal rule
95

This is really very helpful, all. Thanks.

One book I found very useful, as a complete beginner, was this one. Very clear, engaging, lots of useful information.


Posted by: ogged | Link to this comment | 01-16-14 4:35 PM
horizontal rule
96

95: If you found that useful, you might also look at the Python Cookbook. (And you should look closely at the list of contributors.)

FWIW, O'Reilly has an outstanding online library. I have the $25/month subscription and it's totally worth it.


Posted by: Josh | Link to this comment | 01-16-14 4:42 PM
horizontal rule
97

87: It's a pretty good program if you want to truly learn CS. There are easier programs if your goal is simply to get some kind of CS degree. For example, Western Governor's has a MS degree that requires no prior knowledge of CS. OSU gives you a BS degree, but it's designed for people who already have a BS degree so the classes are only CS degrees.

I'm taking one class at a time and it's pretty demanding. Most people are unemployed or stay-at-home parents that tend to take four classes at once, which I can't even imagine. For the first two Intro to CS classes, I studied two hours every weekday night and 15 hours over the weekend.

The format of the classes is to read from a textbook, view lectures online, and take tests online. We use Blackboard, which has been fine except for a few hiccups in the beginning.

I used a tutor for Intro to CS and Data Structures because the feedback didn't include helpful comments like critiquing my coding style. The TAs just tell you whether it compiled correctly. When I showed the tutor one of my programs, he laughed for awhile about how poorly it was coded and showed me how to fix it in ten minutes when it took me a weekend to write. I'm hoping to do the Assembly Language course without a tutor since it's less about coding.

Any more questions?


Posted by: LizSpigot | Link to this comment | 01-16-14 4:52 PM
horizontal rule
98

Any more questions?

No, that was very helpful, thanks. It sounds like one of those worthwhile things that ambitious people do.


Posted by: urple | Link to this comment | 01-16-14 5:01 PM
horizontal rule
99

Man, do I ever wish I'd studied CS in college. Ironically, I didn't because I'd spent so much time dicking around with computers as a teenager that I thought I knew something about them, and I wanted to spend college learning about new things, to, like, expand my intellectual horizons or something. What a moron I was. I don't know shit about computers.


Posted by: urple | Link to this comment | 01-16-14 5:04 PM
horizontal rule
100

I really want job security and not everyone is convinced that me working with software patents for seven years is sufficient. This way no one can question my credentials. We'll see if I can keep it up after the baby is born, though.


Posted by: LizSpigot | Link to this comment | 01-16-14 5:05 PM
horizontal rule
101

Okay, I do have another question: taking one class at a time means you'll finish the program in how many years??


Posted by: urple | Link to this comment | 01-16-14 5:06 PM
horizontal rule
102

I didn't major in CS because my dad said I didn't think like a computer programmer (he was a programmer). I really wish I hadn't listened to him.


Posted by: LizSpigot | Link to this comment | 01-16-14 5:07 PM
horizontal rule
103

101 It takes 3.75 years to complete in total (17 classes, one per quarter). I'm one year into it and I'm taking off next quarter because of the baby, so I expect to finish at the end of 2016.


Posted by: LizSpigot | Link to this comment | 01-16-14 5:08 PM
horizontal rule
104

66: The Art of Computer Programming was the text for my Analysis of Algorithms course that I took with Sedgewick, but honestly, one of Sedgewick's books (either Algorithms or Algorithms in C) will be much more approachable for 99.9% of the working programmers out there, for 99% of the work they need to do. To be fair, Sedgewick hadn't written them at the time I took the course from him. Lots of TAoCP requires some pretty hard-core math analytic skills that you will rarely use directly, especially when working with modern computer systems. Most of the value I got out of it is meta stuff about "things to think about with respect to certain kinds of problems" rather than directly applicable techniques. It still has an honored place on my bookshelf, but I hardly ever go to it for solutions to a specific problem.

In contrast, one book I think nearly every programmer in my subfield should read is Working Effectively with Legacy Code by Michael C Feathers. (It helps to be fluent in either C++ or Java to follow most of the examples.) Over a 35-year career in software development, I've only had a handful of occasions when I was developing a new program completely from scratch, and one of those was my thesis project. Most of the time I've been working to extend a significant body of existing code, and understanding how to test, characterize, and manipulate such code is the point of Feathers' book.


Posted by: Dave W. | Link to this comment | 01-16-14 5:25 PM
horizontal rule
105

I judge this bleg to be not completely OT because Bay Area.

Getting from Sausalito to Santa Cruz and back (flexible times and not necessarily return on same day) via public transit. Any viable options? Asking for an offspring.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 5:35 PM
horizontal rule
106

Prez Taft, assuming you are who I assume you are, I'd say your friend's first concern needs to be to keep the young child out of a situation where there's a good likelihood the state will take the kiddo into foster care. Your assumed state is notoriously foster-friendly which is not the same as family-friendly and both keeping a little one in a cold apartment and getting into a domestic disturbance with the roommate could lead to a removal. I realize that's not very helpful, but that's what I hear from the other side of things.


Posted by: Thorn | Link to this comment | 01-16-14 5:39 PM
horizontal rule
107

105: Have you checked the transit option in Google Maps? That's where I generally start. I just checked for "leaving now" options, and they have some suggestions that would take around 3 1/2 hrs one way.


Posted by: Dave W. | Link to this comment | 01-16-14 5:43 PM
horizontal rule
108

105: My knowledge of Bay Area transportation is out of date, and I don't know what you mean by public transit (Greyhound?), but I assume Sausalito ferry to SF and then something from SF is the likely way to go. In high school, I and some friends got to Half Moon Bay from Berkeley and back on the same day via public transit.


Posted by: fake accent | Link to this comment | 01-16-14 5:54 PM
horizontal rule
109

If your offspring can take a long time getting there, I think an option would be ferry-BART-switch to Amtrak in Emeryville-switch to bus in San Jose. There may well be better routes on Caltrain, which runs down the Peninsula, but I don't know them. Public transit for that trip is possible, though not smooth.

Dave W.'s suggestion is better.


Posted by: Megan | Link to this comment | 01-16-14 5:54 PM
horizontal rule
110

107 works. ... d'oh. Thanks.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 5:55 PM
horizontal rule
111

The bus is much faster than the ferry from Sausalito to SF.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 5:57 PM
horizontal rule
112

Although maybe I should suggest the ferry on the off chance the ferry gets rammed and he gets plucked from the water by an outbound ship and is offered a position as a crew member.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 5:58 PM
horizontal rule
113

Google lacks the human touch. Anyway, I'd take the ferry rather than the bus if I had any flexibility.


Posted by: fake accent | Link to this comment | 01-16-14 5:59 PM
horizontal rule
114

That can happen, or so I've read.


Posted by: JP Stormcrow | Link to this comment | 01-16-14 5:59 PM
horizontal rule
115

Yeah, the routes I was finding were basically bus-to-bus-to Caltrain in SF, Caltrain to San Jose, bus from there to Santa Cruz. The Capitol Corridor (Amtrak) in the East Bay goes to the same station in San Jose, but would probably take more time getting across the bay, plus the Corridor only runs around every 90 minutes at peak times, and less than that midday (I'm not sure how often Caltrain runs).

Obviously, you might get different results depending on when you were travelling and the specific addresses involved.


Posted by: Dave W. | Link to this comment | 01-16-14 6:00 PM
horizontal rule
116

The only reasons I'd take the bus for that part of the route:

1. strict schedule
2. rapid onset seasickness
3. taken the ferry before; didn't enjoy it
4. hatred of everything that's good in the world.

Seriously, you get to take a boat across (part of) the bay. How often do you do that?


Posted by: fake accent | Link to this comment | 01-16-14 6:02 PM
horizontal rule
117

The only reasons I'd take the bus for that part of the route:
1. strict schedule
2. rapid onset seasickness
3. taken the ferry before; didn't enjoy it
4. hatred of everything that's good in the world.

5. Lack of red suit.


Posted by: Josh | Link to this comment | 01-16-14 6:05 PM
horizontal rule
118

Taft, was your friend there at the time he ripped the thermostat off the wall? Was it part of a dispute? Because here and in many states that's domestic violence because they're living together. If she called the cops here we would book him into jail and served him with a temporary protective order at jail which would prevent him from coming back to the apt. for at least a few days.


Posted by: gswift | Link to this comment | 01-16-14 6:08 PM
horizontal rule
119

And if you do want to take the ferry, I'd be looking into a ferry to Jack London Square, where you can catch the Capitol Corridor. You can do that from SF; I'm not sure whether there are any direct options from Sausalito or if you would do ferry to SF; ferry from SF to Jack London.


Posted by: Dave W. | Link to this comment | 01-16-14 6:09 PM
horizontal rule
120

Further to 118, if there's a kid who was present during that it would be an additional charge. If the laws are at all like here calling the cops is the way to go. If it meets the criteria for a DV the arrest is mandatory here and having the charge be under that umbrella usually means better access to things like victim advocates and such.


Posted by: gswift | Link to this comment | 01-16-14 6:13 PM
horizontal rule
121

Taft, if you're the person I assume you are, and your friend also lives in H. County, she can call the mental health crisis line to request services for another adult who is having issues. Google COPE or FB message me if you need the number. The line was set up to be an alternative to calling the police, though it does necessarily get the county involved, and could lead to police or CPS intervention if warranted.


Posted by: J, Robot | Link to this comment | 01-16-14 6:48 PM
horizontal rule
122

119, cont: If your offspring wants to go for cool offbeat touristy points instead of just "get me there ASAP", there's another advantage to the Ferry->Ferry->Jack London->Capital Corridor->San Jose->Santa Cruz route, and that is that the Corridor is one of the few ways to see the Bay Area's only ghost town, Drawbridge CA, which is about halfway between the Fremont and the Great America stations. They don't tell you about it, and it doesn't look like all that much to see (a few decaying wooden buildings on both sides of the train), but it's got an interesting history that you can Google, and there were people living there up to the 1970s. It's only accessible by boat or rail, and is now part of a wildlife refuge.


Posted by: Dave W. | Link to this comment | 01-16-14 7:10 PM
horizontal rule
123

I would love to move back to the Bay Area. Maybe I should learn more of this thing people are calling "code."


Posted by: fake accent | Link to this comment | 01-16-14 7:21 PM
horizontal rule
124

I'm late. Ogged, The C Programming Language is as useful as everyone says, especially since your iOS app, at the end of the day, gets turned into vanilla C by gnomes very deep in the Xcode caverns. It's a short book, but the sort you go back to over and over, understanding slightly more each time. My co-developer (who, like me, had to learn all this shit from scratch about four years ago) kept it in his bathroom for a year, with good results.

I highly recommend Cocoa Design Patterns, which fleshes out a lot of those "concepts that programmers in general know how to use" with Cocoa-specific examples.

Learning Xcode is a project unto itself but worth the effort. Xcode has no real REPL function, because compiled language etc., but the interactive debugger console gives you some of the same help: http://www.informit.com/articles/article.aspx?p=1829415&seqNum=6

The "Cocoa With Love" blog isn't updated any more, but the archives are good. "Cocoa is My Girlfriend" (why these names) also worth following.

Algorithms and such, like everyone else says, don't always come up day-to-day; especially in iOS you really are trusting the framework to handle that most of the time. The hardest part for me early on was getting my head around good object-oriented design. See, again, recommendation for Cocoa Design Patterns Above.


Posted by: lourdes kayak | Link to this comment | 01-16-14 7:31 PM
horizontal rule
125

Does playing Minecraft help? There are objects and you have to orient yourself.


Posted by: Moby Hick | Link to this comment | 01-16-14 7:33 PM
horizontal rule
126

I'm not sure if there are any ferries between Marin and the East Bay (or even any that do not have SF on one end). But the Capitol Corridor is a nice ride; it has wifi now.


Posted by: Minivet | Link to this comment | 01-16-14 7:36 PM
horizontal rule
127

Man, every day at breakfast there are objects and I have to orient myself, but they told me to leave it off the resume.


Posted by: lourdes kayak | Link to this comment | 01-16-14 7:57 PM
horizontal rule
128

They may be a little dated now, but Code Complete and Writing Solid Code taught me a lot about avoiding avoidable coding mistakes.


Posted by: Ham-Love | Link to this comment | 01-16-14 8:47 PM
horizontal rule
129

Maybe this is the thread to ask: what's the deal with the run the terminal as a "login shell" to get Ruby (or maybe the issue is RVM) to load correctly on Linux? I know there's ways to not have to run terminal as login shell, but I can't figure out what the "recommended" thing to do is.


Posted by: fake accent | Link to this comment | 01-16-14 8:51 PM
horizontal rule
130

This is an iteraction between RVM and bash (I'm assuming your default shell is bash): On Linux opening a terminal from within a gui session starts a non-login shell, which doesn't read ~/.bash_profile, which is where RVM installs its initialization code.


Posted by: lambchop | Link to this comment | 01-16-14 9:12 PM
horizontal rule
131

Right, but the advice I've seen online for how to deal with that has said:

1. You should run a login shell.
2. You should not run a login shell (even though you could) [because reasons], but should instead edit a different bash configuration file [I think there may be two possibilities].
3. Run the RVM initialization script after starting bash.

It's not clear to me as someone new to Ruby if one of those options or some other option is better or worse than the others. I don't like using the login shell because I lose the multi-color highlighting, although I guess I could turn it on for that mode.

This is also the kind of minor thing that probably ends up being a barrier to beginners. It's something I'd rather not think about at all until I know more Ruby, but the default Ruby that comes with Ubuntu is too old so you have to use RVM or something like it.


Posted by: fake accent | Link to this comment | 01-16-14 9:25 PM
horizontal rule
132

So I guess my question is just how do people using Ruby on bash usually set things up?


Posted by: fake accent | Link to this comment | 01-16-14 9:58 PM
horizontal rule
133

"was there a book (or books) or lecture series, that made programming itself clear enough to you that writing code was much easier after them?"

Nope. 10,000 hours.


Posted by: D Clarity | Link to this comment | 01-16-14 10:10 PM
horizontal rule
134

131: I use your 2 (under zsh on a Mac, so the specifics are different, but same deal). I always forget which shell configuration files do what, but if you experiment with moving the RVM code out of ~/.bash_profile and into one of the others, you should be able to get it to fire on a non-login shell.

Alternatively, if you don't have to regularly switch between different Ruby versions, you could ditch RVM (which is a pain anyway) and just install the new Ruby from a package: http://leonard.io/blog/2013/10/installing-ruby-2.0.0-on-ubuntu-13-10-saucy-salamander/


Posted by: lourdes kayak | Link to this comment | 01-16-14 10:12 PM
horizontal rule
135

Honestly? I think the overwhelming majority are on OS X, where the terminal starts a login shell by default, so the issue doesn't arise in the modal case.

If you don't want to use a login shell, you'll probably be ok moving the RVM initialization code to ~/.bashrc. This is fairly common, I believe. Some caveats: Make sure you don't have BASH_ENV set to ~/.bashrc, or that file will be sourced every time you start a non-interactive shell (i.e., every time you run a shell script). Also, this will run RVM initialization whenever you use `su', which I bet can cause problems.

Alternatively, you can set up a login shell to get the colored output you like. If the code setting up the colorization you like is in your ~/.bashrc, you can move that to ~/.bash_profile, or even just source ~/.bashrc from ~/.bash_profile. This last expedient is common, and not just for people doing Ruby development.


Posted by: lambchop | Link to this comment | 01-16-14 10:14 PM
horizontal rule
136

And yeah, this sort of thing is a huge barrier to learning to code, and also a huge barrier to not swearing and throwing things in the office. The amount of time one spends fighting one's tools.


Posted by: lourdes kayak | Link to this comment | 01-16-14 10:17 PM
horizontal rule
137

I mean practical programming is 1% knowledge and 99% fighting one' stools, let us not mince what needn't minced.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 10:19 PM
horizontal rule
138

Keeping that typo. It rules.


Posted by: Beefo Meaty | Link to this comment | 01-16-14 10:20 PM
horizontal rule
139

My code has been compared to minced stool more than once...


Posted by: D Clarity | Link to this comment | 01-16-14 10:22 PM
horizontal rule
140

134, 135: Thanks. If there's no problem with the login shell except for the colors, I might try 135.last. I haven't had much reason to switch versions, mostly because I've been dragging my feet, but there's some Ruby-based stuff that I'm trying to use for learning Ruby that comes with a bunch of warnings about versions and it seems like I need to have 1.9.2, 1.9.3 and 2.0.0 just in case something is still on an earlier version. But it might only matter for people developing on the project rather than just doing the tutorials.


Posted by: fake accent | Link to this comment | 01-16-14 10:25 PM
horizontal rule
141

I always have a .bashrc that just sources .bash_profile, or something along those lines. Presumably this is deprecated for some reason involving security or something that I never paid attention to.


Posted by: essear | Link to this comment | 01-16-14 10:26 PM
horizontal rule
142

Oh, hi, 135.last. I should read.


Posted by: essear | Link to this comment | 01-16-14 10:26 PM
horizontal rule
143

On fighting tools: It took so long for me to set up a working environment to be able to do Python-based exercises* in that original Udacity statistics MOOC that I'd decided to drop the MOOC** by the time I got the environment set up. Ok, that was only a few hours, I think, but still.

*I think it later became clear that I could have installed a science-oriented python and gotten everything at once, but I already had python installed and didn't want to start over and lose the other things I'd installed for other purposes. Much later, as a step on the way to getting that laptop dual-booting with Linux, I wiped out that Windows install completely. And I still don't really know much python. So.

**This was the one that got so completely trashed by an actual math professor that they had to revise a lot of it.


Posted by: fake accent | Link to this comment | 01-16-14 10:31 PM
horizontal rule
144

141: I think it is! One thing I've learned about configuring things is that everything is always wrong to someone. Realizing that has helped me push on at times because if that's how it's going to be you might as well just pick something and not worry about it.


Posted by: fake accent | Link to this comment | 01-16-14 10:33 PM
horizontal rule
145

One thing I've learned about configuring things is that everything is always wrong to someone.


Posted by: essear | Link to this comment | 01-16-14 10:43 PM
horizontal rule
146

Loads of good advice here. I would only add that I find it very useful to step away from the computer every hour or so to reorient myself. Smoking has been very beneficial to me in this regard, but you could get a cup of coffee or whatever; the point is to give yourself an opportunity to think about the project without staring at particular lines of code. I tend towards obsession with minutiae, and this practice interrupts that.


Posted by: foolishmortal | Link to this comment | 01-16-14 11:58 PM
horizontal rule
147

Listening to experienced programmers argue/troubleshoot/discuss their code (or legacy code) with each other was very useful for me. Users' group, maybe? Following comments on checkins?


Posted by: clew | Link to this comment | 01-17-14 3:01 AM
horizontal rule
148

I doff my hat to 46. Also, SICP is great.

143, meanwhile, yes, this is the annoying thing about Python. We have several different ways of distributing modules, all of which claim to be "easy". None of them work anywhere near as well as any given Linux package manager, and annoyingly, if you use pip/easy_install/whatever to get python modules, they're outside the package manager's remit and therefore you won't get updates for them. A lot of python stuff is available via your friendly local package manager, but nowhere near enough to manage everything through it like you would the rest of your system.


Posted by: Alex | Link to this comment | 01-17-14 4:17 AM
horizontal rule
149

143:

I had that same issue when I was starting out with python, but eventually solved it by installing the Enthought python distribution (includes basically everything and several kitchen sinks). It has some nice features so you can re-install it every now and then and it will only install the new packages that you're missing.


Posted by: AcademicLurker | Link to this comment | 01-17-14 4:54 AM
horizontal rule
150

We have several different ways of distributing modules, all of which claim to be "easy".

Oh god. This. I've been seriously considering putting together my own Python distribution with all the packages I want, so I only have to have one install that I can use on all my various computers. But that turns out to be a lot of work, especially if I want to run all the compilers, instead of just taring a bunch of binaries together.

Then I found WinPython, which has most of the packages what I want, and is 3.x based, so I can finally put years of shitty 2.x unicode support behind me. Still not happy about the installer and distribution mess, though, but being able to run iPython Notebook on Python 3.3 has me satiated for the moment.


Posted by: Spike | Link to this comment | 01-17-14 7:04 AM
horizontal rule
151

One of the best introductions to a language I've read is Python for the Impatient http://abiens.snv.jussieu.fr/mv448/python_for_impatient.html

Which is very short and gives a fairly good idea on the bare bones things somewhat experienced programmers look at when dealing with a new one ...


Posted by: conflated | Link to this comment | 01-17-14 7:15 AM
horizontal rule
152

143: I was almost at the point of dropping my latest class because of how hard it was to install Visual Studios. We're supposed to use VS2010 so I tried to install the software and it requires that you burn the software to a disc and load from the disc. My laptops don't come with optical drives because this is 2014 so I tried three different programs for mounting the image and they each had different types of failures. I pivoted to trying VS2012, which uses a web installer, but it was missing an essential package. I couldn't use VS2013 because the class doesn't have the appropriate libraries for it. After three days working simultaneously on two different laptops, I finally got an extractor to properly extract the files and install VS2010. Ridiculous.


Posted by: LizSpigot | Link to this comment | 01-17-14 11:25 AM
horizontal rule
153

I downloaded Python which already has a GUI. Then I downloaded iPython which said it couldn't install. Then I downloaded "Setuptools" to let me install iPython, and it said I still can't install because I have to be logged in as an administrator, which apparently I am not normally on my own laptop. Then I managed to open iPython but it just looked like a normal command line, so I'll hold off on that for now.

This requires a lot of backtracking. It's hard enough just to figure out which installer to download. I spent about 2 hours typing away in the basic Python GUI anyway.


Posted by: Cryptic ned | Link to this comment | 01-17-14 11:30 AM
horizontal rule
154

Cryptic ned: oo, play with ipython a little -- so much cooler than the usual commandline. THere are good tips-and-tricks teasers about.

Or Enthought. I'd be all over Canopy if it had emacs keybindings (maybe magically now supported? I should go look).


Posted by: clew | Link to this comment | 01-17-14 11:46 AM
horizontal rule
155

iPython does look like a regular command line tool, though it does have some cool improvements. Its iPython Notebook that has the revolutionary GUI. e.

But its a huge pain in the ass to install if it doesn't already come with your Python distribution. Too bad its not


Posted by: Spike | Link to this comment | 01-17-14 12:06 PM
horizontal rule
156

The GUI that comes with Python is crap, and has been for a very long time.


Posted by: Spike | Link to this comment | 01-17-14 12:07 PM
horizontal rule
157

nb, iPython looks like any commandline, but is more stateful. Useful if you like that sort of thing. I don't know why I don't adore Notebooks... no, I do: I think they take people close to doing what makefiles used to and then leave them in misleading states. (This is based on seeing people use them at Software Carpentry workshops.)


Posted by: clew | Link to this comment | 01-17-14 1:37 PM
horizontal rule
158

156: What does that mean exactly?

Not that I used anything but the command line anyway so far. But somehow I am more comfortable with something that looks like a Window than something that looks like my dad's computer circa 1991.


Posted by: Cryptic ned | Link to this comment | 01-17-14 2:38 PM
horizontal rule
159

SAS has a horrible GUI. I always assumed somebody in marketing told them they needed to advertise that they had a graphical interface. The only thing I ever used it for was the blackjack game.


Posted by: Moby Hick | Link to this comment | 01-17-14 2:47 PM
horizontal rule
160

158: If you're on Windows, get the Python for Windows extensions. It's got a better IDE than IDLE. iPython's pretty great but really only makes sense if you're used to working in a Unix environment IME.


Posted by: Josh | Link to this comment | 01-17-14 3:02 PM
horizontal rule
161

What does that mean exactly?

IDLE was the second best IDE I could find when I started with Python fourteen years ago, and it hasn't changed since then. I'm all for keeping it simple, but simple shouldn't mean ugly and not extensible.


Posted by: Spike | Link to this comment | 01-17-14 6:15 PM
horizontal rule
162

Python comes with a GUI?


Posted by: essear | Link to this comment | 01-17-14 7:02 PM
horizontal rule
163

The iPython Notebook linked in 155 looks weirdly Mathematica-like.


Posted by: essear | Link to this comment | 01-17-14 7:03 PM
horizontal rule
164

Yes, its called IDLE, after Eric Idle. The early Python community had an obsession with Monty Python, which is also why all the variables in early Python sample code are named "spam".

This is the kind of shit ogged needs to know.


Posted by: Spike | Link to this comment | 01-17-14 7:16 PM
horizontal rule
165

I've never used Mathematica, but it doesn't surprise me. iPython comes from the Scientific Python tradition, which draws on a heavy Mathematica influence.


Posted by: Spike | Link to this comment | 01-17-14 7:20 PM
horizontal rule
166

The early Python community had an obsession with Monty Python, which is also why all the variables in early Python sample code are named "spam".

Is that also why the language itself is named "Python"?


Posted by: teofilo | Link to this comment | 01-17-14 7:41 PM
horizontal rule
167

I really need to just switch everything to iPython Notebook. For one thing, it might mean I'd actually keep a rationally organized, singular lab notebook. And all this matlab can't be buying me anything good in the end.


Posted by: Beefo Meaty | Link to this comment | 01-17-14 7:45 PM
horizontal rule
168

Don't be fatuous, teo.


Posted by: JP Stormcrow | Link to this comment | 01-17-14 7:50 PM
horizontal rule
169
Python comes with a GUI?
Yes, its called IDLE, after Eric Idle

If the answer to essear's question is "yes", then it's called tkinter.


Posted by: nosflow | Link to this comment | 01-17-14 7:52 PM
horizontal rule
170

IDLE being an interactive development environment written using tkinter as its GUI toolkit.


Posted by: nosflow | Link to this comment | 01-17-14 7:52 PM
horizontal rule
171

That's some fine pedantry right there, that is.


Posted by: Spike | Link to this comment | 01-17-14 8:08 PM
horizontal rule
172

iPython comes from the Scientific Python tradition, which draws on a heavy Mathematica influence.

Really? I haven't noticed much commonality. The numpy stuff is mostly modeled on Matlab.


Posted by: essear | Link to this comment | 01-17-14 8:26 PM
horizontal rule
173

Oh, wait. I didn't realize "Scientific Python" is something different from scipy, so I might be missing the point.


Posted by: essear | Link to this comment | 01-17-14 8:31 PM
horizontal rule
174

if you want to really learn to program and not just hack and cut till something works the best books to go through are Yale Patt's "Introduction to Computing" (he also has a lot of good architecture papers with his students,) Robert Sedgewick's "Algorithms," and thirty years into my career Knuth still is awesome. If you really spend 3-4 months reading through these and doing exercises then picking up a language specific book is pretty easy.

Cutting and pasting code you google is a pretty good way to develop shitty code that will get you in trouble if you claim it as yours.

Don N.


Posted by: | Link to this comment | 01-18-14 1:43 AM
horizontal rule
175

Entirely due to my own fault, my home wi-fi is suspended until my recent payment goes through. Meanwhile I have
3G on my phone so I can still while away my current winter virus on the Internet, albeit more expensively. I notice however that I can't get on to Crooked Timber but it doesn't seem as if it's down. Can anyone think of a reason why this should be?


Posted by: emir | Link to this comment | 01-18-14 6:16 AM
horizontal rule
176

Are you trying to put in a comment that mentions Ghana?


Posted by: Moby Hick | Link to this comment | 01-18-14 6:31 AM
horizontal rule
177

Make sure you're trying to get to crookedtimber.org and not www.crookedtimber.org. For some reason whoever hosts them doesn't advertise the latter.

Don N.


Posted by: | Link to this comment | 01-18-14 7:03 AM
horizontal rule
178

177 is true. Incidentally this means that the link from here no longer works (I realise that the norms of this place preclude ever updating the blogroll, but them's the breaks; if you want to, you can go to ObWi from here, and their link works.)


Posted by: chris y | Link to this comment | 01-18-14 7:08 AM
horizontal rule
179

Also avoid www.crookedtimber.org. It's porn for people with a fetish for penis bending.


Posted by: Moby Hick | Link to this comment | 01-18-14 7:28 AM
horizontal rule
180

I was trying both without and with the www. Neither works not can I follow the links. Can't try through Google cache either as it now hides them and refuses any option to switch from mobile to classic search page.


Posted by: emir | Link to this comment | 01-18-14 7:52 AM
horizontal rule
181

It makes me sad when I entirely miss threads like this.

20 is terrible advice for someone who is struggling with basic programming. Git is probably the equivalent of an MIT weeder class for professional programmers. I love it (I do!) but it's all sharp corners.

ogged, are you using anything for source version control? I think SVN is easy to set up, though it's considered very old-fashioned. Mercurial has a reputation for being simpler than Git, but I'm not sure if it's simpler in ways that would matter to a beginner.


Posted by: Yawnoc | Link to this comment | 01-18-14 8:07 AM
horizontal rule
182

124: The C Programming Language is as useful as everyone says, especially since your iOS app, at the end of the day, gets turned into vanilla C by gnomes very deep in the Xcode caverns.

I don't really have any idea, but I'd be surprised if this is true. Doesn't Objective C have a proper front-end emitting LLVM IR? Is it still a bolted-on cfront-style translation layer?


Posted by: Yawnoc | Link to this comment | 01-18-14 8:09 AM
horizontal rule
183

181.2: you're terrible at trolling ogged.


Posted by: Beefo Meaty | Link to this comment | 01-18-14 8:11 AM
horizontal rule
184

are you using anything for source version control?

I didn't for my first app, but was planning to for the next. Git and Subversion are both built into xcode, but I hadn't much looked into which to use.


Posted by: ogged | Link to this comment | 01-18-14 8:17 AM
horizontal rule
185

174, your attempt to dissuade people from trying to learn by saying it's too complicated would only work if you were a known member of the community.


Posted by: Cryptic ned | Link to this comment | 01-18-14 9:24 AM
horizontal rule
186

167: If you're using matlab and considering ipython notebook, how about ijulia notebook? I'm pretty biased, but I much prefer julia to python, especially for matlab-y things.

As a language, julia doesn't reject functional programming, as optional type annotations, etc.

But the real reason is that when I run into a performance issue I'm not forced to write C (and I say this as someone who's spent the majority of their career writing C, assembly, microcode, or Verilog). Python is slow enough that all the interesting numpy/scipy stuff is written in C. That's great if it does exactly what you want already, but you often end up writing C if you're experimenting with new things.


Posted by: sral | Link to this comment | 01-18-14 9:52 AM
horizontal rule
187

ogged should go through a Haskell tutorial and come back and tell us if it all Just Makes Sense to someone whose brain isn't damaged by the Von Neumann model. Like maybe http://book.realworldhaskell.org/read/


Posted by: Yawnoc | Link to this comment | 01-18-14 9:56 AM
horizontal rule
188

181: git's fine for a beginner as long as they're working on their own. All of the really tricky stuff only becomes an issue when you're working with other people.

It makes me sad, though, to realize that of all the VCS's out there Perforce is far and away the best. 'Cause Perforce sucks.


Posted by: Josh | Link to this comment | 01-18-14 10:01 AM
horizontal rule
189

188.2: Your brain has been damaged by the Von Neumann model, clearly.


Posted by: Yawnoc | Link to this comment | 01-18-14 10:05 AM
horizontal rule
190

I keep meaning to try julia. A friend of mine periodically asks me whether I've played with it yet. Or did, before he disappeared into a finance job and stopped being able to talk about what he's working on.


Posted by: essear | Link to this comment | 01-18-14 10:16 AM
horizontal rule
191

For learning git, what I did was go through the git classes on codeschool.com (which also has iOS, front-end, and Rails stuff) in junction with

http://git-scm.com/book

They're both command line oriented, though.


Posted by: Crooked Timber | Link to this comment | 01-18-14 10:22 AM
horizontal rule
192

Crooked Timber comments.


Posted by: Barry Freed | Link to this comment | 01-18-14 4:23 PM
horizontal rule
193

186: the nice thing about matlab is that everybody in my subfield uses it. Python there is at least a substantial minority of people who understand it, and are working in it. Julia would... limit collaboration.


Posted by: Beefo Meaty | Link to this comment | 01-18-14 4:45 PM
horizontal rule
194

Matlab is the universal language in my area as well. In principle I should be able to use Octave as a substitute, but very few people seem to do that.

Although, speaking of weird languages, I have fond memories of ML. I like to imagine that the ML runtime system is actually a tiny Robin Milner, who carefully figures out the types of all your variables and lets you know if anything is wrong.


Posted by: torrey pine | Link to this comment | 01-18-14 6:03 PM
horizontal rule
195

source version control

I should have said that I used nothing designed for that purpose, but even now, I have half a dozen textedit windows open with known good snippets of code for various functions in the app.


Posted by: ogged | Link to this comment | 01-18-14 7:37 PM
horizontal rule
196

textedit?!


Posted by: Beefo Meaty | Link to this comment | 01-18-14 7:50 PM
horizontal rule
197

Fuck yeah!


Posted by: ogged | Link to this comment | 01-18-14 7:56 PM
horizontal rule
198

I guess if you're mostly working in Xcode who cares but you should pick a fancy (i.e. useful) text editor horse, it's fun.


Posted by: Beefo Meaty | Link to this comment | 01-18-14 8:06 PM
horizontal rule
199

Should I? What fer?


Posted by: ogged | Link to this comment | 01-18-14 8:12 PM
horizontal rule
200

198 gets it exactly right. This guide should come in handy.


Posted by: Josh | Link to this comment | 01-18-14 8:12 PM
horizontal rule
201

I'm trying very hard not to get sucked into obsession with the tools of the trade. Most things are good enough, I tell myself. But if there's a compelling reason, and I don't have to fiddle too much to get something better, sure.


Posted by: ogged | Link to this comment | 01-18-14 8:13 PM
horizontal rule
202

199: Code completion and syntax highlighting, mostly. Code exploration is also useful.


Posted by: Josh | Link to this comment | 01-18-14 8:14 PM
horizontal rule
203

I'm trying very hard not to get sucked into obsession with the tools of the trade.

I thought you wanted to eventually be a real developer?


Posted by: Josh | Link to this comment | 01-18-14 8:15 PM
horizontal rule
204

I use the SAS editor even for things that aren't SAS. The ability to cut and paste columns comes in very handy and sometimes it's nice to see everything after a quotation mark turn purple.


Posted by: Moby Hick | Link to this comment | 01-18-14 8:34 PM
horizontal rule
205

202: I would add regexp support/quality find-replace and maybe project support. But textedit doesn't even have line numbers! I would be lost without line numbers.


Posted by: Beefo Meaty | Link to this comment | 01-18-14 8:38 PM
horizontal rule
206

200 Thanks for posting that. That was a fun thread too.


Posted by: Barry Freed | Link to this comment | 01-18-14 8:40 PM
horizontal rule
207

Sure, ok. Xcode has all this stuff, and seems pretty nice to me. When I start coding in another language, I'll revisit. Textedit was just used to dump bits of code, not to edit them.


Posted by: ogged | Link to this comment | 01-18-14 8:40 PM
horizontal rule
208

200: I remain sad the editor I use isn't in there.


Posted by: Beefo Meaty | Link to this comment | 01-18-14 8:42 PM
horizontal rule
209

208: I would not have figured you for a pico diehard.


Posted by: Josh | Link to this comment | 01-18-14 8:46 PM
horizontal rule
210

Hah! I totally used pico long past when I should have stopped, actually. But no. I use vim a fair bit but that's not what I mean either.


Posted by: Beefo Meaty | Link to this comment | 01-18-14 8:47 PM
horizontal rule
211

I don't use a text editor. I just redirect commands from the shell to into text files.


Posted by: fake accent | Link to this comment | 01-18-14 9:24 PM
horizontal rule
212

182: Doesn't Objective C have a proper front-end emitting LLVM IR?

By all means! But when I was first learning the language, and learning basic C at the same time, it was much easier to conceptualize one as being built on top of the other, rather than worrying too much about what the compiler was doing. Technically, of course, I should have referred to dwarves and not gnomes.

181 on git is a good point too. But Xcode has git baked in these days, and I think creates repositories by default. As annoying as it is to depend on one company's ecosystem, Apple's is at least well made, and if Ogged plans to stick with iOS for a while, getting one of those books on just finding one's way the fuck around Xcode wouldn't be a bad idea.


Posted by: lourdes kayak | Link to this comment | 01-18-14 9:45 PM
horizontal rule
213

back to the original Q.

the three things:

1. a computer isn't just dumb, it doesn't even care. if it's doing something wrong, it's because you told it to.

2. when it gets hard to find the problem, put printf's (or equivalent) everywhere. fancy word for this is 'logging'.

3. it's probably been done before. learn how to express your problem in the most abstract way possible, because that will help Google find the answer for you.


Posted by: cleek | Link to this comment | 01-20-14 5:56 AM
horizontal rule