A rather complete numerical study of the perturbed and nonperturbed sine-Gordon equation in one-dimensional Cartesian coordinates and finite domains is presented. The numerical study is based on five, three-point, linearly implicit finite difference methods of different spatial accuracy. For the unperturbed sGE, the accuracy of these five methods is found to be very sensitive to the implicitness parameter, less sensitive to the spatial order of accuracy, and almost no sensitive to the time step for second-order accurate, temporal discretizations. The largest errors of the five methods were found to occur at the front of the soliton solution of the unperturbed sGE, but the techniques were very accurate for long-time computations of the unperturbed sGE in both infinite domains and in finite domains upon many collisions of the kinks and antikinks with the boundaries, despite the fact that they do not preserve a discrete energy. It is shown that the largest values of the kinetic and total energies, and the smallest values of the strain and potential energies occur when solitons and antisolitons strike on the boundaries subject to homogeneous Neumann conditions, and the four energies remain constant between collisions with the boundaries. For the Malomed's perturbation, one of the fronts of the soliton–soliton doublet and soliton–antisoliton doublet is trapped at one boundary and the other one undergoes a change in amplitude and its front describes a curved trajectory; the soliton–antisoliton breather oscillates in a damped manner and slowly drifts towards one boundary. The soliton, antisoliton, soliton–soliton doublet and soliton–antisoliton doublet of the unperturbed sGE are robust under Kivshar and Malomed's perturbations, whereas the soliton–antisoliton breather loses its integrity, becomes a kink–antikink pair and then yields a chaotic behaviour in both space and time. Small amplifications proportional to the first-order temporal derivative of the amplitude do not alter substantially the initial dynamics of the soliton, antisoliton, soliton–soliton doublet and soliton–antisoliton doublet, but their amplitudes exhibit oscillatory behaviour of increasing amplitude at large times; however, small amplifications cause first a transition from the soliton–antisoliton breather to the kink–antikink solution. A linearized stability analysis of the spatially homogeneous solutions of the unperturbed sGE is performed and analytical solutions are obtained by means of the method of separation of variables for both homogeneous Dirichlet and Neumann boundary conditions, and the results show that the solution corresponding to a zero amplitude is oscillatory in both space and time, whereas that corresponding to an amplitude equal to π may exhibit exponential or linear growth depending on the length of the domain. If either of these growths is present, it is shown that the evolution of small, initial perturbations may result in homoclinic crossings and chaotic behaviour in both space and time in the absence of perturbations in the sGE and the existence of an attractor when perturbations of the Malomed's type are present. In either case, the solution may exhibit certain spatial symmetries or antisymmetries at large times. Finally, the results presented in this paper indicate that the accurate computation of homoclinic orbits of the sGE is not only controlled by the spatial accuracy of the numerical method, but also by its energy-preserving characteristics, and, perhaps, by the number of grid points used in the numerical technique.