Home

Previous Entry | Next Entry

Reader Interest Poll (that isn't a poll)

  • Aug. 26th, 2005 at 3:02 AM
me!
It wouldn't be a stretch to say that this journal has gotten awfully technical in the last year or so. This is largely because, well, my interests have become a lot more technical in the last year or so; I've always been girl-who-makes-stuff, and more and more these days, the Stuff that I make is code rather than, say, fiction or clothing. I think about it a lot, and by extension, I write about it a lot.

When I write about technical subjects, I try to be as accessible as I can, because most of y'all aren't technical people. I'm very glad that you're not, just for the record; I value having technical friends, but I also value having a wide range of friends from all walks of life. I don't try to dumb things down, but I do find myself spinning out more long-winded explanations where a word or two of jargon would convey the same information to a smaller set of people. This is actually pretty useful to me, as well, because it forces me to think about what I'm doing in explicit detail -- it's the principle of The Best Way to be Sure You've Learned Something is to Teach It.

I wonder, though, whether it's useful to anyone else. Do people actually read the posts where I'm rabbiting on about the current code project? Do they make sense? Would you rather I wrote about the non-work things going on in my life instead? (Be warned, though, this journal might get kinda quiet if that was all I talked about. Some day I will have a life again, but that won't be for another few months.)

Tags:

Comments

[info]mycroftxxx wrote:
Aug. 26th, 2005 08:29 am (UTC)
Yes, but as an example - your last post a few minutes ago could have gone onto explaining what typesafety, *void, etc. are. I got everything in the first two paragraphs, then just started handing (unknown concept) tags on every tenth word after that. I still had 6 tags in place when the entry was finished.
[info]maradydd wrote:
Aug. 26th, 2005 08:39 am (UTC)
Good points. It's kind of a difficult tradeoff, though -- I want to be comprehensible, but on the other hand, if there's really just one point I want to make, providing background explanations for every concept risks obscuring that point in a sea of information.

Do you see a good middle ground? (In this specific case, I think a quick definition of typesafety was probably in order, ditto why void*'s emphatically aren't typesafe -- but explaining casting, beyond "it's a way of telling the compiler to treat one type as if it were really another type", strikes me as more information than is really needed.)
[info]mycroftxxx wrote:
Aug. 26th, 2005 08:43 am (UTC)
Uhm, maybe explaining the use of "type" in this context. Generally, the worst hiccups occur when the words being used have special meaning far removed from their normal usage. A quick readthrough of your final work, looking for such unusual vocabulary, would probably tell you where to look. For people like me, actually knowing exactly what is going on isn't absolutly necessary, but explaining enough that we could then explain it to others would be nice.
[info]maradydd wrote:
Aug. 26th, 2005 09:38 am (UTC)
"Type" is, um, pretty much exactly what it sounds like: what type of data are you dealing with?

Type information lets the compiler know how much storage to reserve for a variable. Just how much gets reserved is architecture-dependent (and I believe also compiler-dependent), but the C standard gives you a few (vague) guarantees, such as "long int will always be at least as long as int, which is always at least as long as short int". (Yes, they can legally all be the same length, and on some architectures, such as PIC microcontrollers, they are.) char is typically one byte (corresponding to the ASCII characters); on 32-bit platforms, int is typically 4 bytes.

Now then. When you define a struct type, that tells the compiler, "Hey, every time the programmer declares a variable of this struct type, reserve enough space for all the components that make up the struct." And, indeed, if all you do is declare a variable of that type and make assignments to and call functions on the members of that struct directly, you are pretty much okay. However, when you introduce pointers, things get hairier.

A pointer is a sort of meta-variable: its value, instead of being the variable in question, is actually the memory location of whatever variable you're talking about. So if you have an int* p, the value of p is the address of the first byte of however much storage needed to be allocated for an int. You can access the actual value of that memory location by dereferencing the pointer (the dereference operator is also *, which confuses the hell out of many beginning C programmers. At least it did me.)

All memory addresses are given as integers. This means, then, that all pointers are the same size (and are typically the same size as int, though I suppose that could be implementation-dependent too, even though I can't imagine why anyone would.) So, if you have a pointer to a struct of one type, you can lie and tell the compiler to treat it as a pointer to a struct of another type. The compiler doesn't know any better, and will blithely let you dereference data members in the struct-of-another-type, even if they were never initialised in the first place. (In which case you will get a segmentation fault at runtime, as you are trying to "dereference a NULL pointer".)

To make a long story short (too late!), a pointer doesn't really know what kind of data it points to, even though in the syntax it pretends to. In other, more type-strict languages, you don't get pointers; you get references, which do know what they're pointing to. Paradoxically, this leads to lazily typed languages like Python, which will blithely let you do things like creating a list of arbitrarily typed references and then throw errors at runtime when you try to do things like use arithmetic operators on classes which don't have those operators defined.

Crap. I wasn't planning on making this that detailed.
[info]maradydd wrote:
Aug. 26th, 2005 09:47 am (UTC)
Though, that said, typing all that out has made me think more critically about things I already "knew" (especially pointer arithmetic), so I'm glad I wrote it.
[info]grepmaster wrote:
Aug. 26th, 2005 09:03 pm (UTC)
( and are typically the same size as int, though I suppose that could be implementation-dependent too, even though I can't imagine why anyone would. )

You've obviously never programmed on an Alpha, and possibly not on any other 64 bit arch either :)

typical 32-bit: short int=16, int=32, long int=32, long long int=64
typical 64-bit: short int=16, int=32, long int=64, long long int=64

So the best approximation of a pointer integer type is usually actually a long int.
[info]maradydd wrote:
Aug. 26th, 2005 09:13 pm (UTC)
You've obviously never programmed on an Alpha, and possibly not on any other 64 bit arch either :)

That is correct :) Well, mostly correct. One of my dev boxes on campus is a dual-Opteron, but I haven't yet done anything intending to take advantage of its architecture, so I haven't sat down and really learned much about it yet.

Thanks for the heads-up.
[info]medains wrote:
Aug. 26th, 2005 08:43 am (UTC)
I like 'em, they show me that there is at least one other programmer in the world that recognizes muppetry in published code.

Although in their defence, the original code may have been written by a 16 year old on work experience, or a 12 year old hacker, and no-one's bothered to clean it up. ;)
[info]maradydd wrote:
Aug. 26th, 2005 08:55 am (UTC)
Funny thing is, in this case it's actually remarkably clean and pretty code -- well-documented, not at all hard to follow despite the fact that there's ~10MB of it. It's just clean and pretty code that, from time to time, does things which are utterly baffling due to the fact that they're obviously premeditated. :P
[info]st3v3 wrote:
Aug. 26th, 2005 09:24 am (UTC)
Overviews and concepts are cool because they give me ideas for projects. Talking about computational linguistics, say, gives me ideas for programming languages or translation systems or text-to-speech apps, things of that ilk.

But the shorter the better, for me; I've got my own code and I tend to use LJ as a break from a programming task, so groking another complex programming situation isn't what I'm looking for. But short pieces saying, (for example) 'here's a funky bit of code you can use to...' or 'there's a package that...' or 'this community is really helpful...' - that's something that can help lighten the load.

Any help?
[info]maradydd wrote:
Aug. 26th, 2005 10:01 am (UTC)
Quite. :) Of course, now you've got me wishing I were working on something more general-purpose in a programming sense. I don't really find myself developing the sort of clever little algorithmic hacks that other people could use in other situations, unfortunately. The Current Project, for instance, involves taking some very hard sums and integrating them into a database backend in such a way that the end-user never realises just how much math is going into (hopefully) making his life easier, and most of the challenges I'm running into are quirks of the backend in question. Fascinating to Postgres hackers, I'm sure, but really, how many of us are there?

But putting the challenges into words helps me codify the problems and their solutions, so I end up inflicting them on you lot. Now if only I could do so in a way that didn't bore people stupid :)

Oh well. In another week this project is done, and then I can think about something else.
[info]st3v3 wrote:
Aug. 26th, 2005 11:35 am (UTC)
Y'see, the general points, like this;

taking some very hard sums and integrating them into a database backend in such a way that the end-user never realises, [...] making his life easier

is exactly the kind of general stuff I find funky. There's a principle there worth considering, abstract enough to apply across many fields. I don't have to deal with Postgres engines, but I do have to deal with making people's lives easier by making mine harder.

Now, this ties into my headspace in ways you can't know about. When I read this, I thought of Anagram by Textual and Specification by Example and Subtext - which are all ways I really like to take the difficulty out of a user's life and give it to a machine intelligence.

Now, I think my point is this;

(1) It's in the nature of LJ and the web that we scan, so big chunks of text get less attention per word.

(2) you can't know what's going to make my brain pop and fizzle with new ideas. But something is - that's why I like reading.

(3) Short, abstract chunks are more likely to (a) get attention, and (b) be applicable to my own thinking, and so (c) cause brainfizz.

On the other hand - the detail in your posts is very, very useful for the right audience. Some googling programmer will love you for adding it to t'internet. So write; I'll scan, and google will crawl. Everyone's happy.
[info]hominysnark wrote:
Aug. 26th, 2005 11:35 am (UTC)
At times what you post is waaay over my head, but I read it anyway, because I tend to pick up things by osmosis. So I'm learnin' stuff, even if I don't always know exactly what it is.
[info]deza wrote:
Aug. 26th, 2005 11:42 am (UTC)
Ditto.
[info]maradydd wrote:
Aug. 26th, 2005 09:27 pm (UTC)
I'm glad to hear that. :) I feel like I've really drifted away from you writerly types in the last couple of years, and I miss having the time and focus to keep up with what y'all are doing. I look at what people like [info]slithytove and Charlie et al have accomplished in the last five years and it just impresses the hell out of me. The OWW folk are a terrific group of people, and I'd hate to lose you guys out of what amounts to absentminded-professorism.
[info]deannahoak wrote:
Aug. 26th, 2005 12:06 pm (UTC)
I know zilch about coding, so I mainly glance over those entries and think, "Damn, Merry's brilliant. Wish I knew what the hell she was talking about." :-)
[info]jdeguzman wrote:
Aug. 26th, 2005 06:17 pm (UTC)
Second that! :)
[info]ernunnos wrote:
Aug. 26th, 2005 02:28 pm (UTC)
It's good stuff.
[info]ben wrote:
Aug. 26th, 2005 05:03 pm (UTC)
You technical folks are all such geeks!
[info]xtopher42 wrote:
Aug. 26th, 2005 05:50 pm (UTC)
Keep doing what you are doing. I'd rather have a slightly too dense slice of your mind rather than a watered down digest of the events of your day.
[info]kirinqueen wrote:
Aug. 26th, 2005 07:19 pm (UTC)
Seconded.
[info]grepmaster wrote:
Aug. 26th, 2005 09:16 pm (UTC)
hehehe
I think my position on this matter should be clear from the comments I just posted.

