Live data from Hacker News

Why Programming is Difficult (2014)

joearms.github.io

31–40 of 117 posts

Re: Why Programming is Difficult (2014)

#31
post #17
post #2

In my experience, the overwhelmingly most difficult thing about programming is writing code that makes sense, even after it has gone through a couple rounds of requirements changes and bug fixes. Any concrete coding task can be dealt with straightforwardly enough, but projects as a whole tend to deteriorate by arbitrary fixes, maintenance patches, and failure to uphold a conceptual schema. The idea of composability i…

Do you think that sort of a problem (incremental changes eroding an initially sound structure) could be fixed with better refactoring tools? It seems like the issue you're describing is that logic is leaking from some parts of the codebase to others, which might be fixable with sufficiently powerful refactorings.

Yeah, I think the sheer manual friction of moving things around is a big impediment to change.

But also, I think there has to be some conceptual basis for us to be able to think about factoring in a clear way, and that kind of intellectual labor is hard on another level.

Eric Evans' book on domain-driven design has some examples of programming tasks that generate confusing and unclear code, until the coder together with the "domain expert" reaches some kind of epiphany—like "ohh, if we think of these three things as being parts of the same kind of thing, then this part of the program makes more sense."

A program is a kind of philosophical theory about a certain topic, and if the theory isn't very clear, then you'll end up with a lot of special cases and obscureness even if you have unit tests and refactoring tools. They say naming is the hardest thing in programming and that becomes more true when you start to introduce any level of abstraction.

"Design patterns" were an attempt to create more general small theoretical pieces, above the syntactic level. In the FP world, a similar vision is that algebraic and categorical abstractions can provide some of those pieces. We still haven't seen much of what algebraic abstractions can do for ordinary programming...

But these abstract pieces, I think, are pretty crucial if we want programs to be understandable as anything but arbitrary collections of procedures and types. So yes to refactoring tools, and yes to more discussion about design patterns—it didn't end with the Gang of Four! read Christopher Alexander and Richard P. Gabriel!—and yes to more inspiration from mathematics and engineering and philosophy and all kinds of stuff, to provide inspiration for factoring—yes to study of logic and language and ... I'm getting carried away.

Re: Why Programming is Difficult (2014)

#32
It is much easier to prove a particular program function correct when complexity is properly handled, this is the true art of programming, handling complexity in a way that makes sense.

Many complex phenomena in nature is explained by very simple mathematical equations, likewise great engineering design is achieved when there is nothing else to remove, and in order to achieve those results, a great deal of effort and thinking has to happen first.

The thing is, as the author put out, the environment is just too hostile in order to design beautiful programs, from the insane expectations of what can be done, to incompetent peers, politics, distractions and what not.

If you are skilled, you can define a problem in a precise way, be able to dissect it in smaller problems, solve them and prove the solution correct.

What is ultimately hard is how to handle the hostile environment you're usually stuck with.

Re: Why Programming is Difficult (2014)

#33
post #4

It is not difficult, trust me. I know C, C++ , Java and Phyton. It is all about logics and the only thing that differs is the syntax. Get in touch I might help you

Too many guys like this are what makes software dev hard. Too many yahoos who think its just about code. Code is only an implementation detail of how most dev is done today. Even today, code isn't about the code. It's about explaining your program, your process, wtf you where thing when designed this thing to the next guy/gal. Sadly, what too much code tells us is "Design? That's what gui people do, right? I just kep…

Too many sentences like, "you where thing when designed this thing to the next guy/gal" make reading hard. Slow down dude, wtf?

Re: Why Programming is Difficult (2014)

#34
post #19

I don't think programming - in the sense of what 99% of programmers do - is as difficult as programmers love to blog about. Most professional programmers write stuff that is not all that hard, and most of it has been done by others countless number of times. All the "hard" cutting edge stuff is done by a tiny tiny fraction of programmers. Heck even the things people think are cutting edge now, just taking a random ex…

Sure. We can get 80% of the effect with 20% of the effort. Then the last 20% of the program takes the other 80% of the time :-)

As an example, I started doing Angular development about a year ago. At first, it's really easy - little more than templating output expressions in double curly braces; binding input fields with ng-model attributes; and adding ng-click callbacks to a few buttons.

Then you start making tag libraries, er, excuse me, "directives". Now you start to find out where the monster lives. The complexity of the definition object you make for a directive mushrooms out from the other work you have been doing. Is the directive just an attribute (for existing HTML tags), or does it need to be a custom element with multiple attributes? Is the template part just a string literal, or a function? Do I need to make a "link" function (what does that name even mean, anyway?), and how did all these magic parameters get passed to it? Does this directive get its own controller function? (why do we need "link" and a controller?) Do I give the directive its own "scope" (data model and event-handler/callback function object) instance, or just reuse the scope from the app? How do I pass data between 2 directives?

I'm not faulting Angular (other than maybe for better docs) - I think every framework has that issue of making 80% (if it's a good framework) of some problem easy, but sweeping a real mess into some corner for other work.

Re: Why Programming is Difficult (2014)

#35
post #19

