Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm hijacking this since your function shows the kind of case where I like to make an exception to the line length rule.

It looks much better, and is more understandable due to the repeating pattern, as you have it, but some people I've collaborated on open source code with would insist upon this:

     function solve_fem_problem(problem_description) {
         basis_functions = generate_basisfunctions(basisfunctions_type.b_spline);
         quadrature_rule = generate_quadrature(quadrature_type.gaussian_quadrature);
         A = assemble_matrix(problem_description.differential_equation, basis_functions, quadrature_rule);
         b = assemble_righthandside(problem_description.differential_equation, basis_functions,
             quadrature_rule);
         apply_boundary_conditions(problem_description.boundary_conditions, A, b);
         solution = linsolve(A, b);
    }
(For this example, I'm assuming an arbitrary maximum line length of between the A = and b = lines.)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: