This paper deals with one of the fundamental properties of grid computing – transferring code between grid nodes and executing it remotely on heterogeneous hosts. Contemporary middleware relies for this purpose on Web Services, which makes application programs complicated and low-level and requires much additional expertise from programmers. We compare two mechanisms for grid application programming with regard to their handling of code transfer – the de-facto standard WS-GRAM in Globus and the higher-level approach based on HOCs (Higher-Order Components). We study the advantages and problems of each approach using a real-world application case study – the sequent alignment problem from bioinformatics. Our experiments show the trade-off between reduced development costs and software complexity when HOCs are used and the higher performance of the applications on the grid when using WS-GRAM.