The aim of this article is to find definitions for shifts of finite type and sofic shifts in a general context of symbolic dynamics. We start showing that the classical definitions of shifts of finite type and sofic shifts, as they are given in the context of finite-alphabet shift spaces on the one-dimensional monoid N or Z with the usual sum, do not fit for shift spaces over infinite alphabet or on other monoid. Therefore, by examining the core features in the classical definitions of shifts of finite type and sofic shifts, we propose general definitions that can be used in any context. The alternative definitions given for shift of finite types inspires the definition of a new class of shift spaces which intersects with the class of sofic shifts and includes shift of finite types. This new class is named finitely defined shifts, and the non-finite-type shifts in it are named shifts of variable length. For the specific case of infinite-alphabet shifts on the lattice N or Z with the usual sum, shifts of variable length can be interpreted as the topological version of variable length Markov chains.