0844: "Good Code"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

Tchiak
Posts: 27
Joined: Fri Aug 22, 2008 10:01 pm UTC

Re: 0844: "Good Code"

Postby Tchiak » Fri Jan 07, 2011 6:03 pm UTC

dahauns wrote:I just can't help but wonder...has no one here ever worked with a language with proper refactoring support?

We don't take kindly to your kind 'round here. *sound of shotgun be cocked* Why don't you just move along.

snozbunny
Posts: 2
Joined: Fri Jan 07, 2011 6:19 pm UTC

Re: 0844: "Good Code"

Postby snozbunny » Fri Jan 07, 2011 6:23 pm UTC

I fixed your graph. I just replaced the question mark with Model-View-Controller.


Thank you it made my day.

User avatar
just john
Posts: 61
Joined: Thu Nov 08, 2007 2:11 pm UTC
Location: Poughkeepsie, NY
Contact:

Re: 0844: "Good Code"

Postby just john » Fri Jan 07, 2011 6:56 pm UTC

Tchiak wrote:
dahauns wrote:I just can't help but wonder...has no one here ever worked with a language with proper refactoring support?

We don't take kindly to your kind 'round here. *sound of shotgun be cocked* Why don't you just move along.


So you immediately go to the gun?

You really should go sub the gun.
* Radio Free Entropy: http://just-john.com/jjMusic

Captain Jack
Posts: 1
Joined: Fri Jan 07, 2011 6:57 pm UTC

Re: 0844: "Good Code"

Postby Captain Jack » Fri Jan 07, 2011 7:00 pm UTC

Best. Strip. Ever.

Yes, I am a software developer, who recently escaped from a company who used that exact flowchart as their business model.

Whew.

Twigshusband
Posts: 51
Joined: Thu Feb 18, 2010 2:00 pm UTC

Re: 0844: "Good Code"

Postby Twigshusband » Fri Jan 07, 2011 8:53 pm UTC

10 Print "HELLO"
20 Goto 10

How does this fit in the flowchart?

baffo32
Posts: 1
Joined: Fri Jan 07, 2011 9:03 pm UTC

Re: 0844: "Good Code"

Postby baffo32 » Fri Jan 07, 2011 9:04 pm UTC

Twigshusband wrote:10 Print "HELLO"
20 Goto 10

How does this fit in the flowchart?

"Does it work yet?"

User avatar
soren121
Posts: 53
Joined: Thu Jun 19, 2008 7:25 pm UTC

Re: 0844: "Good Code"

Postby soren121 » Fri Jan 07, 2011 9:25 pm UTC

I choose the HURD loop. Microkernels FTW!
PHP/XHTML/CSS Programmer
http://www.sorenstudios.com/
Fueled by all of this and V8

SoreThumb
Posts: 1
Joined: Fri Jan 07, 2011 9:20 pm UTC

Re: 0844: "Good Code"

Postby SoreThumb » Fri Jan 07, 2011 9:25 pm UTC

Joined just to say how perfect this comic was.

I have so many projects I want to "get done", but I want to get "Good Code".
So, as you can imagine, I haven't gotten anything done-- not even Code Well, or Code Fast.

It's so, so sad. Thanks, Randall.

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6598
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: 0844: "Good Code"

Postby Thesh » Fri Jan 07, 2011 9:31 pm UTC

Captain Jack wrote:Best. Strip. Ever.

Yes, I am a software developer, who recently escaped from a company who used that exact flowchart as their business model.

Whew.


My last company was different. It was "Code Fast" but the requirements (what there was of them) still changed before you could finish.
Summum ius, summa iniuria.

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: 0844: "Good Code"

Postby Technical Ben » Fri Jan 07, 2011 9:38 pm UTC

smartalco wrote:
rpgamer wrote:I'd wager alcohol is a necessary step on the mysterious path to good code.


http://xkcd.com/323/ ?

My new favourite. Could at least the "myth" of this be that we are more creative with a little alcohol. Detrimental in large quantities of cause.
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

correnos
Posts: 16
Joined: Tue Sep 14, 2010 12:17 pm UTC

Re: 0844: "Good Code"

Postby correnos » Fri Jan 07, 2011 9:43 pm UTC

soren121 wrote:I choose the HURD loop. Microkernels FTW!

Unfortunately for all of us, clean, beautifully coded vaporware is still vaporware. I agree that we would all be better off now if Linus had decided to go with a microkernel, or if some other project ended up being the impromptu home for GNU. We can all dream.
If you're seeking the bottleneck, look at the top of the bottle.

hlangeveld
Posts: 3
Joined: Fri Jan 07, 2011 10:51 pm UTC

Re: 0844: "Good Code"

Postby hlangeveld » Fri Jan 07, 2011 10:57 pm UTC

Randall forgot to expand the contents of the cloud:

? ::= http://www.lispcast.com/uncategorized/6-reasons-to-develop-your-tests-first

ethnicolor
Posts: 4
Joined: Fri Jan 07, 2011 11:09 pm UTC

Re: 0844: "Good Code"

Postby ethnicolor » Fri Jan 07, 2011 11:18 pm UTC

"You tread the Quad of Iniquity..."

User avatar
phillipsjk
Posts: 1213
Joined: Wed Nov 05, 2008 4:09 pm UTC
Location: Edmonton AB Canada
Contact:

Re: 0844: "Good Code"

Postby phillipsjk » Sat Jan 08, 2011 2:37 am UTC

I am in the "Good code, eventually" camp.

Modern computers are insecure. It is impossible to build a secure system the "Fast" way. My opinion has changed since that (previously linked) post:

Good code does exist, it just takes time people don't want to invest while the computing industry is advancing so rapidly. I feel there will be a renewed interest in correct code (and hardware) within 250-300 years. I doubt I will be alive to see it.

For those interested, GNU/HURD is still under development. I downloaded the live CD, but have not tried it yet.

PS: Most file formats are inherently insecure. Feature-creep means they often include provision for running unpoven, possibly untrusted code automatically. It is getting so bad that people say devices using "walled gardens" are a "good thing." Recently every major web-browser has had vulnerabilities exposed by JavaScript Fuzz testing. "Dumb" formats such as image formats may not fall into this trap, but image handling libraries for every major OS have been vulnerable to malformed images (potentially allowing arbitrary code execution due to coding errors).

PPS: If you need to store data until the computer industry shakes out, I suggest something like microfiche.
Did you get the number on that truck?

10nitro
Posts: 192
Joined: Mon Nov 03, 2008 8:46 pm UTC
Contact:

Re: 0844: "Good Code"

Postby 10nitro » Sat Jan 08, 2011 4:29 am UTC

correnos wrote:
soren121 wrote:I choose the HURD loop. Microkernels FTW!

Unfortunately for all of us, clean, beautifully coded vaporware is still vaporware. I agree that we would all be better off now if Linus had decided to go with a microkernel, or if some other project ended up being the impromptu home for GNU. We can all dream.

I'm sick of this. Yes, HURD is still in development. However, it is quite usable if you get it installed (install is a little tricky, although, for me part of it was probably me being used to GRUB 1, not GRUB 2, which you have to config manually (last time I set up a HURD box)). No, it isn't as well supported, or support as much hardware as Linux does. Yes, you will have to compile most software yourself, as binary packages aren't generally produced for it. But it _is_ usable.
~ Luke Shumaker
FRC1024 Programmer
IT technician, GNU/Linux admin, comp. security guy
Eagle Scout
http://lukeshu.ath.cx

FoolishOwl
Posts: 52
Joined: Mon Jun 29, 2009 8:36 pm UTC
Location: San Francisco, California
Contact:

Re: 0844: "Good Code"

Postby FoolishOwl » Sat Jan 08, 2011 6:05 am UTC

What I got from Torvald's later comments on the Tanenbaum-Torvalds debate was that the point of a microkernel-based system was abstracting the CPU architecture, allowing for easier code porting. But as it's critical to have an efficient kernel, that's a bad place for such abstraction, and as most modern CPUs have similar architecture, abstracting it isn't really necessary -- it's not that hard to port kernel code to different CPUs.

In other words, my impression was that Torvalds's argument prevailed in practice, and that's why interest in the GNU HURD declined.

thelastholdout
Posts: 14
Joined: Mon Mar 16, 2009 6:24 am UTC

Re: 0844: "Good Code"

Postby thelastholdout » Sat Jan 08, 2011 9:06 am UTC

wsdenker wrote:
thelastholdout wrote:Randall finally mentions Android.

The trouble is, being non technical, I don't know where Android is supposed to be on that flow chart. Having sold the phones and seen how well they've worked (Esp. the ones by Motorola and HTC) I'm inclined to think that it's under "Code well" and "Good code." I also know it's based on Linux, which many computer savvy people seem to like. But then again, my opinion doesn't come from a programmer's perspective; more of an end user's. Randall's opinion won't change mine, but I'd still like to know what his point is. Help?


