|
Replying/preaching 6 times in one these types of threads - interesting.
Trying to defend javascript - priceless.
|
|
|
|
|
Slacker007 wrote: Trying to defend javascript - priceless. Always man.
Jeremy Falcon
|
|
|
|
|
Jeremy Quixote, I presume?
Software Zen: delete this;
|
|
|
|
|
Hopefully he will post again but I didn't think he was saying JavaScript was dumb but rather the justification given in the link was dumb for the specific code construct.
|
|
|
|
|
MarkTJohnson wrote: Clicked on the link, read what was said there and pondered for a minute.
I've decided that is one of the dumber language decisions I've ever seen. Dumb decisions pretty much defines JavaScript. The only thing I can think of that JavaScript missed is use of indents to define blocks as in Python.
|
|
|
|
|
1.2.3.YES
Give me coffee to change the things I can and wine for those I can not!
PartsBin an Electronics Part Organizer - An updated version available! JaxCoder.com
Latest Article: Simon Says, A Child's Game
|
|
|
|
|
Use of literal values annoys me a lot. Especially when that hard-coded value needs to be changed.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
That's a good one. Especially if that literal is used more than once...
Jeremy Falcon
|
|
|
|
|
Rick York wrote: Especially when that hard-coded value needs to be changed.
All code will need to change. That is just a fact of life.
But coding for all possible futures just leads to code that is hard to understand and maintain in all futures.
|
|
|
|
|
That was remarkably non sequitur.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Kevin Marois wrote: I just can stand it when someone doesn't use braces in IF statements: For me, that's acceptable... as long as the rest of the code is formatted well. Especially for stuff that's terse in nature like if (!blah) return; at the start of a routine. But it would have to be something short and simple.
Kevin Marois wrote: What bugs you when you see someone else's code? If we harken back to the first point... when folks don't use spacing properly. Code should read like text. And in English we have paragraphs. When I see large code files with no blank lines... I mean... what?
function checkout(goodsPrice, shipmentPrice, taxes) {
const total = goodsPrice + shipmentPrice + taxes;
const para = document.createElement("p");
para.textContent = `Total price is ${total}`;
document.body.appendChild(para);
}
function checkout(goodsPrice, shipmentPrice, taxes) {
const total = goodsPrice + shipmentPrice + taxes;
const para = document.createElement("p");
para.textContent = `Total price is ${total}`;
document.body.appendChild(para);
}
Jeremy Falcon
|
|
|
|
|
At least in C/C++ putting the opening bracket on the same line as a function definition
int f(int x) {
} But that's OK in classes - particularly if its a one-liner
class C {
int x;
int f(int n) { return x*n; }
{;
Keep Calm and Carry On
|
|
|
|
|
It's not exactly code, but comment boxes in the form of complete rectangles. The pinheads who originally drew them presumably believed that other people adding comments in the box would bother to keep its right-hand border nicely aligned. Not to mention that many of those comments provided a revision history for even the most trivial changes when, even in 1981, we had a source code management system that provided a full history, so that you could see who made each change, why, and get a diff between whichever versions you wanted.
|
|
|
|
|
But where is that VCS today? The source probably is still here. It feels so good to look at the header in a file originally committed into Jedi VCS years later checked in into an SVN repo with no option to keep the history to see where our journey began.
|
|
|
|
|
It was a proprietary VCS that is still in use. Some former colleagues are still using it, and some of my commits would probably still be there over 20 years later! Once released software had been proven for long enough, most of the history in that release would be deleted to free up storage space, which was at more of a premium back then. Code ownership was part of the culture, so one thing it supported was ownership of each code file by a user group, so that only members of the group could "open" a file for a commit. A file in the OPEN state also served as a warning so that anyone working on a private copy could consult with the developer changing the code to avoid merge conflicts.
modified 5 days ago.
|
|
|
|
|
Greg Utas wrote: The pinheads who originally drew them presumably
Well to be fair I wasn't a pinhead when I did that very long ago. Just inexperienced.
Greg Utas wrote: most trivial changes when, even in 1981, we had a source code management system that provided a full history
There are two comments for that one.
One it is just so cool the first time one figures out source control macros. Who can't resist using the one that inserts the change history?
Two been a while but it was after the year 2000 when a company I interviewed for, when I asked what source control system they were using, the interviewer explained that they had been considering putting one of those in place so my experience would fit well with that.
|
|
|
|
|
I would take offense to #1 and #2, but not #3. I use the K&R style of bracing.
/ravi
|
|
|
|
|
|
I have enough trouble with my own code... 
|
|
|
|
|
#1 and #3, except #3 is the style for JavaScript/TypeScript, so I have to live with it.
#2 - I don't do XAML but yes, I would agree.
|
|
|
|
|
2.
VS | Options | XAML | Formatting | Spacing |
(0) Position each attribute on a separate line ...
[x] Position first attribute on same line as start tag.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I program in VB6..... so none of this matters!!! 
|
|
|
|
|
I just follow the house coding standards whatever they are, which just ensures the coding style is consistent across the department.
I am not a fan of one line if statements unless the statement is on the same line as the condition.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
#1 I have no issues at all with the absence of braces but code must be indented correctly at ALL times, no excuses or exceptions
#2 I don't really care, maybe I'd enable auto wrap or reformat the code to do it, luckily I don't see it often
#3 just for C#, for C++ I prefer on the same line and even for C# it's just because there is a preferred style and it would be dumb to go against the current, if it wasn't for that, braces would be on the same line
|
|
|
|
|
inconsistant naming.
|
|
|
|