News for hackers. Stuff that matters.
Re:Why Isn't Debugging Treated as a First-Class Activity? by josephv on Wednesday July 11, 2018 @08:40AM (#17506374)
The omission is interesting only in that it highlights that programming and debugging are one in the same.

Us old folks that have been programming for 20 years don't even separate the two, there is no meaningful distinction. Programming is not a write-only operation (Perl excepted).

If it's an existing project/product, I get it running and find the entry point. If it's new, I write and entry point and get it running. Then I change something, or write something, and debug it. Is it working as expected? Maybe the execution flow isn't what I expected. Why do I always forget to initialize things right. Probably because every language thinks their version of native v. abstract references are fancier.

Blah, I need to get to work cod... debug.... what am I doing today? Ah yea, writing documentation. Fack

Re:Why Isn't Debugging Treated as a First-Class Activity? by kps on Wednesday July 11, 2018 @11:08AM (#17507502)
“By June 1949 people had begun to realize that it was not so easy to get programs right as at one time appeared. I well remember when this realization first came on me with full force.

The EDSAC was on the top floor of the building and the tape-punching and editing equipment one floor below. […] It was on one of my journeys between the EDSAC room and the punching equipment that ‘hesitating at the angles of stairs’ the realization came over me with full force that a good part of the remainder of my life was going to be spent in finding errors in my own programs.”

— Sir Maurice Wilkes

Re:Why Isn't Debugging Treated as a First-Class Activity? by corey_moncure on Wednesday July 11, 2018 @09:04AM (#17506512)
Right. Reading through code is just executing it on a high level, and very fuzzy and forgetful, virtual machine in your own brain.
Re:Why Isn't Debugging Treated as a First-Class Activity? by jonbarker on Wednesday July 11, 2018 @09:21AM (#17506604)
My only complaint about my meatware computer is that it has a really bad ability to handle space complexity. With paper I can do OK with time complexity (although clockspeed is also an issue).
Re:Why Isn't Debugging Treated as a First-Class Activity? by mikec3010 on Wednesday July 11, 2018 @12:10PM (#17508002)
Mine is like a quantum computer. Not in performance, but that the register values decay within seconds to minutes.
Re:Why Isn't Debugging Treated as a First-Class Activity? by montenegrohugo on Wednesday July 11, 2018 @10:16AM (#17507081)
I loved this comment. Great visualization!
Re:Why Isn't Debugging Treated as a First-Class Activity? by jsymolon on Wednesday July 11, 2018 @10:31AM (#17507218)
> ... not a write-only operation (Perl excepted).

Really need to squash the Perl is write-only. Modern Perl is quite readable, supported by tests and linters.

http://modernperlbooks.com/

Re:Why Isn't Debugging Treated as a First-Class Activity? by pjc50 on Wednesday July 11, 2018 @11:48AM (#17507824)
The problem with Perl is too many snowflakes.

https://flatline.org.uk/snowflake.pl.txt

Re:Why Isn't Debugging Treated as a First-Class Activity? by olavk on Wednesday July 11, 2018 @10:41AM (#17507305)
Unfair! Perl can be perfectly readable and maintainable by the person who wrote the code. It is just that the language has been deliberately designed [1] to make it maintainable only by the same person who wrote the code.

[1] http://modernperlbooks.com/books/modern_perl_2016/01-perl-ph...

Re:Why Isn't Debugging Treated as a First-Class Activity? by hinkley on Wednesday July 11, 2018 @10:58PM (#17511853)
I really doubt that. I’ve read too much code written by some asshole with the same username as me. I spend too much time trying to keep that from happening and it still does.

> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

The loophole is be as clever as you can at making the code as clear as you can. And even then you aren’t always clever enough.

