Live data from Hacker News

What are some things you wish you knew when you started programming?

quora.com

41–50 of 102 posts

Re: What are some things you wish you knew when you started programming?

#41

Use an IDE, not VIM

That really depends on the language I think. Java/C# etc I wouldn't dare to touch without an IDE. Most of my Clojure/Lisp work is done in Emacs (with Evil for Vim bindings, without any syntax highlights). People /still/ think I'm goofy for preferring that. But, I find that if you think of programming as "creative writing" instead of engineering you enter a different, more flow-like, mindset. The IDE and all its billions of buttons just get in the way for me, while just writing s-expressions as trees (using paredit with agressive-indent) never breaks my train of thought.

Re: What are some things you wish you knew when you started programming?

#42
You will write tests, because without them, you cannot refactor.

With them, you will be able to quickly and easily make your code better and better, with much less risk of regression.

As a result, the initial implementation details of your code are not very important, and you don't have to spend much time thinking about how the code might evolve in the future (which is unknowable anyway).

PS Don't spent much time testing the internals of your code. Check that the inputs and outputs are correct, as thoroughly as you can. Testing internals actually makes refactoring harder.

Re: What are some things you wish you knew when you started programming?

#44
That unless you are in a pure code monkey position, programming is at most, 30% of the job and there is an array of skills that have nothing to do with programming that when mastered, will give the impression that you are an expert programmer.

Re: What are some things you wish you knew when you started programming?

#47
post #8

Although I had done some programming before, I always remember the first lecture of the first year of the CS course I did where the lecturer basically concentrated on the importance of KISS (i.e. Keep It Simple Stupid). He did say that we'd probably not believe him, and of course we didn't as we were all desperate to prove how awfully clever we were. He did also say that if we stuck at things long enough we'd probabl…

Can't agree with this one enough. I'm currently battling through a project full of people that are too smart for their own good and too stupid to realise it.

I had a huge argument today with someone that wanted to wrap a certain type of higher order function ("foos") in another higher order function with a particular name ("fooGenerator()") for the sole purpose of differentiating it from a different kind of higher order function in the same file ("bars").

I lost the argument. It turns out using heading comments to seperate groups of similar functions, or god forbid splitting up the 400 line file into multiple smaller ones, is too confusing and prone to errors by maintainers ("What if they put a new foo function in the section for bar functions!")

Re: What are some things you wish you knew when you started programming?

#48
For anything you want to learn in your life the best thing you should learn:

Learn from the Masters, do not seek advice in random people on Internet.

It is called "modeling". Pick your masters-mentors carefully.

For example we have people in my company that could do the work of tens or hundreds of people just by themselves because:

-they are incredible experienced and smart. -they know regular expressions, know how to automate everything. -they understand good design, and understand people as well as computers.

Just living around this people you will start modeling them, and doing the same they do.

But people also model bad behaviors just by proximity. Fat people use to have friends that are fat, and family members that are fat. The same happens with smokers or drug addicts. You pick from your surroundings subconsciously.

For example someone here recommends you to not use vim, use an IDE. Well , the masters I know either use vim or emacs a lot. They can use other tools like IDEs too, but instead of depending on someone else for automating the stuff they need they use to make their own tools.

Remember that no big company like Microsoft, Apple or Google are going to make your life easier for making your software multi platform for example, but for your company it could be essential. On the contrary, if you only use their tools your life will be miserable if you go against the interest of those companies.

Re: What are some things you wish you knew when you started programming?

#49

Write 5 tests for a piece of code that you think is working but has no tests. You will find at least 1 bug every time. Staying at work longer won't help you produce more and better code. Sleep and exercise will. People who get angry about technical choices like what framework to use or what coding style or how tightly to enforce rules will flame out. Don't be that person. If you think you need to rewrite it from scra…

Chesterton's Fence is a brilliant insight. Funnily enough, I learned it reading some interview in a fashion magazine. They talked about what made different designers styles is the fact that they didn't break fashion 'rules' haphazardly, rather that people should only break 'rules' they knew the purpose for and why they wanted to do so.

Re: What are some things you wish you knew when you started programming?

#50
1. Don't stay in a job that makes you miserable.

2. The design and specification stages of programming are not pointless enterprise makework, they are genuinely useful.

When writing a program, make sure you understand what you're trying to achieve in detail, and write a plan about you intend to do that.

If you don't know what you're trying to achieve (and by extension your customer/client doesn't either), schedule in some research / exploration work as the first part of your plan.

Once you have a better idea, redo your plan (and maybe your budget) and check it with your customer/client.

3. If something is going wrong, or you think something is going to go wrong, it's much better to tell someone as early as possible. Even if it's your fault, don't sit on your shame - get some help.

For example, if you're going to go over budget, you may be able to get some more budget. Or you may be able to get some features cut.

Post reply on HN