tag:blogger.com,1999:blog-3224008808345429390.post3452916728056093134..comments2024-03-06T00:59:29.668-05:00Comments on Zaemis: Spaghetti Code Considered HarmfulTimothy Boronczykhttp://www.blogger.com/profile/00015151416507514182noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3224008808345429390.post-38119895241824351112011-05-24T09:52:55.629-04:002011-05-24T09:52:55.629-04:00Responding to Anonymous at comment #2 — my experie...Responding to Anonymous at comment #2 — my experience, both as a developer and mentor in a couple of dozen different languages, is that it's a mindset thing. Spaghetti code is, almost always, written in one long conceptual flow, without pause to reflect and refactor. This long movement continues until it's either done or too brittle to continue, and then when someone tries to continue doing anything with it later, they discover that it's congealed into a unitary mess.<br /><br />Long, long ago, people started realising that it made better code if you wrote as little as possible, tested it, verified that it did what you thought it did as cleanly as it possibly could (after a few refactorings), and then wrote the next bit. Today, that's called "agile;" back when I learned programming in the Paleolithic, it was called "incremental development."<br /><br />Nobody can maintain the same intensity of concentration for extended periods of time, repeatedly. Technology and/or biology, in one form or another, intervene. Structuring how you write code to take advantage of that, rather than attempting to fight against it, is how the best code I've ever seen has been written. In any language, on any platform.<br /><br />You don't have to code Java to be agile; I've been on teams that used Agile Manifesto-compliant systems in languages most JavaSchools™ ex-inmates have never touched: COBOL, FORTRAN, Lisp, APL; the list goes on.<br /><br />But whatever language you're using, whatever you're trying to develop, once the light-bulb goes on and you "get" the (to you) New Way of doing things, it becomes far too painful to go back; like "building a mnemonic memory circuit using stone knives and bearskins," to quote a character I'm sure is familiar to most who read this. It <i>may</i> be possible, at least in theory, if you're sufficiently talented, diligent, creative — and lucky.<br /><br />Just don't bet <i>my</i> paycheque on it.Anonymoushttps://www.blogger.com/profile/12760673999356987827noreply@blogger.comtag:blogger.com,1999:blog-3224008808345429390.post-25345227150132325002011-05-21T04:08:22.213-04:002011-05-21T04:08:22.213-04:00I can understand the whole "be positive"...I can understand the whole "be positive" approach, however, I think the problem with spaghetti code is the effect of having to deal with it on a daily basis. This effect slowly breaks down the morale of any developer, even hardened veterans. It essentially cripples a development team/department.<br /><br />Some applications, even on an enterprise level, have entire components which were written years before you, and still play a major part in the application stack. This means a rewrite, even partially, is a no-no due to the many reasons management will be more than happy to give you.<br /><br />Unfortunately, legacy is a reality, the problem is that its not always taken into account in the planning. The common answer you get is: "a rewrite doesn't generate profits" or "refactoring code doesn't help our clients", when the reality is that spaghetti code can single-handedly destroy your team, your product, and finally, your company.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3224008808345429390.post-35084403219612205502011-05-20T13:34:12.589-04:002011-05-20T13:34:12.589-04:00There's a common lingo here, the people who an...There's a common lingo here, the people who answered your poll just aren't familiar with it. :) http://en.wikipedia.org/wiki/Spaghetti_code<br /><br />"...code that has a complex and tangled control structure, especially one using many GOTOs, exceptions, threads, or other "unstructured" branching constructs. It is named such because program flow tends to look like a bowl of spaghetti, i.e. twisted and tangled."Gabriel Khttp://www.gabrielkoen.com/noreply@blogger.comtag:blogger.com,1999:blog-3224008808345429390.post-11578639349015694652011-05-20T12:33:34.856-04:002011-05-20T12:33:34.856-04:00For quick demonstrative prototypes or less complex...For quick demonstrative prototypes or less complex tasks in straightforward environments there are no reasons for you not coding spaghetti style.<br /><br />But the more complex an application becomes, the more you have to regard advanced techniques to master daily business tasks.<br /><br />I do usually develop in major sized php projects. One aspect is that long-running projects often suffer of short-sighted architecture, technical challenges and a disparity of programming skills. So I invented a system where I can combine spagehtti, lasagna or ravioli code written in different styles.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3224008808345429390.post-74018746595756138472011-05-18T15:29:44.765-04:002011-05-18T15:29:44.765-04:00I myself write Lasagna code. That's simply sp...I myself write Lasagna code. That's simply spaghetti code that's multi-layered!!!BobMCThttps://www.blogger.com/profile/13695810142995677716noreply@blogger.com