Live data from Hacker News

Confessions of an Intermediate Programmer

michaelbromley.co.uk

81–90 of 118 posts

Re: Confessions of an Intermediate Programmer

#82
Nice article but i was wondering why didn't you go to university/IT School to learn computer science?

--

"To me, the object-oriented approach was just a bunch of unnecessary overhead and boilerplate"

If you had made real C++, you would'nt have think of object oriented programming as an overhead. I suggest you to buy a few O'Reilly books (Probably the best code book )

Re: Confessions of an Intermediate Programmer

#83

Nice article but i was wondering why didn't you go to university/IT School to learn computer science? -- "To me, the object-oriented approach was just a bunch of unnecessary overhead and boilerplate" If you had made real C++, you would'nt have think of object oriented programming as an overhead. I suggest you to buy a few O'Reilly books (Probably the best code book )

Not the author, but personally, I chose Maths as I felt it gave me a broader basis to approach my career. I am now happily employed as a Software Engineer. I do find I've missed out on some things (TDD indoctrination, for example), but I've gained in others.

Re: Confessions of an Intermediate Programmer

#84
post #71

Earlier quoted context omitted.

> When you are 20 you are pretty much at the height of your mathematical abilities. Is that really true? There are many examples of people who came to mathematics late in life and did good things: http://mathoverflow.net/questions/3591/mathematicians-who-we... I think you only get better with time if you keep yourself sharp. What has changed for me is that I can't sit still and pound back Redbulls for six-hour coding…

>Is that really true? It's almost certainly not true, at least among those that would be called mathematicians. This follows if for no other reason than the fact that it takes years to get up to speed with the forefront of any particular branch of mathematics, which is the prerequisite for testing out one's mathematical abilities (in the context of research). While you occasionally have a few teenage prodigies, most…

I can see how it would be true of normal programmers though -

Computer science courses usually teach something very different from every day programming. You learn linear algebra, AI, dynamic programming.

Then you go to work and spend 10 years mostly not doing those things. They are generic, and there are libraries for generic things - you just need to understand how they behave.

A decade later, most people will only retain the specific techniques they use in their domain. Maybe you know more than you ever did about indexing algorithms, but the math behind the deep learning algorithm you wrote at college is gone.

Re: Confessions of an Intermediate Programmer

#85
post #18

Earlier quoted context omitted.

write more code. regret it.

The scariest place to be as a programmer is when you look back at what you did 6 months ago and still think to yourself that its pretty good. A little regret is a good, good thing.

Five years ago, I would add a new feature and 50% of the time it would be a fair bit harder than I expected, then maybe 30% of the time I would find it easier than I expected, as I had designed the code well, and it was set up for extending / reuse.

Nowadays, I am getting better. If I don't understand a bit of code I wrote a few months back, then I use it as an opportunity to look at it freshly. Why is this code crap? Why is it making what I want to do difficult? How could it be better? That's a good place to start refactoring from.

Re: Confessions of an Intermediate Programmer

#86
post #20
post #18

Earlier quoted context omitted.

write more code. regret it.

In addition to this, reading and being able to understand other people's code will provide great returns. You learn about styling, coding standards, architecture, patterns, etc that you might have never stumbled upon if you attempted to code everything yourself.

That must depend o having decent code to work on in the first place. Seeing some of the comments in the code bases I have worked on, I am not sure I was going to learn anything there.

Re: Confessions of an Intermediate Programmer

#87
post #72

Earlier quoted context omitted.

> Those 100 line functions wouldn't make it through any half decent code review. True but I have worked on worse. The codebase we inherited from SQL-Ledger is quite a bit worse and was even more poorly commented when we forked (the only comments, aside from two lines describing the module, and copyright notices, were magic comments which if you delete things, stuff breaks). And some of the modules were 4-5k lines wit…

I hate to be all, my pile of spaghetti is bigger than your pile of spaghetti, yet I just can't help myself - 2 decades in development - just under 3k "scripts", mixture of php html "fusion", php classes, and last decade or so templates have been added - last wc -l check, was well into 1m lines in house code - database (we have a few), >300 tables, it used to be around 4 but we culled some tables / systems This is our…

> - just under 3k "scripts", mixture of php html "fusion", php classes, and last decade or so templates have been added

Unfortunately the fact is once you get to a certain point you pretty much have to accept that you are going to have some inconsistency and rewriting is going to happen gradually. With the LedgerSMB codebase, we have a mixture of code before the fork, which is a mixture of Perl spitting out HTML as strings in pieces and Perl assembling db queries in little pieces, so your comment made me somewhat uncomfortable because it reminded me of what I am going through in the rewrite process.

> - last wc -l check, was well into 1m lines in house code

wc -l was in my case closer to 200k, but once you exclude blanks readmes, documentation and comments we added, it got down to about 100-130k. Not really sure.

However, the code was messed up in ways that are only possible by taking powerful features of a language and systematically abusing them. In the db, needless polymorphic associations which served no purpose.

Almost every module had a name of exactly 2 letters, and the scope of some of the modules was just breathtaking. PE.pm for example handled logical groupings of parts for point of sale, customer discount groups, and project accounting.

Now if there were modules that did too much, there were also modules which were divided for no reason at all. You had, for example, ar/ap workflow and user interface split between aa.pl, arap.pl, and arapprn.pl (the latter being printing support functions).

This is code that every time I work with it, I find unpleasant surprises lurking beneath the surface. It is code that when we forked failed basic tests for things like rounding numbers (financial app). We fixed that right away.

If we are lucky we will be done with the rewrite in another five years.

> Some of the people in this thread should get together and start a new dailywtf clone. Pretty sure we could preload a years worth of content with nothing but grep and git-log.

Definitely. I am up for it. Should I start a blog and post the url here? I would be happy to add you.

Re: Confessions of an Intermediate Programmer

#89
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…

Perhaps with age comes increasing tolerance and increasing ability in discerning hypes from useful technologies?

I'm a pretty 'young' person, and a much younger programmer, so I can't quite say I got the 'oo shiny lemme use that' thing out of my system, but I'm okay with that (for now it doesn't negatively impact my work, and I learn tons of stuff). But in other areas of life, I've noticed that I generally become less dichotomous in my approach to new and other things, but more discerning too.

Re: Confessions of an Intermediate Programmer

#90
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 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.
Post reply on HN