Android would be under the "code fast" line. The joke is that "good code" might be achievable, but nobody quite knows how it comes about. It has nothing to do with whether Linux is involved or how stable and functional the software appears to be from a user's perspective. Coding quickly is often coding recklessly and one does frequently end up with a functional product but it's hell for developers to maintain.

Developers who pursue the "code well" line are attempting to build the Mr. Fusion powered engine from Back to the Future (the elegant, perfect machine). Most often one ends up falling short because it takes time to code well and then the specifications change while one is in the process of doing so and, well, they are trying to build a fusion powered engine. Those who pursue the "code fast" line end up with a Rube Goldberg contraption under the hood that nobody knows how all of it works, though a few people understand some of the parts.

It is a little bit funny from a programmer's perspective that you said "Randall's opinion won't change mine." You'd have to understand what you're meant to have an opinion about. From your perspective what's under the hood is magic and it's hard to have an opinion about how wizards accomplish it if the end result appears the same. ;)


Oh, I have no illusions that programming is a complete mystery to me. I don't have the mathematical skills in order to ever completely understand it. I have great respect for programmers, and I'm sure that Android probably is a mess under the hood (hence the constant updates and new versions, a la Microsoft). My point when I mentioned what effect my understanding of the joke would have on me was to say that I wasn't looking to know what doctrine to worship, only to understand what he's saying, because of my completely different perspective on the issue.

However, thanks to your help I DO understand better now, thank you. :)

Hmmm....

Good code modified.png


Fixed?

User avatar
syko_lozz
Posts: 53
Joined: Fri Jan 11, 2008 5:30 am UTC
Location: Oz

Re: 0844: "Good Code"

Postby syko_lozz » Sat Jan 08, 2011 11:54 am UTC

I am no programmer. But I have recently started scripting filemaker pro and I would settle for 'fast' OR 'good' but sadly I can achieve neither!!
So hey, if you can even START the loop, you're doing better than me!!
At the moment, my loop goes like this
[think of what actually needs to happen in script]-->[try a billion google searches to see if its been explained before]-->[learn a new but totally unrelated trick and put it to use]----^
Debate politics with a fern. If you lose, refuse to water it.

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 6598
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: 0844: "Good Code"

Postby Thesh » Sat Jan 08, 2011 11:56 am UTC

syko_lozz wrote:I am no programmer. But I have recently started scripting filemaker pro and I would settle for 'fast' OR 'good' but sadly I can achieve neither!!
So hey, if you can even START the loop, you're doing better than me!!
At the moment, my loop goes like this
[think of what actually needs to happen in script]-->[try a billion google searches to see if its been explained before]-->[learn a new but totally unrelated trick and put it to use]----^


Most people haven't even gotten the point of trying to look at code, so I think you are off to a good start.
Summum ius, summa iniuria.

drazen
Posts: 92
Joined: Fri Dec 05, 2008 12:35 pm UTC

Re: 0844: "Good Code"

Postby drazen » Sat Jan 08, 2011 12:56 pm UTC

Isn't this just a reduction of an old joke?

"You can have the project done fast, cheap, or right. Pick any two."

User avatar
creaothceann
Posts: 34
Joined: Fri Jan 26, 2007 9:44 am UTC
Location: Germany

Re: 0844: "Good Code"

Postby creaothceann » Sat Jan 08, 2011 2:55 pm UTC

thelastholdout wrote:Oh, I have no illusions that programming is a complete mystery to me. I don't have the mathematical skills in order to ever completely understand it.

For better or for worse, you don't have to have mathematical skills to program.

Programming is like designing a factory, writing a novel, or writing a cooking recipe (including the kitchen utensils (and even the kitchen) if you want to).

User avatar
cjmcjmcjmcjm
Posts: 1158
Joined: Tue Jan 05, 2010 5:15 am UTC
Location: Anywhere the internet is strong

Re: 0844: "Good Code"

Postby cjmcjmcjmcjm » Sat Jan 08, 2011 3:23 pm UTC

Who knew that the HL2:Ep3 and Duke Nukem Forever teams insisted on using good code?
frezik wrote:Anti-photons move at the speed of dark

DemonDeluxe wrote:Paying to have laws written that allow you to do what you want, is a lot cheaper than paying off the judge every time you want to get away with something shady.

bt0
Posts: 1
Joined: Sat Jan 08, 2011 6:55 pm UTC

