This paper is concerned with the trajectory definition in robot tasks. Although very often ignored, the specification of robot motion is not the first step in the definition of a robot task. The task definition starts with the description of the final outcome, i.e. with the specification of the job to be performed. When this is done, the proper robot kinematics (motion law) is defined. This step, from the outcome of the task to the robot motion, is sometimes straightforward and dictated by the technology applied. However, even if a multiple choice of motion is possible leading to the same outcome, this possibility is usually avoided by preassuming a certain optimality criterion for the quality of work. Clearly, such an approach does not leave the possibility for some additional optimization in the sense of a secondary objective. So, some potential benefits are lost. This paper starts from the observation that successful operation of a robot does not necessarily imply the maximum quality of its outcome. It is sufficient if the quality is kept at a given (lower) level. Such a suboptimal task execution offers the possibility of some additional secondary optimization. The kinematics of the task is modified according to a secondary objective function. The quality is then treated as a constraint in the minimization of this secondary objective function. This optimization can be based on biomechanical principles. Here the principle: "learn from humans" is adopted, i.e. the kinematics modification is done so as to resemble the behavior of a human worker. The benefits of the approach of the paper are illustrated by two specific examples, namely the handwriting and spray-coating tasks.