Hacker News new | ask | show | jobs
by scott_s 5169 days ago
The code examples are confusing. First, I think there is a typo in the first two examples; I think < should be <<. But he never actually explains what the semantics of << are until several examples in, and it took me a long time to figure out that the string value 'x, y=3' gets evaled into code. Which is strange, to mix strings as code, when the whole point is to have code be code.

At the very least, the semantics of this need to be explained better. When you give a new code example, you always need to say "And this is the result." Otherwise, I can't close the loop; I have new code with new and unknown semantics, and an unknown result. I need to have a known result to figure out the new semantics. (Much like you can't solve a single equation with two unknowns; you either need to have one unknown, or two equations.)

2 comments

Just read the docstring of the module. It's very detailed.

As for mixing strings with code, I still need to adhere to Python's syntax in order to avoid syntax errors. Anyway, syntax errors in strings are caught at "rewriting time". Using words instead of operators would also cause some problems.

You're putting the carriage before the horse. People want to evaluate what it is they're getting into before they download it. If they can't understand the code examples, they won't get as far as downloading the module and looking at the docstring.

I understand why you had to use strings as code. I had two concerns about that. One, you didn't explain it - I had to figure it out on my own. And two, if a solution is supposed to make things cleaner, but ends up introducing warts like that... maybe it's not worth it. What you implemented is interesting, no doubt, but I wouldn't want to use it for that reason.

However, I think you would benefit greatly from having improved examples. Even if people don't use your module, they can still build on your ideas if it's well explained.

People want...? codeblocks is free and I don't get paid for it. If someone is so lazy that he won't even have a look at the doc in the code (as suggested in my article), I don't want to have anything to do with him or her.

1 click --> bitbucket

1 click --> source

1 click --> codeblocks.py

It's that too much to ask?

shrug

I'm assuming that you want people to use your work. People need convincing. There are thousands and thousands of ideas and projects out there. The ones that are well explained are the ones that will get attention. I do research for a living. The research itself is only half the job. Presenting the research - convincing people that what I did is important and useful - is the other half.

Basically, what is your objective: do you want to be right, or do you want to be heard? You said you welcome constructive criticism. That is what I'm trying to provide - except it's not about your work itself, but about better ways to present it.

I do research for the heck of it and if other people think that what I'm doing is useless, I'm ok with that. That's the mathematician way. The exploration is the end, not the mean.

I'm not trying to convince anyone that my "project" is useful because that's not my project anymore. Anyone can look at it, dissect it, propose new feature, etc... Now that the thrill of the exploration is almost over, I'm losing interest... but I'll keep an eye on my repository on bitbucket.

By the way, if someone could provide better examples, documentation, etc... I'd be grateful. Let's just say I'm not much into the "convincing thing". If you need convincing, don't look at me. I gave you an object. Now it's your job to figure out what to do with it (or just toss it away) ;)

Should it be "<< 'x'" rather than "<< 2"?
I don't believe it. Let's try to fix it again... thanks.
By the way, I wish that '<' was a simple typo. Unfortunately it's Wordpress: it's driving me mad. Everytime some code has '<' and '>' in it, something unexpected happens.