Live data from Hacker News

Confessions of an Intermediate Programmer

michaelbromley.co.uk

101–110 of 118 posts

Re: Confessions of an Intermediate Programmer

#101
post #97

For me the thing I had to learn was commenting more than anything else; working alone I never saw as much use for it. Then I worked with a guy that commented his code very well and suddenly I saw massive value in it. I'm definitely still an intermediate programmer, but I think I was always fine admitting that to myself. It was getting over the fear of others reading and modifying my code that took me a while.

Yeah well... Great code needs no comments. Bad code needs lots of comments. I've seen examples of both recently. I randomly met a guy who told me of his idea to implement a UX framework with windows, buttons, views, etc in python. A week later he sends me the finished framework. And it's perfect. It's easy to understand, all the names of things make sense, it's orthogonal. Not a single comment anywhere, but perfectly…

> Great code needs no comments.

Great code implementing a particular algorithm for a particular reason might want a comment (1) identifying the algorithm and providing a reference to a published description, and (2) identifying the reason the algorithm was chosen.

Great code that is clear and readable and well-fit to purpose can still, very often, benefit from comments. Not everything that might want to be made clear to readers of code can be expressed in the code.

Re: Confessions of an Intermediate Programmer

#102
post #36

From both my own experience and witnessing others, one major factor that sets apart from beginner and expert is working with legacy code. And by legacy I mean legacy from previous developer, previous team, whatever, not necessarily a decade old code base. Beginners are keen to get rid of all the legacy code. It's tightly coupled, it's hard to read, hard to maintain, yada yada yada. And then they tend to make a way to…

Also I'd argue one shouldn't be considered an expert programmer until they've been forced to maintain lots of legacy code. It's an incredible lesson in what not to do, knowing when to comment and when not, proper naming, which things to optimize "prematurely" based on your experience-based predictions of how your application will scale, how to organize code in support of a growing codebase, etc.

Re: Confessions of an Intermediate Programmer

#103
post #97

For me the thing I had to learn was commenting more than anything else; working alone I never saw as much use for it. Then I worked with a guy that commented his code very well and suddenly I saw massive value in it. I'm definitely still an intermediate programmer, but I think I was always fine admitting that to myself. It was getting over the fear of others reading and modifying my code that took me a while.

Yeah well... Great code needs no comments. Bad code needs lots of comments. I've seen examples of both recently. I randomly met a guy who told me of his idea to implement a UX framework with windows, buttons, views, etc in python. A week later he sends me the finished framework. And it's perfect. It's easy to understand, all the names of things make sense, it's orthogonal. Not a single comment anywhere, but perfectly…

Sorry, I downvoted this. Great code doesn't need no comments. Lots of comments is definitely a code smell, but anything of reasonable cognitive complexity will almost certainly require some comments.

I can't be certain about your first example, but writing a UX framework is a pretty straightforward thing in terms of what it needs to do, so there probably wouldn't be much need to comment about what it's doing. Why, though - that's a whole 'nother question. Surely it's missing some of those whys.

Re: Confessions of an Intermediate Programmer

#104
post #54

This article did an excellent job verbalizing the incredible feeling of mental potency one gets when learning to program. When you see that first "Hello, World!", you are hooked. I still get this feeling whenever I learn a new platform. When I learned Android I was amazed that I had made a real-life app run on my phone. When I learned Ruby on Rails I proudly stuck my flag in the surface of the internet and declared m…

The desire to empower kids is basically one of the best motivations available to everyone. I'd recommend poking around for after school programs where you can volunteer to do it. I spent a month or two teaching HTML to a small group of middle schoolers and it was easily one of my favorite experiences in life.

Re: Confessions of an Intermediate Programmer

#106
post #97

For me the thing I had to learn was commenting more than anything else; working alone I never saw as much use for it. Then I worked with a guy that commented his code very well and suddenly I saw massive value in it. I'm definitely still an intermediate programmer, but I think I was always fine admitting that to myself. It was getting over the fear of others reading and modifying my code that took me a while.