Re:Why Isn't Debugging Treated as a First-Class Activity? by chromatic on Wednesday July 11, 2018 @11:55AM (#17507886)
That's an interesting reading of that chapter.
Re:Why Isn't Debugging Treated as a First-Class Activity? by lizmat on Wednesday July 11, 2018 @09:13AM (#17506560)
Possibly with the exception of COBOL, I think you can write write-only code in any programming language.
Re:Why Isn't Debugging Treated as a First-Class Activity? by kps on Wednesday July 11, 2018 @11:04AM (#17507467)
You can most definitely write write-only code in COBOL. Reading the words does not imply understanding the meaning. Prolixity leads to clarity in code just about much as it does in prose. (It's unfortunate COBOL style has taken over almost completely.)
Re:Why Isn't Debugging Treated as a First-Class Activity? by lenocinor on Wednesday July 11, 2018 @03:45PM (#17509751)
Going to second the write-only COBOL thing. I've read real-world COBOL code that generated reports with legions of impenetrable variable names. Without the context of the business logic it was nearly impossible to understand at times.
Re:Why Isn't Debugging Treated as a First-Class Activity? by dsfyu404ed on Wednesday July 11, 2018 @09:26AM (#17506645)
I'd take C code sprinkled with assembly or bash one-liners optimized for fewest number of characters over Python, JS or PHP spaghetti that's partially documented by someone who can not write proper sentences in the whatever language they're writing documentation in. If you can't be sure your documentation actually reflects what the code does and how it does it then just don't document it or at least throw a disclaimer in the docs. This is even more important is "the docs" are your comments in the source and/or commit messages.

Edit: And why exactly is this opinion unacceptable? Being able to communicate what you're done (and hopefully why you did it) is an essential part of writing software that will be worked on and/or used by other people. Code that takes just as long to figure out how to use as it does to create from scratch is as good as no code.

Re:Why Isn't Debugging Treated as a First-Class Activity? by jt2190 on Wednesday July 11, 2018 @10:29AM (#17507188)
Yes! Writing code that documents itself is the recommended practice when practical. It’s inexpensive relative to other forms of documentation, and it documents precisely what the code does, since it is the code. (And please don’t read this as “never write any other documentation”. This is just the easiest way to get some documentation.)
Re:Why Isn't Debugging Treated as a First-Class Activity? by dsfyu404ed on Wednesday July 11, 2018 @09:21AM (#17506610)
>Programming is not a write-only operation

A lot of people would take issue with that statement.

Most devs probably wouldn't notice that their backspace key went missing until they were fine tuning the phrasing of an email about why the best way to solve their spaghetti is to make the same spaghetti slingers port the codebase to $FAD_OF_THE_WEEK.

Edit: It should be obvious that this is a joke but if it's not you should probably check if your backspace key still works.

Re:Why Isn't Debugging Treated as a First-Class Activity? by commandlinefan on Wednesday July 11, 2018 @11:18AM (#17507575)
> check if your backspace key still works.

Back in the late 90's, when Java was still sort of new, my employer insisted that I install an IDE to do my Java development that I had been doing mostly in vi. The one they picked (for some reason) was Symantec's Visual Cafe. I found that I could reliably, reproducibly, crash the IDE by pressing the backspace key. Maybe that was their way of pushing a "no mistakes" philosophy?

Re:Why Isn't Debugging Treated as a First-Class Activity? by hinkley on Wednesday July 11, 2018 @11:10PM (#17511909)
In that era no IDE ran stable across its whole feature set. Crashing debuggers were very common. VisualAge had the most stable debugger but would crash just typing in code.

Jetbrains was the first one that was reliable. Slow, but not as slow as VA.

Re:Why Isn't Debugging Treated as a First-Class Activity? by aplummer on Wednesday July 11, 2018 @09:39AM (#17506724)
I think you’re wrong about most (seniorish) developers but I loved the way you said it haha.
Re:Why Isn't Debugging Treated as a First-Class Activity? by bennylope on Wednesday July 11, 2018 @10:21AM (#17507123)
Maybe they're just deleting code in command mode...