Live data from Hacker News

Your code may be elegant, but mine works

omniti.com

121–130 of 174 posts

Re: Your code may be elegant, but mine works

#121
post #8

Reducing software development practices down to these cute catchphrases is a bit disingenuous. If you're writing throwaway code for a client with loose constraints and a tight deadline you'll write code differently then you would when you expect to maintain a long term relationship with a client who expects a high degree of correctness. I'm tired of these trite articles espousing some cute mantra holds as if it's som…

>Reducing software development practices down to these cute catchphrases is a bit disingenuous. Its a bit like Scientology, but without the crazy. Oh no, wait .. there's plenty of crazy.

Same idea, you reduce arguments down to these repeated definitive-sounding cliches that are held sacrosanct and impenetrable to dissent.

Re: Your code may be elegant, but mine works

#122
post #82

If the project is late, it's not done. Period. Bullshit. Most deadlines in software engineering are fake. There are some that aren't, but they are exceptions, not a rule. If you're writing all your code as if every deadline is the Judgment Day, you're doing software engineering wrong and not making the right trade-offs. The unfortunate reality is that there are some engineers who will gladly deliver software 5% faste…

Exactly. The author cites a Christmas promotion as an example. Yes, those types of projects exist, but in my experience, they're a tiny minority. Almost every deadline I've ever faced was set artificially. The developers estimate how long the project will take, they negotiate with management, and one or more deadlines are established. Often these deadlines are missed (not due to the programmers, BTW), and there's no…

You are lucky if deadlines with actual penalties have been a "tiny minority" of your experiences. The problem I experienced too much at some companies is "management" making artificial deadlines become real deadlines. VP of X sees feature set for delivery on Friday, sets up demo for potential client on Friday. Now everyone is in crunch mode or the company suffers when client can't see the feature. Or CxO drops in and says "I got invited to Conf Z in two weeks, I told them I'm going to demo Feature C and they just tweeted it, that's still on track, right?" Now, those were not the best managed companies, but I'd imagine there's a lot of people who end up in similar situations. As well, the author works at a consulting company, where I imagine many of the deadlines are baked into the contracts as deliverables with financial penalties for not meeting them. Consulting is a different world than a startup where you get to build something you hope to personally use for years.

Re: Your code may be elegant, but mine works

#124
post #97

Earlier quoted context omitted.

> I think that's about all that needs to be said. Yeah, and that's like a perfect definition for "ad hominem" argument.

No it's not. If the author's methodologies result in undecipherable code, that's quite relevant to the discussion.

The author has presented an argument. Whether the author himself generates any code at all has absolutely no effect on the validity of his arguments.

Re: Your code may be elegant, but mine works

#125

Earlier quoted context omitted.

The worse thing is that he's saying "you shouldn't spend extra time to do the right thing", and then tries to justify that by giving examples of people doing the wrong thing. Nobody is calling spending weeks writing a caching layer for a 20-row database "elegant" or "best practice". That's a complete straw man.

I don't know. The whole ecosystem we live in (YC) seems to be about, "Your idea may be good, but mine exists." Basically, the same thing as he's saying.

Sort of. That just means they endorse an Agile approach - ship bare minimum features early, and continuously improve. Not ship bare minimum features early, and who cares about how its designed. The whole over-engineering argument is a straw man, because over-engineering is just as bad as under-engineering. Neither one is desirable in professionally written software.

Re: Your code may be elegant, but mine works

#126

Earlier quoted context omitted.

> I think that's about all that needs to be said. Yeah, and that's like a perfect definition for "ad hominem" argument.

No, actually it's not. This isn't ignoring the issue at hand and just attacking the author's character, it's attacking the authors authority on a subject matter.

If one focuses on personal characteristics (here skills) of the author rather than the logical construction of his argument, it is in fact ad hominem.

Re: Your code may be elegant, but mine works

#127
post #117

Earlier quoted context omitted.

The worse thing is that he's saying "you shouldn't spend extra time to do the right thing", and then tries to justify that by giving examples of people doing the wrong thing. Nobody is calling spending weeks writing a caching layer for a 20-row database "elegant" or "best practice". That's a complete straw man.

> Nobody is calling spending weeks writing a caching layer for a 20-row database "elegant" or "best practice". That's a complete straw man. Have you used any Java API? That's exactly the feeling I get from using them.

The people who make the most noise about elegance and best practices generally dislike Java for precisely that reason.

Re: Your code may be elegant, but mine works

#128
Elegance is so subjective. Many developers seem to define it as making design decisions their way. Working is much less subjective.

In my opinion, it's better to focus on improving what is measurable. That means focusing on making more things work than making things more elegant.

Of course, this whole debate is a broad generalization and the devil is in the details.

Re: Your code may be elegant, but mine works

#129
Something important is almost never mentioned in all the literature about programming and software development, and as a result we sometimes misunderstand each other.

You're a software developer. Me too. But we may not have the same goals and requirements. In fact there are several different worlds of software development, and different rules apply to different worlds.

http://www.joelonsoftware.com/articles/FiveWorlds.html

Re: Your code may be elegant, but mine works

#130

Elegance is so subjective. Many developers seem to define it as making design decisions their way. Working is much less subjective. In my opinion, it's better to focus on improving what is measurable. That means focusing on making more things work than making things more elegant. Of course, this whole debate is a broad generalization and the devil is in the details.

I agree, but there are probably some basics that we can all agree on that makes code inelegant.

I have been rewiting some of my own code recently.It was a quick temporary solution that grew and grew. I used OOP to avoid cutting and pasting, but I realise that one central method didn't have any concrete set of input or output paramaters, it changed depending on what was calling it - very nasty. It was essentially doing three things, rather than one. (It worked, as the guy in the article descrbes)

I think seperation of concerns, making one function do one thing etc, is a start in making elegant code. Or at least not fugly like it was before.

Post reply on HN