TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hopefully more controversial programming opinions

103 pointsby elssarover 12 years ago

13 comments

cubicle67over 12 years ago
[update: I've got hold of some of the code. Here's a copy of one of the programmes <a href="http://pastie.org/4615158" rel="nofollow">http://pastie.org/4615158</a>]<p>I have an awesome story that i think I've told before, but I'll tell it again anyway :)<p>My father-in-law is a pharmasist. back in the early 90s computers were starting to make their way into Pharmacy and the first few pharmacy sortware packages appeared. this increased with time, as you'd expect. At some point he decided it was inevitible but he decided (I have no idea why, except that he's always been quite independent) he'd write his own software. Took himself off to nightschool and learned dBase III. He'd never written a line of code prior to this.<p>He then proceeded to write an entire pharmacy suite of software tools that are <i>still</i> in use. They've been heavily updated and added to over the last 20 years but it's still all DBase III running on DOS. It's a saggering amount of code over hundreds of files but it all works. I've seen the code and it wouldn't pass a first semester coding course. each programme is a single 10,000 line spaghetti-fest. I've tried to explain functions/methods to him but he didn't understand and in the end I gave up. apparently he doesn't need them!<p>I can't understate how complex this software is - it's stock control, point of sale (including the usual things like birthday vouchers, discounts accounts etc etv), prescription dispensing, patient records etc. everything for a modern pharmacy. The australian health dept know about it and it's met all their criteria. it does everything.<p>It's mindbogglingly awfull bad code by any metric imaginable but yet it's robust, appears to be as-good-as bug free and has been able to be maintained (gov regulations for pharmacy change constantly so it's required major changes each year to keep up to date) and in production use for almost 20 years. oh, and it's fast :)<p>[Edit: looking at the other comments it seems I've replied to the wrong thing. I was actually writing a comment in response to this <a href="http://prog21.dadgum.com/87.html" rel="nofollow">http://prog21.dadgum.com/87.html</a> (Write Code Like You Just Learned How to Program) which was linked to from the main article]
评论 #4453636 未加载
评论 #4453724 未加载
评论 #4453498 未加载
评论 #4457446 未加载
评论 #4453676 未加载
InclinedPlaneover 12 years ago
I would go farther in regard to the Computer Science point.<p>CS programs should be burnt to the ground. And in their place we should build up three separate things. First, software trade schools that are actually good (e.g. not ITT). Second, for reals software engineering majors at colleges, that are heavy on things like practical programming, tools (version control, issue tracking, automated build systems), refactoring, teach multiple languages (javascript, python, ruby, SQL, etc.), and only delve into theoretical underpinnings as warranted (compare electrical engineering vs. physics programs). Third, legitimate Computer Science programs that are contractually limited to about 5% of the current CS student capacity for at least the next two decades and which teach a very mathematics heavy and science focused CS program and have zero expectation that the graduates of the program will go on to write software in industry after graduation.
评论 #4453597 未加载
评论 #4453565 未加载
polemicover 12 years ago
&#62; <i>Computer science should only be offered as a minor. You can major in biology, minor in computer science. Major in art, minor in computer science. But you can't get a degree in CS.</i><p>The problem is not that Universities produce poor CS majors. They don't. The problem is that everyone else expects that a CS major is going to be a good commercial developer. Some are, but that's just the odds.<p>If you want to be a programmer, do an software ENGINEERING degree. It deals with the practical issues and you actually do lots of real, actual, programming. Or go to a media design school, where you do lots of actual web programming.<p>Expecting every CS major to be a great programmer, is like expecting every Physics major to be a good baseball player. Sure, (s)he knows the optimal angle to strike ball to achieve a home run, but actually doing so requires a whole of experience and real world context.<p>(PS. I have a physics degree, and I'm a software developer, not a baseball player. But that's because I programmed a lot for fun and profit before going to university, and CS seemed like a big backwards step. And physics is more fun.)
评论 #4453677 未加载
AngryParsleyover 12 years ago
I just read the post that inspired this post: <a href="http://programmers.blogoverflow.com/2012/08/20-controversial-programming-opinions/" rel="nofollow">http://programmers.blogoverflow.com/2012/08/20-controversial...</a>. While a lot of these opinions sound reasonable, I want to know if they're actually true. All of these statements are expert opinions, but it's unclear how many of them are backed by research. Without controlled studies, experts can easily believe incorrect things.<p>If you hold an opinion, look at the evidence backing it up. If it's not strong, reduce your confidence. Or even better: Gather evidence, <i>then</i> form your opinion. And remember: Anecdotes don't count. I wish more of my colleagues would do this, but it seems most of them haven't heard of very many software-related studies.<p>If you want to learn more, I recommend <a href="http://www.neverworkintheory.org/" rel="nofollow">http://www.neverworkintheory.org/</a> as a starting point. After reading some papers, you'll be surprised how limited our evidence-based knowledge is. Looking at software engineering studies made me realize that I'm not allowed to poke fun at psychology anymore. Even that field is more evidence-based than ours.
hansboover 12 years ago
<p><pre><code> It's a mistake to introduce new programmers to OOP before they understand the basics of breaking down problems and turning the solutions into code. </code></pre> Given how well I remember my classmates with little-to-none programming experience struggled with understanding pointers while not being able to write the simplest algorithms, I thought this was a no-brainer. Is it really a controversial opinion?
评论 #4453543 未加载
评论 #4453537 未加载
tikhonjover 12 years ago
Here's my version of his opinions, probably even more controversial :P.<p>CS should be offered as a major by itself. All the most interesting stuff is CS-specific with indirect applications. Working on something like automatic programming is far more exciting than working on biology or art or what have you. (I can't think of anything more awesome or more CS-only than automatic programming.)<p>It is a mistake to introduce programmers to OOP.<p>A complex compiler is awesome. A sufficiently smart compiler may be a myth, but it is a <i>utopian</i> myth; we should strive for it. However, I would take it even further: program synthesis is better still. I'm in the business of telling the computer <i>what</i> to do, not how to do it, so there should be no obvious but unnecessary correspondence between what I write and what the computer executes--they just have to have the same semantics.<p>You shouldn't be allowed to write a library unless you have a thorough understanding of programming languages and some relevant math. There is always relevant math. Your functions should be accompanied by useful and verifiable laws others can depend on. Or maybe everyone should be encouraged to write libraries regardless of skill level and then the libraries could be ranked a posteriori. Any other guidelines make less sense.<p>Pretty code is readable and readable code is pretty. If you can render your code as a nice pdf and distribute it as a paper, it's about as readable as it will ever be. Even if you can't, remember that aesthetics aren't random--there is a reason why pretty code is pretty.<p>Purely functional programming is a straw man. Even Haskell lets you write code that at least acts impure. Haskell is a local maximum. On the other hand: a purely functional spec that the computer uses to generate a potentially impure program <i>should</i> work. But I've already talked about that :P.<p>I don't know what a "software engineering mindeset" is. It sounds like something a manager would say. Don't do stuff a manager would say. This is unfair to good managers but still a useful guideline. Have as much fun as you can unless people's lives are on the line.<p>I should note that I don't even think all these opinions are true. But a belief does not have to be true to be <i>useful</i>. If I could boil it down to a single sentence, it would probably be: math and CS theory aren't scary and you should reject conventional "wisdom". But that would be somewhat cheap--two independent and rather unrelated clauses joined with "and" may as well be two sentences :P.<p>Also, there's something very appealing about throwing out intentionally extreme opinions. I can certainly see why this guy keeps on writing his blog.
评论 #4453947 未加载
评论 #4453741 未加载
评论 #4455044 未加载
sbtover 12 years ago
Great stuff. Since these are controversial opinions, I somewhat agree/disagree.<p>- Computer science should only be offered as a minor. Good point, assuming that you don't consider theory an end in it self. I consider theory mind opening, even if it doesn't make money per se.<p>- It's a mistake to introduce new programmers to OOP before they understand the basics.. Fully agree.<p>- You shouldn't be allowed to write a library for use by other people until you have ten years of programming under your belt. Another good point. Writing a good library (or designing an API) is one of the more challenging things you can do, because it requires a good understanding of the problem, simple design, and sensitivity to conventions (which only come from long experience).<p>- Superficially ugly code is irrelevant. Somewhat true, but the main problem with ugly code is that nobody wants to touch it. So if its functionally correct, readability remains irrelevant until you need to make a change.<p>- Purely functional programming doesn't work Agree, in the sense that there exists problems where a purely functional approach is not the best. I think you can run pretty far with purely functional though.<p>- A software engineering mindset can prevent you from making great things. Strictly true, but it should be said that the opposite mindset will eventually destroy the things you made.
davedxover 12 years ago
"Superficially ugly code is irrelevant. Pretty formatting--or lack thereof--has no bearing on whether the code works and is reliable, and that kind of mechanical fiddling is better left to an automated tool."<p>I disagree with this one. Clear, readable code is... clear and readable. It's like not bothering to format text in a textbook because "the meat of the matter is in there, so who cares?"<p>Of course substance is more important than style in programming, but style also helps and is it really that much effort to make sure your code is readable for the next guy who comes along?
评论 #4453738 未加载
primiturover 12 years ago
I agree with the first 10 controversial opinions, and I agree with this followup, to boot. All good points, all worthy of discussion.<p>As an autocrat, I'd also add another few, what I conceive to be contemporaneously controversial point of view, to the discussion:<p>* Code Coverage matters. Dead code is broken code. Always.<p>* Programming is Always in Service To The User. The User is the only way your creative, artistic, amazing, junk of spaghetti-code crud, is going to ever get Used. Use is where your software is alive. Non-use = Dead. Thus, the USER is YOUR MASTER. Serve them.<p>* Pretty tools are one thing, ugly tools another thing entirely. NO! WRONG! ALL TOOLS ARE TOOLS. Use what works. If you're using something because you want to, even though it sort of doesn't work, its no longer a tool, but instead an .. ingredient .. of something. Something else, perhaps something creative. Do that shit on your own time: use the tools which work, <i>at</i> work.<p>* Discussion is the only way things ever get resolved. If you hate on something about someone, discussion is the only way the problem will ever get solved, ever. Ignoring something and being afraid to discuss really secretly means 'do not want' to solve the problem. Even vile words are still yet but words, words eventually work it out. Developers who do not use words are not the scribes they're meant to be ..
capkutayover 12 years ago
Computer science should only be offered as a minor. You can major in biology, minor in computer science. Major in art, minor in computer science. But you can't get a degree in CS.<p>The way university is structured, it would be nearly impossible to minor in CS and learn anything low-level or advanced like computer architecture or operating systems. Perhaps you can push out a desirable employee with a practical knowledge of programming, but could you really educate true "software engineers" via a minor?
评论 #4453632 未加载
评论 #4453399 未加载
评论 #4453438 未加载
评论 #4453385 未加载
npguyover 12 years ago
"You shouldn't be allowed to write a library for use by other people until you have ten years of programming under your belt. If you think you know better and ignore this rule, then one day you will come to realize the mental suffering that you have inflicted upon others, and you will have to live with that knowledge for the rest of your life."<p>stunning.
评论 #4453503 未加载
walrusover 12 years ago
<i>&#62; Purely functional programming doesn't work, but if you mix in a small amount of imperative code then it does.</i><p>That isn't controversial nor is it an opinion. It's just the truth. Purely functional code has no side effects. The entire point of a program is to have side effects.
评论 #4453869 未加载
评论 #4453880 未加载
qzncover 12 years ago
The difference between a compiler not optimizing (gcc -O0) and optimizing as good as possible (gcc -O3) can be an order of magnitude of performance. That does matter in many cases.<p>Of course, various programs (web apps) are IO-bound. And gcc -O0 should still outperform Python/Ruby/etc.