|
I think every software development company has there own style / they follow other coding conventions.
I don't believe the every one must follow the same rules / coding conventions.
Yes of-course developer should know about the object declaration that s/he is using in
his/her code for compile...
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
|
Like lots of stuff here, all hat and no cattle.
|
|
|
|
|
I follow standards that are followed by each and everyone in my company.
|
|
|
|
|
Why?
Has it ever occurred to you that the standard might be wrong? That it might actually cost more to maintain it than it ever returns on that investment?
Let me guess; your company is doing Systems Hungarian? Prefixing every string with "str"?
Joel Spolsky has got a must-read article on the subject; making wrong code look wrong[^].
"Question everything".
Bastard Programmer from Hell
|
|
|
|
|
Do you know what the standart is?
Has it ever occurred to you that the standart might be right? That it might actually cost more to bother changing it than it ever returns on that investment?
Let me guess: you question everything? Without bothering with even knowing what you're questioning first?
|
|
|
|
|
arthursouza99 wrote: Do you know what the standart is?
Yes, doing blindly what you're told to do. That's a good attitude if you're a soldier, but it doesn't help much if you're a commercial software developer.
arthursouza99 wrote: Has it ever occurred to you that the standart might be right?
Yes, more than once; a question that can only be answered by questioning the standard, never by accepting it.
arthursouza99 wrote: <layer> That it might actually cost more to bother changing it than it ever returns on that investment?
It doesn't cost you a single coin, unless you're actually religiously enough about your holy rules that you need them implemented in old, antiquated and formerly working code.
arthursouza99 wrote: Let me guess: you question everything?
Yes sir.
arthursouza99 wrote: Without bothering with even knowing what you're questioning first?
That's your assumption. Do you often accuse people of ignorance, without bothering to check that fact?
Bastard Programmer from Hell
|
|
|
|
|
You assume the guy above you just did not think about anything before accepting the standard. I would hate to be in a project with a guy that instead of looking at the way that everyone has coded on the project just questions everything and makes the work harder for everyone. You cant just play the smartass and say "question everything" when all the information you have is that the guy follows a standard . He never said "we are a bunch of robots that don't think", he said "he have a standard and follow it".
|
|
|
|
|
arthursouza99 wrote: You assume the guy above you just did not think about anything before accepting the standard.
Not only did I "assume" that, I was proven right. Six times in ten years.
arthursouza99 wrote: I would hate to be in a project with a guy that instead of looking at the way that everyone has coded on the project just questions everything and makes the work harder for everyone.
I'm sorry, but I consider that to be part of my job. I bet you'd hate it for everyone to stay until 7 PM and discuss the most common patterns. You wouldn't hate it if we'd order a pizza.
arthursouza99 wrote: You cant just play the smartass and say "question everything" when all the information you have is that the guy follows a standard .
It took me a week to find an answer to your question, and it's "yes, I can". I'm not a soldier that's going to follow orders, nor am I a businessman. I'm a coder, damn good at my craft, and taking it seriously. You wanna follow a standard? Find a job that doesn't involve thinking.
arthursouza99 wrote: He never said "we are a bunch of robots that don't think", he said "he have a standard and follow it".
You're right I overreacted.
Bastard Programmer from Hell
|
|
|
|
|
Did i mentioned anywhere that we never changed the standard.Before downvoting can't you even think that if an organization is following a standard then definitely they will take all measures to avoid mistakes in that.
If by chance there is a mistake which i found in that standard then i will definitely approach concerned person and explain him in detail about it. Then the standard is modified and passed to each and every developer in the organization.
Generally standards are followed by companies because if one developer leaves the organization then other developer who is handling that task won't get much trouble to understand the code.
Without informing anyone if you follow your own coding style then what is the use of preparing a standard.
|
|
|
|
|
I follow a well defined standard. However, for flexibility and understand-ability purposes, I occasionally redefine standards as well.
|
|
|
|
|
I follow strict coding standard and suggest/recommend to follow it strictly to my colleagues, that will help us to track huge code easily. coding standard includes all comments, variable naming conventions, declarations etc.
If you are TL/ML then we have to be too quick to identify any code, obviously coding standard is big way/support for us.
finally, Programming coding is like sex:
One mistake and you have to support it for the rest of your life.
Rating always..... WELCOME
The only reason people get lost in thought is because it's unfamiliar territory.
|
|
|
|
|
5 to your last sentence!
|
|
|
|
|
My favorite quote for coding..
Code as if the next programmer is an axe murderer who knows where you live.
With all of the different projects over the last few decades, I can't say I've found more than a tiny handful that code consistently and logically. And, no, I am not among that handful. However, whichever way I code, I always try to take the time to comment in whatever the frack I was trying to do with the code. You don't need to comment print or calculations...
When you have to step through your code...anyone's code... it's great to find a few troubleshooting tips and what-not for something that hasn't been seen by humans in years. One of our old programmers tended to swear and drink while coding... and comment about the same, too.
No single raindrop believes it is to blame for the flood.
-irresponsibility@Despair.com
|
|
|
|
|
quinton1969 wrote: ou don't need to comment print or calculations...
Calculations need not be commented? What kind of programs do you write? Last weekend I worked on some code to initialize 3D objects procedurally. Input: A radius and the level of detail, output: rendering buffers with vertices, an index buffer to assign the vertices to triangles, a buffer with normal vectors, and several sets of texture coordinates and blending weights for each vertex.
It's about two pages full of lengthy equations and it only prepares a sphere. Calculating more complex 3D objects may require yet a little more code. Without comments you will certainly have a problem remembering why you did something the way you did it when you revisit the code after some time. I certainly was glad to have left behind more comments than code in that method.
At least artificial intelligence already is superior to natural stupidity
|
|
|
|
|
Well, your specific quote was preceded by "always try to take the time to comment in whatever the frack I was trying to do with the code.".
I am fairly certain most people understood that to mean to code for the whole, not for specific mundane bits of logical code like print/output or calculations. I consider commenting in a more holistic form of documentation. I believe any coder worth his salt should be able to be able to understand all the basic bits of code and really only need coding for the wicked complex items....like "complex 3D objects". This make me think back to QuakeC from Carmack.
No single raindrop believes it is to blame for the flood.
-irresponsibility@Despair.com
|
|
|
|
|
quinton1969 wrote: Code as if the next programmer is an axe murderer who knows where you
live.
Here is the comment I will prepare for this guy in my code:
<br />
...<br />
|
|
|
|
|
The question was about style the answers were about standards. Two different things. I have a personal style but no company standard (yet).
|
|
|
|
|
That's exactly it.
People are debating the wrong stuff here.
Everyone has its own style of coding. It may not be original mas is his/her way.
Following standards has nothing to do with this.
|
|
|
|
|
I agree. The trouble is that coding standards often include style, so that doesn't help in not getting them mixed up! Standards (excluding style) are more important than style. Although I have a preferred style I would make more fuss over things such as not using magic numbers than code layout.
Kevin
|
|
|
|
|
The first I do in any class or module is create sections for Storage , Properties , Constructors and Methods . Sections for event handlers, interface implementations, internal classes, enumerations and the like are added if needed. If the code is really complicated, I'll use subsections, like separating public and private methods, or grouping menu handling events away from other controls. In each section, the methods are sorted alphabetically. With this setup, I can look at my code years later and know what is what, and even find stuff faster than I can navigate the search functionality.
|
|
|
|
|
... and this is not necessarily bad.
At this main project I'm involved we work together for more than 4 years now and we can distinctively identify who's code is that we're reading.
It's not an immense difference but it shows.
Its king of a "personal touch" we all have.
It may be the way we use the brackets, we declare the variables, the actual naming, the way we write JOINS on SQL Server (if we break line on the "ON" or even if it breaks before or after the "ON").
It has nothing to do with good or bad code, it just the small things that if we know each other well we can identify who wrote it.
I think that on a team we all should follow the same guide lines but enforcing too many rules we may end up killing creativity/evolution.
|
|
|
|
|
AlexCode wrote: if we break line on the "ON" or even if it breaks before or after the "ON"
Definitely before the ON.
|
|
|
|
|
...on which project I'm working. At work, we use the recommended MS style. There are even some checks on the TFS for that.
When working on some open source projects, I usually have to follow a different style rule.
|
|
|
|
|
embix wrote: When working on some open source projects, I usually have to follow a different style rule.
Would those be the horrible GNU standards (especially for automake/autoconf) that render projects unnecessarily arcane to the non-initiate?
|
|
|
|