I don't think programming - in the sense of what 99% of programmers do - is as difficult as programmers love to blog about. Most professional programmers write stuff that is not all that hard, and most of it has been done by others countless number of times. All the "hard" cutting edge stuff is done by a tiny tiny fraction of programmers. Heck even the things people think are cutting edge now, just taking a random ex…

There is another kind of "hard" though, which involves managing growing code bases, doing programming within a business setting, and so on. We mostly let the scientists work on well-defined problems in isolation, so they can really focus on those deeply intellectually challenging things, but even if those scientists are very clever I don't think they are necessarily good at larger-scale system development.

There are lots of jobs that are harder than mine in some sense, but if you look at the objective of building high-quality complex software in the minimum amount of time, keeping it running correctly, and then being able to change that software as effectively as possible, then that in itself is pretty much an infinite problem. Maybe there is lots of scientific work to be done to help us struggling coders, and maybe we need to get our shit together more as a profession... It's not all easy.

Re: Why Programming is Difficult (2014)

#36
post #5

The bigger question is, why are we still programming the way we did 20yrs ago? Higher level languages were a great improvement over machine language. But what comes next? Why don't we have it yet? A decade ago I was setting up database, writing queries, designing forms, writing the code to wire it all up. I still have to do all these steps with more amount of effort today.

I think Backend-as-a-Service providers are a good step towards a place we want to be, although I still think we're not super close to using such services to deploy complex business logic on. Services like parse cloud code and AWS lambda are another step closer. Context: We (me + couple of collaborators) are writing a similar platform for ourselves, although the purpose is dogfood more than $.

Parse is shutting down though.

Re: Why Programming is Difficult (2014)

#38
post #17
post #2

In my experience, the overwhelmingly most difficult thing about programming is writing code that makes sense, even after it has gone through a couple rounds of requirements changes and bug fixes. Any concrete coding task can be dealt with straightforwardly enough, but projects as a whole tend to deteriorate by arbitrary fixes, maintenance patches, and failure to uphold a conceptual schema. The idea of composability i…

Do you think that sort of a problem (incremental changes eroding an initially sound structure) could be fixed with better refactoring tools? It seems like the issue you're describing is that logic is leaking from some parts of the codebase to others, which might be fixable with sufficiently powerful refactorings.

> Do you think that sort of a problem (incremental changes eroding an initially sound structure) could be fixed with better refactoring tools?

Only if those refactoring tools could refactor the domain itself (and the environment), not just the code :-)

Often these special cases aren't intrinsic to the code, but caused by inconsistent business rules, or weird issues with the environment (some browsers not sending some events, workarounds for compiler bugs on ancient platforms that must still be supported, socket closing might or might not cause a flush depending on whether you're on Windows or *nix, ...)

Re: Why Programming is Difficult (2014)

#39
post #3

I think the author nailed it on the head with the Workplace parts about why programming is difficult. The physical/socio-political environment that someone is in compounds the normal issues in the programming process and I've seen it drive quite a few programmers to straight up quit when the mountain of issues became insurmountable. Without the freedom to tinker and explore a bit, as the author bemoans, I think that…

I am thankful that at my current job, we do get some time to experiment here and there.

Begin tangent:

I work for a university doing grant projects for a few state and federal agencies, though. Some might like it, some might consider it hell for an entrepreneur. It works for me :-)

We are in the process of re-writing our "flagship" app from 10+ year old java libraries. We were able to dodge the bullet of "upgrading" (???) from Struts to JSF. The new app is going to be a services based (REST + JSON) Java (mostly) back end, with an Angular based front end. We just did a demo of a subset of the new app at a trade show where a 3rd party app imports a partial record (via web service) into our app, then launches a nested browser window to run the rest of the relevant data entry. (the rest of the workflow will be handled by the legacy app until the complete new version is finished)

No, I couldn't persuade my coworkers and supervisor to discard Java entirely and go with Node.js :-) I'm not entirely sure I would be comfortable with that, either. We are doing some server side Javascript lately, though, by using the Java scripting engine interface.

We will likely soon be redoing another (30 or so year old) app from a sister university that the state uses, as well. Interesting times!

For almost 5 years before this, I worked at a financial services company. I got paid a bit more (bonuses), but I spent all my time, really, keeping 2 legacy applications going without ever getting to spend much time REALLY updating some sore spots.

Re: Why Programming is Difficult (2014)

#40
post #17
post #2

In my experience, the overwhelmingly most difficult thing about programming is writing code that makes sense, even after it has gone through a couple rounds of requirements changes and bug fixes. Any concrete coding task can be dealt with straightforwardly enough, but projects as a whole tend to deteriorate by arbitrary fixes, maintenance patches, and failure to uphold a conceptual schema. The idea of composability i…

Do you think that sort of a problem (incremental changes eroding an initially sound structure) could be fixed with better refactoring tools? It seems like the issue you're describing is that logic is leaking from some parts of the codebase to others, which might be fixable with sufficiently powerful refactorings.

Possibly, but if so I suspect it'll be a big change from the tooling we've got at the moment. And there's always a risk that tooling which makes some changes (rename a method...) trivial will make substantive changes seem even harder (because, comparatively, they are).

Somewhat the same arguments apply to approaches which put a lot of emphasis on small-scale/unit testing -- they offer reassurance when doing small-scale refactoring at the expense of making substantive refactoring harder.

Post reply on HN