Yeah well... Great code needs no comments. Bad code needs lots of comments. I've seen examples of both recently. I randomly met a guy who told me of his idea to implement a UX framework with windows, buttons, views, etc in python. A week later he sends me the finished framework. And it's perfect. It's easy to understand, all the names of things make sense, it's orthogonal. Not a single comment anywhere, but perfectly…

    > Great code needs no comments.
The most valuable comments that code can't obviate are comments that explain why the code was written this way, the intent, and a summary of how the code fits into the overall picture -- maybe at least a file-level comment.

I think declaring intent is the most valuable comment. What was the author going for with this function? Why is there a nil-guard here when the database column is `NOT NULL`? Is there an actual edge-case or is our data bad or was the author just being arbitrarily defensive against a boogeyman nil?

When reading other people's code, I've found that most of my time is spent figuring out not what the code does, but rather the author's goals and their higher level game plan.

Re: Confessions of an Intermediate Programmer

#107
post #74

Earlier quoted context omitted.

You see a huge amount of this sort of poor-man's version control in other industries - everyone I have worked with in other industries has worked out some personal scheme of versioning using initials, dates, numbering in order to sequence the various states of their work as it passes through multiple people and multiple versions. A lot of room for disruption there I think if someone works out how to make version cont…

File History in Windows 8 is nice, sort of. It takes snapshots of changed files every hour. Sadly you have to enable it first and it's sort-of treated as a backup (so you have to store the copies on a different volume, etc.). So, not exactly what people have in their home unless they know about such things.

I think the missing solution here though is collaboration and versioning between people, rather than individual backups.

Things like File History and Time Machine are nice, but don't really address this need.

Re: Confessions of an Intermediate Programmer

#108
post #54

This article did an excellent job verbalizing the incredible feeling of mental potency one gets when learning to program. When you see that first "Hello, World!", you are hooked. I still get this feeling whenever I learn a new platform. When I learned Android I was amazed that I had made a real-life app run on my phone. When I learned Ruby on Rails I proudly stuck my flag in the surface of the internet and declared m…

It's such a great feeling. My favorite part is how, no matter how long you've been doing it for, you still get that feeling time and time again.

Re: Confessions of an Intermediate Programmer

#109
post #77

Earlier quoted context omitted.

> I'm increasingly tolerant of other technologies. I would like to think I am, but recently I have noticed that everyone seems to want to jump on the NoSQL bandwagon. A lot of the jobs I see I would be a good fit want experience using MongoDB (or something similar). I have been looking to learn them, but having read up on the technologies, I can't find a reasonable use case for any of them in my own work. One that wo…

NoSQL DBs have real advantages - e.g. you have a huge production relational DB, you want to make schema changes - you have to take your app offline for hours.

If you're taking down a SQL DB to make schema changes then you're doing it wrong. Even resource-intensive changes can be done online by applying the changes in stages.

Re: Confessions of an Intermediate Programmer

#110
post #77

I've found the following really sets apart my programming now vs. earlier in my career: 1. I write and rewrite more now. I view the first time the code works as just the first draft (like I would with a paper). Earlier in my career I thought that making it work meant I was done. 2. I spend a lot more time thinking about what's happening in the code and why. I have found some of my best work to happen after days of th…

> I'm increasingly tolerant of other technologies. I would like to think I am, but recently I have noticed that everyone seems to want to jump on the NoSQL bandwagon. A lot of the jobs I see I would be a good fit want experience using MongoDB (or something similar). I have been looking to learn them, but having read up on the technologies, I can't find a reasonable use case for any of them in my own work. One that wo…

NoSQL DBs definitely have their place. For instance my current project uses one to handle and do limited querying on data from other systems without needing to have a full schema for that data. You could do it in SQL by breaking out the columns we need and storing the rest in an XML blob, but it would be annoying. One rule of thumb might be that anytime you want to stick an XML blob into SQL, consider NoSQL instead.

That said, I think you're right that 90% of the time SQL is a better solution. You don't fully realize all the great stuff a real SQL engine does for you until you have to go without it.

Post reply on HN