Entries Tagged as 'code'

Code momentum

In computing, code momentum is the situation where large amounts of code dependency are repeated in programming code creating a stubborn dependency. That is a sort of momentum. The more things are done one way, the more definitely you’re headed in that direction, and the harder it is to change course. Some claim that minimizing dependencies limits momentum and makes it easier to change course.

Code momentum is alleged to be an example of an anti-pattern.


Criticism

However, coding to an API with multiple implementations to choose from is not necessarily harmful. For example, JDBC is the de-facto standard for communicating with relational databases in Java (when not using object-relational mapping). Although using JDBC creates a dependency on JDBC, that is not necessarily a big deal - as opposed to using some non-standard, vendor-specific extensions or SQL syntax, which does create a dependency on one database and makes it harder to shift.

Moreover, trying to reduce external dependencies too much may result in Not invented here syndrome, which can be counterproductive.


See also

Adapt to adapt for an anti code momentum checklist.


References

  • Code Momentum from Perl Design Patterns Book

Group code

In computer science, group codes are a type of code. Group codes consist of
<math>n</math> linear block codes which are subgroups of <math>G^n</math>, where <math>G</math> is a finite Abelian group.

A systematic group code <math>C</math> is a code over <math>G^n</math> of order <math>\left| G \right|^k</math> defined by <math>n-k</math> homomorphisms which determine the parity check bits. The remaining <math>k</math> bits are the information bits themselves.


Construction

Group codes can be constructed by special generator matrices which resemble generator matrices of linear block codes except that the elements of those matrices are endomorphisms of the group instead of symbols from the code’s alphabet. For example, consider the generator matrix

<math>

G = \begin{pmatrix} \begin{pmatrix} 0 0 \\ 1 1 \end{pmatrix} \begin{pmatrix} 0 1 \\ 0 1 \end{pmatrix} \begin{pmatrix} 1 1 \\ 0 1 \end{pmatrix} \\
\begin{pmatrix} 0 0 \\ 1 1 \end{pmatrix} \begin{pmatrix} 11 \\ 1 1 \end{pmatrix} \begin{pmatrix} 0 0 \\ 0 0 \end{pmatrix}
\end{pmatrix}
</math>

The elements of this matrix are <math>2 x 2</math> matrices which are endomorphisms. In this scenario, each codeword can be represented as
<math>g_1^{m_1} g_2^{m_2} … g_r^{m_r}</math>
where <math>g_1,… g_r</math> are the generators of <math>G</math>.


References

  • E. Biglieri and M. Elia, Construction of linear block codes over groups, Proc.IEEE Int symp. on Information Theory (San Antonio, Tx, Jan 1993), pages - 360.
  • G. D. Forney, M. Trott, , IEEE Trans. Inform. theory, Vol 39 (1993), pages 1491-1593.
  • V. V. Vazirani, Huzur Saran and B. S. Rajan, , IEEE Trans. Inform. Theory 42, No.6, (1996), 1839-1854.
  • A. A. Zain, B. Sundar Rajan, “Dual codes of Systematic Group Codes over Abelian Groups”, Appl. Algebra Eng. Commun. Comput. 8(1): 71-83 (1996).