adamcameron / cfml24h

Learn CFML in 24 hours
Other
21 stars 4 forks source link

Semicolons, explanation of WHERE to run code. #9

Closed cybersonic closed 9 years ago

cybersonic commented 9 years ago

Going through https://github.com/daccfml/cfml24h/wiki/Chapter-1 I see that you define some expressions but without a semi-colon. I would thought this is required for an expression?

Also, we see no round them or explanations, this would make me write a file as

index.cfm something = something

adamcameron commented 9 years ago

Read the stuff on expressions vs statements. It's statements that have semi-colons, not expressions. And it does specifically say statements need semi-colons or a block.

There does need to be a formatting difference between "this is pseudo code" (semi-colons not necessary), and "this is actual code" (semi-colons necessary). I know it's not clear at the moment. The code will (generally) have a comment after the relevant statement stating the result. Pseudo-code will be vague examples like the one you quote above.

That said I have noticed that some of the code examples actually do indeed have semi-colons missing. I'm picking them up as I notice them.

cybersonic commented 9 years ago

I hadn't got to section that defines the distinction at time of writing. I had followed the flow from Chap 0 which got us off writing code in repl, then you showed examples in Chapter 1, which in theory would not run in the repl as they were pseudocode not actual code. Hence the ticket.

As a reader this would be confusing.

adamcameron commented 9 years ago

Again, this would be more clear if the formatting allowed for "this is pseudo code" and "this is actual code (so you could run this and see something)".

Using your quoted example:

someVariableName = someValue

The lack of semi-colon is the least of our worries here. That'll have a runtime error because someValue isn't defined.

Also note that the CommandBox REPL runs Railo, and that actually would compile just fine without the semi-colon ;-) Still: that's not your point, and indeed I'm supposedly writing vendor-neutral code there.

But I am not in the slightest bit concerned about formatting considerations at the moment, whch is all this really is. You're trying to run something thinking it's a code example when it's not. And the ambiguity is down to formatting shortcomings of Markdown (which I am getting more and more irritated by as time goes on).

That said, I'll look @ hoisting the command/statements/expressions section to the top, as perhaps that makes sense. Stay tuned...

alexskinner commented 9 years ago

I think github also supports rst

Checkout the preside docs

Might be more friendly

A

Sent from my phone On 24 Jan 2015 18:28, "Adam" notifications@github.com wrote:

Again, this would be more clear if the formatting allowed for "this is pseudo code" and "this is actual code (so you could run this and see something)".

Using your quoted example:

someVariableName = someValue

The lack of semi-colon is the least of our worries here. That'll have a runtime error because someValue isn't defined.

Also note that the CommandBox REPL runs Railo, and that actually would compile just fine without the semi-colon ;-) Still: that's not your point, and indeed I'm supposedly writing vendor-neutral code there.

But I am not in the slightest bit concerned about formatting considerations at the moment, whch is all this really is. You're trying to run something thinking it's a code example when it's not. And the ambiguity is down to formatting shortcomings of Markdown (which I am getting more and more irritated by as time goes on).

That said, I'll look @ hoisting the command/statements/expressions section to the top, as perhaps that makes sense. Stay tuned...

Reply to this email directly or view it on GitHub https://github.com/daccfml/cfml24h/issues/9#issuecomment-71330897.

adamcameron commented 9 years ago

@cybersonic what do you think now I've reordered Chapter 1?

I've also noticed it finishes rather abruptly. I'll deal with that later.

adamcameron commented 9 years ago

@alexskinner might look @ that. But my eyeballs are about to fall out, so not today.

adamcameron commented 9 years ago

Closing due to topic drift.