Re: 0844: "Good Code"

Postby bt0 » Sat Jan 08, 2011 7:22 pm UTC

creaothceann wrote:you don't have to have mathematical skills to program.

Programming is like designing a factory,writing a novel


you need math for construction. Sure you can build a shack by thumb but you won't build a skyscraper with that approach.
Likewise you can just hack code til its running but it likely wont be perfect and for bigger projects growing organically is a bad idea.
If you look into graphic code or picture analysis its plenty of math

If you want fast code (not fast written but fast in execution) you need math. Its all functions and your job as a coder is to find the best term for calculation. -Same as what you did in math class, just in another language.
Last edited by bt0 on Sat Jan 08, 2011 9:00 pm UTC, edited 1 time in total.

User avatar
BioTube
Posts: 362
Joined: Sat Apr 11, 2009 2:11 am UTC

Re: 0844: "Good Code"

Postby BioTube » Sat Jan 08, 2011 8:27 pm UTC

FoolishOwl wrote:What I got from Torvald's later comments on the Tanenbaum-Torvalds debate was that the point of a microkernel-based system was abstracting the CPU architecture, allowing for easier code porting. But as it's critical to have an efficient kernel, that's a bad place for such abstraction, and as most modern CPUs have similar architecture, abstracting it isn't really necessary -- it's not that hard to port kernel code to different CPUs.
Not necessarily - as mentioned above, security is also another reason for microkernels(it's also likely a better design in terms of fault recovery).
In other words, my impression was that Torvalds's argument prevailed in practice, and that's why interest in the GNU HURD declined.
Well, part of the reason microkernels aren't seen very often is that hardware is more or less designed especially for monolithic kernels; if it supports multiple rings of security(like x86), it's often through a much slower mechanism than a binary paradigm(like x86; OS/2 was the only major OS to use more, making it a royal pain to emulate). As for HURD, a few bad design decisions way back coupled with lack of interest are the reason for its current dismal state(this should be changing, with Debian actually giving it a distribution).
Frédéric Bastiat wrote:Government is the great fiction through which everybody endeavors to live at the expense of everybody else.

user42
Posts: 4
Joined: Sat Jun 14, 2008 9:27 pm UTC

Re: 0844: "Good Code"

Postby user42 » Sat Jan 08, 2011 8:44 pm UTC

creaothceann wrote:
thelastholdout wrote:Oh, I have no illusions that programming is a complete mystery to me. I don't have the mathematical skills in order to ever completely understand it.

For better or for worse, you don't have to have mathematical skills to program.

Programming is like designing a factory, writing a novel, or writing a cooking recipe (including the kitchen utensils (and even the kitchen) if you want to).


I'm not entirely sure what the point of the link to a game is.
I assure you that every program ever written required the programmer to do at least some math. If you think that you have an example to the contrary, it is only because you didn't realize that something that was math, was in fact math. Remember, math is not just arithmetic, algebra and calculus. It includes geometry, trigonometry, probability, and boolean logic. (note: not a complete list, I'm sure.)

Also, recipes need math, and I defy you the design a functional factory without large amounts of math.
I'm not a writer, so I'll take you word on that one.
(edit: fixed a typo)
Last edited by user42 on Sun Jan 09, 2011 6:22 pm UTC, edited 1 time in total.

User avatar
soren121
Posts: 53
Joined: Thu Jun 19, 2008 7:25 pm UTC

Re: 0844: "Good Code"

Postby soren121 » Sat Jan 08, 2011 9:16 pm UTC

correnos wrote:Unfortunately for all of us, clean, beautifully coded vaporware is still vaporware. I agree that we would all be better off now if Linus had decided to go with a microkernel, or if some other project ended up being the impromptu home for GNU. We can all dream.


I disagree. While its choice in binary packages is rather limited, the Arch Hurd project has a good, stable distro put together. It's currently lacking in desktop applications, but the maintainers have ported/compiled/packaged a GHAMP stack (GNU/Hurd, Apache, MySQL, PHP) so that it's usable for a server.

I know Debian also has a Hurd distro in the works, but I tend to stay away from Debian; I find the Debian Project very confusing, personally.
PHP/XHTML/CSS Programmer
http://www.sorenstudios.com/
Fueled by all of this and V8

User avatar
Karilyn
Posts: 282
Joined: Thu Oct 15, 2009 6:09 pm UTC

Re: 0844: "Good Code"