(pick any of: 1. "the more technical, the better!" 2. "I wasn't asking YOU, I was asking the people who AREN'T the programming geeks" 3. "I wasn't asking you, I was asking the people I've talked to for more than five minutes" 4. other)
[info]maradydd wrote:
Aug. 26th, 2005 09:22 pm (UTC)
Re: hehehe
I have talked to you for more than five minutes, though I think it was only that one time over at [info]mycroftxxx's.

And the comments are welcome anyway. :)
[info]shkspr13 wrote:
Aug. 27th, 2005 03:36 pm (UTC)
To some degree, I feel about the same as just about everybody who's already commented, but being who I am, I have to make my own anyway.

To be honest, I frequently glaze over with some of your coding posts, but no more than I did with the Steinbeck story I mentioned the other day, and I have a passion for literature. So, it's nothing you ought to take personally; it's just part of who I am.

In other words, keep up the good work. :)
[info]q_pheevr wrote:
Aug. 27th, 2005 05:08 pm (UTC)

I'm a pesudotechie: I get most of the concepts but very little of the specifics. I know what pointers are, and if I think about it, I can figure out the relevant facts about how they must be implemented, but I have no idea what * means (at least not in C; if it's a Kleene star, I'm fine). I took a couple of undergraduate CS courses, but that was back in the days when U of T was still teaching them in Turing (they've since switched to Java).

The upshot is that I really enjoy reading about notable instances of cleverness and stupidity in coding, and if they're described in sufficiently abstract terms, I can even understand them.

Latest Month

August 2008
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      
Powered by LiveJournal.com
Designed by Tiffany Chow