Tag Info

Hot answers tagged

55

Doesn't it mean it's rare to have things right right away? Exceedingly rare. In fact, if things run 'right' the first time, I normally assume that something is drastically wrong. Does it mean that the people demanding correctness right off the bat are unreasonable? Completely and utterly. And now, what is the way to avoid making mistakes now? ...


18

Personally I'd be most concerned about the "forgotten line" and the "missed method call". Everyone makes some mistakes, and like everybody says the most efficient way to find things like typos is with the compiler, not with repeated manual proofreading of all your code before you present the first version to the compiler. Some IDEs help with this too. ...


6

The people criticizing me say I need to be able to make code without bugs. Those people are wrong. There is nothing bad at making bugs on the first try. In current days of quick, incremental compilation and intelligent IDEs, that mark errors without compiling, first-time methods are not that big problem. It is much more profitable to put your energy and ...


5

No, it is not a violation of the LSP. The LSP says that instances of a subtype should be safely substitutable for instances of the parent type (i.e. after construction). It doesn't matter how they get constructed.


4

The majority of my bugs are most often not algorithmic (such as mistaking one var for another, a forgotten line, a missed method call). I used to make this kind of mistakes, a long while ago. This happens due to rushed code, spagetti code and too tight coupling (resulting in having to keep track of too many things at the same time, while writing an ...


3

Doesn't it mean it's rare to have things right right away? It is usually normal to not get everything right right away. Case in point, if you are working with a client, sometimes not even they know what they want, so potentially they could come back to you a couple of times to fix parts of your code. Also, people with different job descriptions tend to ...


2

This problem was essentially solved decades ago. If your language allows it, simply keep the third party API and your own code in separate namespaces (Packages in Ada, namespaces in C++, modules in Modula-2 etc). Where it isn't obvious which Entity you are using, refer to all Entities using qualified names, e.g. FlashPunk.Entity or MyApp.Entity (Ada), or ...


2

I take a slightly different perspective on the issues you raised than most other commentators. I apologize for a long response, but I wanted to draw as many examples as well as issues because these issues can make a significant difference in one's careers. I have had to personally go through hard times in my career, and thus I wanted to share what I learnt. ...


2

The notion that professionals never make errors is ludicrous. Professionals do two things that amateurs do not. The first is that they shorten their feedback loops. Have you ever made a typo? Would you finish typing the document, discover it, and then decide to throw out a document if you did? It's crazy right? This was a real problem for ...


1

You mentioned nothing about the scale of the projects you have to work on. Eitherway writing large amounts of flawless code is impossible, trying to is a good thing but it should not be compulsive because that will slow you down. When you are confronted with a new problem, you must grasp it intuitively and start writing, gradually you will figure out what ...


1

In this business, be really careful about taking others' criticisms too much to heart -- be attentive, of course, and always try to improve yourself, but don't just accept others' characterizations of you. There are lots of people who play stupid power games in order to favor their position in the organization, or else favor their personal technical ...


1

A popular method nowadays is Test Driven Development. You start by writing the test case, which obviously fails since the actual code is still missing. This is thus a perfectly normal situation while you're developing. But to finish your task, the test cases you added must pass. As a result, you go from "code still in development" straight to "all tests ...


1

I couldn't disagree more with the people who say "code should work right the first time". It's nonsense. You can write code very carefully and very slowly and have code that works right the first time after four hours. Or you can write code very quickly that compiles and runs after an hour, with all the bugs fixed after two hours. So what is better? My ...


1

It's possible to create perfect code the first time. It just takes some years of practising and writing large amounts of code. How it works is that you'd verify the code correctness while writing it. Instead of randomly writing code and hoping it would work, you write the code and immediately verify the correctness. Any errors you find need to be fixed ...


1

Remember that training sets are meant to encourage learning. I see that message as just a morale booster to encourage you to continue. For simpler programs, it is often a matter of focus to code without any bugs. For complex tasks with many interacting classes, there is always the possibility of a bug even with expert programmers. Proper coding practices ...


1

This is an example of Symbian S60 code review checklist that was used as mandatory input into both peer review and formal inspection processes applied at Tieto, Telecom division in 2008 Outputs of the code reviews could influence the contents (and priorities of the points) on this checklist. Beside this simple list of points we also had more detailed ...


1

The primary problem I see with this is that talking about your code you're going to get a lot of "which Entity do you mean?" questions. Most modern computer languages (and many older ones) provide name scoping to avoid this problem, but English is older than any of them and all it has is weak context hinting. Which means that if you go down this path you're ...


1

Naming collisions are bound to happen when using third-party libraries because naming objects is not an easy thing to do and there are not many elegant names one can assign to objects to give them representative meaning. With that said, if you won't have many of these collisions that would cause much confusion to anyone reading/using your code, then use the ...



Only top voted, non community-wiki answers of a minimum length are eligible