JSLint-Feature – Error Severity
Hi Douglas,
I have been to a good number of your talks, and I love the idea behind JSLint. I even don't mind it when JSLint makes me cry every now and then, however, I feel like the priority of JSLint should be around launch successful code early and often.
Here at Kabam we build games that run as HMTL5 apps, and recently we have started to use JSLint as part of our build process. In a few cases it has caught some minor errors and we were later able to resolve them.
Our build process uses Jenkins, which is an open source version of Hanson. These continuous build automation tools make use of another wrapper library you might be familiar with. http://code.google.com/p/jslint4java/
So in this sense let's say a develop wants to add a new piece of code, and this code causes a problem.
JSLint reacts in the following ways,
- it has a an error limit and stops reporting erros after a certain amount
- errors are not prioritized based on 'newness' - because that would be hard
- errors are not prioritized based on priority.
The end result is that a team must fix all errors to get the maximum value out of JSLint.
I propose a 2 part solution.
1. JSLint should not set error priority, unless it sets sensible defaults
2. JSLint should report an error code so that a wrapper like jslint4java could use a config file set an error priority.
This would allow teams to triage error types as part of their build/ development process.
On line 1326 you have a function warn() defined I propose it's written something like so, including a new warning property, defining an error.type property using the bundle[] accessor name as the error code.
If you think of some other change that could get to the spirit of what I am looking for that would be great too. If I get the time I might try to implement a prototype. Hudson and Jenkins have 3 levels of errors, High, Medium, and Low.
Would you have some suggestions as to what would make good defaults for each of the error.types?
I feel like this change would better support agile development and continuous integration, and would allow teams to prioritize their development efforts.
Thank you for being a beacon and leader in the community.
function warn(message, offender, a, b, c, d) {
var character, line, warning;
offender = offender || next_token; // `~
line = offender.line || 0;
character = offender.from || 0;
warning = {
id: '(error)',
raw: bundle[message] || message,
type: message,
evidence: lines[line - 1] || '',
line: line,
character: character,
a: a || (offender.id === '(number)'
? String(offender.number)
: offender.string),
b: b,
c: c,
d: d
};
warning.reason = warning.raw.supplant(warning);
JSLINT.errors.push(warning);
if (option.passfail) {
quit(bundle.stopping, line, character);
}
warnings += 1;
if (warnings >= option.maxerr) {
quit(bundle.too_many, line, character);
}
return warning;
}
Using Cellular Atomata as a Design Principal for ‘Natural Design’
I read this really thought provoking article using Cellular Atomata, prime numbers, and layered images to create seemingly random backgrounds for web pages. Yes, backgrounds for web pages.
The problem is that on so many web pages, load time is an issue and so is screen size, so it's really hard to avoid those lines or patterns that seem to repeat and distract from the content on a variety of devices.
It's actually a great design principal to accommodate randomness, so the eye can focus on the structured content. It's kinda like having a great forest in the background to an architectural monument. If done right the monument and surrounding garden will really pop against the scene.
In any case the author, Alex Walker, discusses how to uses geometric patterns based on prime numbers to create a sort of randomness in the background. The examples he gives are a much more understandable explanation than say Stephan Wolfram gives about the value of cellular automata in creating natural systems.
I think this better illustrates what Stephan Wolfram was talking about with cellular automata.
It's clearly brilliant to use it as a graphic design principle.
Maybe Cellular Atomata (CA) rules could be used to generate layout width & height rather than typical asymmetrical patterns? An app like Flipbook could benefit from it, to keep the page layouts feeling designed and fresh.
I think Alex is on to something here using CA (Cellular Atomata) as a design pattern.
I would love to see it in designing UX and Architecture. I would love to see CA being used as a way to generate dynamic, but structured design.
It's brilliant. Imagine what Santiago Calatrava could do with such a pattern.
Paypal IPN Validation Fails with Adaptive Payments and PHP query/ post parameters
If you are looking for a solution you can find it here.
Thank you Gleb ( http://www.memberwing.com/ )
https://www.x.com/message/158509#158509
The problem comes in how the API is designed, and it takes advantage of a little known feature of query parameters and their allowed characters. Paypal uses array'ed parameters like:
&transaction[0].status=value
The problem is that PHP does not know how to parse the query parameter and either skips it or stops processing the list. ( i can't remember which ).
Paypal's Adaptive Payments API is neat and freshens up their functionality, and additionally uses JSON as a communication layer, so I think it's clearly their future, however, there are a number of little problems like this as you walk through getting up to speed on the API. I hope this helps anyone in the future by saving them an hour to day.
It kinda reminds me of some of the problems we had getting the MySpaceID API up and polished so I guess this is a nod to all of those APIs that do it right the first time.
Cheers.