Postby Karilyn » Sun Jan 09, 2011 12:34 am UTC

creaothceann wrote:
thelastholdout wrote:Oh, I have no illusions that programming is a complete mystery to me. I don't have the mathematical skills in order to ever completely understand it.

For better or for worse, you don't have to have mathematical skills to program.

Programming is like designing a factory, writing a novel, or writing a cooking recipe (including the kitchen utensils (and even the kitchen) if you want to).

And if that game kicks your ass?

I am hopeless forever :P

Not a programmer @_@
Gelsamel wrote:If you punch him in the face repeatedly then it's science.

snozbunny
Posts: 2
Joined: Fri Jan 07, 2011 6:19 pm UTC

Re: 0844: "Good Code"

Postby snozbunny » Sun Jan 09, 2011 12:46 am UTC

Twigshusband wrote:10 Print "HELLO"
20 Goto 10


I think you mean 10 Print "HELL"

User avatar
Pfhorrest
Posts: 5474
Joined: Fri Oct 30, 2009 6:11 am UTC
Contact:

Re: 0844: "Good Code"

Postby Pfhorrest » Sun Jan 09, 2011 1:37 am UTC

cjmcjmcjmcjm wrote:Who knew that the HL2:Ep3 and Duke Nukem Forever teams insisted on using good code?

I thought it was fairly well know that the continual hangups in DNF at least were because by the time they'd get something workable done the state of the industry had moved past their design goals and they had to start over again with higher goals in mind, i.e. the "good" loop here.

Of course, I suppose that problem could happen for any non-fast loop; and non-fast doesn't necessarily imply good. In fact I'd wager that the two missing loops in this diagram complete the picture: fast good code is theoretically possible but, hah, yeah right. You can do it fast XOR good and get the two loops here, which most decent projects aim for. But I'll bet the vast majority of shitty programmers out there turn out product which is both too little (not good enough) AND too late (not fast enough).
Forrest Cameranesi, Geek of All Trades
"I am Sam. Sam I am. I do not like trolls, flames, or spam."
The Codex Quaerendae (my philosophy) - The Chronicles of Quelouva (my fiction)

User avatar
BioTube
Posts: 362
Joined: Sat Apr 11, 2009 2:11 am UTC

Re: 0844: "Good Code"

Postby BioTube » Sun Jan 09, 2011 1:38 am UTC

soren121 wrote:I know Debian also has a Hurd distro in the works, but I tend to stay away from Debian; I find the Debian Project very confusing, personally.
How is Debian confusing?
Frédéric Bastiat wrote:Government is the great fiction through which everybody endeavors to live at the expense of everybody else.

Sother
Posts: 1
Joined: Sun Jan 09, 2011 4:39 am UTC

Re: 0844: "Good Code"

Postby Sother » Sun Jan 09, 2011 4:43 am UTC

Good code -- clearly Randall has forgotten about the Ballmer Peak

Meem1029
Posts: 379
Joined: Wed Jul 21, 2010 1:11 am UTC

Re: 0844: "Good Code"

Postby Meem1029 » Sun Jan 09, 2011 6:25 am UTC

I disagree about code being good XOR fast. I think it should be good NAND fast. Anything I've tried to code so far is proof of this.
cjmcjmcjmcjm wrote:If it can't be done in an 80x24 terminal, it's not worth doing

User avatar
coreytabaka
Posts: 2
Joined: Fri Jan 07, 2011 5:21 am UTC
Location: Silicon Valley

Re: 0844: "Good Code"

Postby coreytabaka » Sun Jan 09, 2011 11:49 am UTC

A co-worker of mine made a good observation about what's missing from the diagram:

I think he forgot something. After "...it's become a mass of kludges and spaghetti code" there should be an arrow leading directly to a "ship it" box.


As much as everyone may try to avoid it, it's almost always what happens. Most recent experience: webOS.

User avatar
snowyowl
Posts: 464
Joined: Tue Jun 23, 2009 7:36 pm UTC

Re: 0844: "Good Code"

Postby snowyowl » Sun Jan 09, 2011 1:33 pm UTC

This comic is the flowchart for getting good code. If you want money, there's a different flowchart for that:
1) Make a flowchart
2) ???
3) Profit!
The preceding comment is an automated response.

User avatar
Markavian
Posts: 33
Joined: Sun Dec 30, 2007 1:57 am UTC
Location: Manchester, England
Contact:

Re: 0844: "Good Code"

Postby Markavian » Sun Jan 09, 2011 4:09 pm UTC

