Live data from Hacker News

12 (Really) Controversial Programming Opinions

billthelizard.com

41–50 of 61 posts

Re: 12 (Really) Controversial Programming Opinions

#41

Earlier quoted context omitted.

I don't. Exceptions in general FORCE a developer to deal with the problem. They can slap a developer in the face if they're abusing the API. Error codes on the other hand can be ignored. PutLionInCage(); PokeLionWithStick(); I'd rather PutLionInCage() throws if there is a problem.

Exceptions in general FORCE a developer to deal with the problem. There are good arguments in favour of exceptions, but I don't think this is one of them. If Java has taught us anything, it is that trying to force someone to handle exceptions just causes a lot of code that says: catch (Exception e) { // silently ignore e }

Actually, the correct comment for an empty catch block is:

// This should never happen.

(Until it does)

I have mixed feelings about checked exceptions. They seem like a great idea in theory - if there are known error states, then making them explicitly known and forcing the consumer to acknowledge them in some way seems reasonable. In practice, a lot of the time the only response to a checked exception is "let it propagate up - there isn't anything useful I can do", which leads to extra code and can be annoying.

Even though I don't have quite the negative feelings toward them others do, if I were involved in designing a new language today, I'd probably vote against including them. It would possibly be nice if a method could explicitly declare which exceptions it was likely to throw, and then an IDE or static analysis tool could use those to aid consumers of the API, without forcing them to deal with every single one.

Interestingly enough, I view Scala's Option construct as being somewhat similar - forcing the consumer to acknowledge that a particular call could return a null value - but it doesn't seem to provoke the same negative visceral reactions that checked exceptions do.

Re: 12 (Really) Controversial Programming Opinions

#42

Earlier quoted context omitted.

Ironically C is technically a high level language anyways.

Not if you live in the 2012

Originally, the term "high-level" meant that programs were portable between machine architectures. You can do this in C, but in assembly. This is a precise definition.

I cannot find a precise definition, which puts C and Javascript on different levels. Has garbage collection? A big standard library?

Re: 12 (Really) Controversial Programming Opinions

#43

Really surprised at the amount of hate for Python significant indentation. I've only used Python a little, and I expected to hate that too, but found it wasn't really so bad. I thought my experience was pretty common, and that by now most people either thought it was a great idea or at least found it tolerable. But "it was a bad idea" is currently favored 43 to 5. Maybe not many Pythonistas have seen this page yet.

In my opinion not many Python programmers care for places like stackoverflow, as the language itself has excelent infrastructure to deal with problems and to get ones questions answered quickly without bothering other people. Maybe that's why the vote is so high there.

Everyone working with Python a little while won't even think about indentation anymore, it just comes natural. It's not a big deal.

Python is often made out in discussions like that to be for begginners only and only amateurs would use it because its slow, not concurrent etc... The truth though is that YouTube, Reddit, Dropbox, Spotify, Discuss, Google, Nasa and many other "real" professionals use Python in a big way.

I tend to ignore such trolls.

Re: 12 (Really) Controversial Programming Opinions

#44
One opinion of mine is "code is also configuration". If you structure the code right, I see nothing wrong with putting stuff that many people see as configuration in the code. I do Java programming, and I think that frameworks like Spring are overrated. There is nothing very different from stitching together dependency injection with XML than with Java code. It is a pattern, not a framework. But the Spring trend is hard to walk against, it is so strong. I am getting tired of this occupation.

Re: 12 (Really) Controversial Programming Opinions

#45
post #3

Wow, mostly terrible advice.

Can you elaborate?

Well, some of the suggestions have been fairly thoroughly examined by now, and often with quite clear results.

For example, anyone who advocates writing only extremely short functions because they leave less room for bugs appears to be wrong in about the same way that someone who thinks that 2+2=5 or that a chainsaw is a good implement for brain surgery is wrong.

Re: 12 (Really) Controversial Programming Opinions

#46
post #33
post #16

guys, >The first language should NOT be the easy one, it should be >one that sets up the student's mind and prepare it for >serious computer science. >C is perfect for that, it forces students to think about >memory and all the low level stuff, as one low-level programmer to another, I hate to break it to you, but "low level programming" is not "serious computer science". the two have very little to do with each othe…

That's pretty true. However, in C, you can actually write interesting data structures and algorithms that come up in computer science. I think that makes for good "theory meets practice"-based learning. I'm not saying all algorithms classes should incorporate writing C code all the time. But probably every budding computer scientist or software engineer should take at least one such class. I'm also not saying C is th…

absolutely! C is so widespread that you should be conversant in it as a software practitioner, whether as a programmer shipping code or a scientist making tools and working with others tools.

however you can explore what computer science has to offer without subjecting yourself to C. I think that "computer science" has more to do with "optimizing algorithms for efficiency" and less to do with "staring at stack traces and wondering why gdb is so bad"

Re: 12 (Really) Controversial Programming Opinions

#47
post #35

13. Most programmers think they know what they're doing but actually are "incompetent". (There are Usenet posts going back to 80's documenting this fact.) How am I defining "incompetent"? In my definition it means writing software that any reasonably skilled hacker can cause to "malfunction", i.e. not perform as expected by the programmer, which depending on the program may or may not present a security risk. The num…

This is a narrow view of what software is supposed to do. Are styrofoam cups inferior or are their designers "incompetent" because they break easily? No! That's the whole point--they are cheap and disposable. The same is true about most software people write--it is also cheap and disposable. Often, having something that works well enough now is better than having something that works well tomorrow. I'm not even talki…

Toughbook is hardware not software. Get an old Thinkpad. It's durable.

I take the opposite view. I like durable software. And that's how I build my systems. If they get trashed, they can be restored in minutes. I'd rather spend my effort preparing simple durable systems that can be restored easily than building complex, fragile systems that would be difficult to reconstruct if something goes wrong. I've heard that sometimes things can go wrong.

Re: 12 (Really) Controversial Programming Opinions

#49

Earlier quoted context omitted.

"You don't, though" Interesting, though I'm not sure how my knowledge of C is relevant to the conversation.

You made a false assertion about C. o o o Connect the dots.

"C is not high level because you don't know C" is not exactly the most cogent of arguments. The rest of it I pretty much agree with, nonetheless the actual definition of "high level" language doesn't change just because you (or I) feel it should, which is why I said it was "technically" high level.

Re: 12 (Really) Controversial Programming Opinions

#50
post #33

Earlier quoted context omitted.

That's pretty true. However, in C, you can actually write interesting data structures and algorithms that come up in computer science. I think that makes for good "theory meets practice"-based learning. I'm not saying all algorithms classes should incorporate writing C code all the time. But probably every budding computer scientist or software engineer should take at least one such class. I'm also not saying C is th…

Hmm, can you give an example of a typical "learning CS" level algorithm that you can't implement in, say, JavaScript?

You could probably implement any of them in JavaScript, but it would be sort of silly, because the actual runtime complexity and memory usage aren't really going to be close to what they "should be" due to the interpreter.

I haven't given it a lot of thought, but I doubt it makes sense to implement "textbook" algorithms and data structures without pointers.

Post reply on HN