Good code is code that performs some useful task.

Bad code is difficult to understand and maintain.

Good code and turn into bad code overnight when the requirements change.

Good and bad make can be very subjective.

Lerkistan
Posts: 50
Joined: Mon Jan 19, 2009 7:25 pm UTC

Re: 0844: "Good Code"

Postby Lerkistan » Sun Jan 09, 2011 11:37 pm UTC

CorruptUser wrote:Good luck with that, what with tax laws changing on a monthly basis.
Accounting makes up a not-insignificant chunk of the programming world, to say nothing of the other parts of the business world.


True. Especially cool are retroactive changes - please book like this, and deliver your balance sheet accordingly at the end of year. Which is still 3 months away. Oh, and of course, you must handle everything this way starting from January, 1.

CorruptUser wrote: For example, in Supreme Commander, you zoomed in on your mouse pointer, rather than the center of the screen. It's a nice addition at first, but after getting used to it, you feel frustrated playing another RTS without it. It's like playing Dune II and finding out you can only select 1 unit at a time.


So true, too... It's just one reason I can't properly play StarCraft 2. Sure, you can zoom in, but what use is that? I don't need a close-up look at my units, I want to actually send them to the right places! (and this "can't use this on the minimap" message thing - not helping!)

thelastholdout wrote:
Fixed?


No, and it's telling that somebody who admits to have no clue about programming claims a specific company has anything to do with "good code". You'd have to look at it and work with it to see if it's good code, and by "work with it" I don't mean use the resulting program.

User avatar
Pfhorrest
Posts: 5474
Joined: Fri Oct 30, 2009 6:11 am UTC
Contact:

Re: 0844: "Good Code"

Postby Pfhorrest » Mon Jan 10, 2011 1:36 am UTC

Meem1029 wrote:I disagree about code being good XOR fast. I think it should be good NAND fast. Anything I've tried to code so far is proof of this.

That was kind of my point.

Theoretically you can code fast OR good (one, the other, both, neither, anything), but in practice you usually get fast NAND good (can't get both but you can get one or the other or neither). Most projects thus aim for fast XOR good (sacrificing one to achieve the other), but plenty still end up with fast NOR good (not both, not even one or the other, but neither).
Forrest Cameranesi, Geek of All Trades
"I am Sam. Sam I am. I do not like trolls, flames, or spam."
The Codex Quaerendae (my philosophy) - The Chronicles of Quelouva (my fiction)

User avatar
Ideas sleep furiously.
Posts: 92
Joined: Mon Nov 08, 2010 10:07 am UTC
Contact:

Re: 0844: "Good Code"

Postby Ideas sleep furiously. » Mon Jan 10, 2011 7:58 am UTC

When coding and following that flow chart, I personally start off at the "?".
The individual has always had to struggle to keep from being overwhelmed by the tribe. If you try it, you will be lonely often, and sometimes frightened. But no price is too high to pay for the privilege of owning yourself. - Friedrich Nietzsche

User avatar
Kelaos
Posts: 5
Joined: Mon Jun 16, 2008 2:45 am UTC
Contact:

Re: 0844: "Good Code"

Postby Kelaos » Mon Jan 10, 2011 3:08 pm UTC

Glad I haven't had to deal with this yet. (keyword: yet) as I'm still a Comp Sci student.

Speaking of which, it was great, I walked into class on Friday and my Comp Sci prof had this up on the projector. I love it when nerds teach nerds.

Qwerty.55
Posts: 6
Joined: Mon Jan 10, 2011 8:18 pm UTC

Re: 0844: "Good Code"

Postby Qwerty.55 » Mon Jan 10, 2011 8:44 pm UTC

jc wrote:
Negated wrote:You need goto to get to good code.

Heh. I've seen a couple of cases where I could make a chunk of code smaller, faster and much more readable by the introduction of one or two judicious goto statements. It was fun watching how flustered the more doctrinaire programmers got trying to argue that it was "bad code".


Like you said, Assembly uses jump/branch commands similar to Goto quite frequently. Good luck getting that OS you're working in to run without them. Most Assembly programs wouldn't run for more than a millisecond or so if jumping/branching wasn't allowed. But even in higher level languages, I've found that sometimes you'll end up with a situation where you can use either a couple of Goto statements or re-write the entire program (very difficult if you're doing SMC) and use up even more to accommodate "good code."

Speaking of which, I wrote good code once. The hardware couldn't handle it.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: No registered users and 97 guests