|
i hear that!
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
this is how freedom smells in a socialist system. As long as you like it, it is great.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
i'm not sure what any of this has to do with the workers owning and controlling the means of production (iow: socialism)
it's just about my feelings around coding standards. sheesh
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I lived in a socialist society and thats my feeling about. Owning means of production is not really essential in socialism, because there arent any profits from it. It brings only responsibilities to maintenance it.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
that's the def of socialism but whatever. i'm not having this convo with you on a programming board.
seriously.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I am also not, but you added some words which I prefered to share my personal experiences
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I find coding styles to be like handwriting. When you've read enough code written by others, you'll find that you can read any style - as long as the writers followed it consistently.
Life is too short to refactor everything into your preferred style.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Daniel Pfeffer wrote: Life is too short to refactor everything into your preferred style.
But, but those people over there are doing it WRONG!
|
|
|
|
|
Great response! 100% agree!
"Go forth into the source" - Neal Morse
|
|
|
|
|
codewitch honey crisis wrote: I'm half serious about this post. If you need to relax, work with the other not-so-serious half.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Honey I shrunk the code
|
|
|
|
|
I wish short code was also fast code. Why is it almost never that way?
I'm lazy.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
You said it
It's all too easy too write reams of code that is almost unmaintainable, in the end readability is more important than performance I think, that way less bugs will be introduced.
|
|
|
|
|
I totally agree.
I forget who, but someone said that design patterns are just a reflection of the limitations of a language.
In other words, patterns should be able to be replaced by keywords, basically, that do the patterns.
In general, I think this speaks to the broader point we were on.
Let the language do the heavy lifting. I just wish it did more sometimes.
I don't often admit this in polite company, but I'm a fan of pure visual languages like FlowStone.
They I think, do a really good job of encapsulating a lot of patterns.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I have heard about the Ballerina visual language, but never tried it: Ballerina.io[^]
Maybe when I'm retired and have the time for it
|
|
|
|
|
I have my own style and coding guidlines, but the determining factor of what I do at work is based on
a) Does the company have coding/style guidelines?
b) If a is false, I use the style/coding practices of the file I'm editing, and
c) try to use the same coding/style as other files in the project in new files i create.
Other than that, I try to only have one return point in a method, I declare and ini5t vars at the top of methods or scoped control blocks, try never to use "var" as a variable's type. keep methods within the scope that the method name infers, and I put class components in the order fields, properties, constructors, destructors, and then methods. Ialso put intellisense comments on every method and property. I'm also not shy at all about writinmg copious comments.
There are other things, but you get the idea.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
lol i use var as much as possible. in fact, i had to build the habit.
if C# had proper typedefs (using doesn't count) then I probably wouldn't, but i use generics a lot
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
codewitch honey crisis wrote: if(0==foo)
That's the most uselessest concept ever conceived.
codewitch honey crisis wrote: MS naming and style guidelines
I don't follow guidelines from companies I don't work for.
|
|
|
|
|
It was only useless with the advent of more sophisticated compilers.
I started coding in 1986 - old habits.
And for the record, I *did* work for microsoft.
But more, when you're writing company code that's fine.
When you're writing APIs to expose outside of your company you should probably adopt standards for your public interfaces that are widely understood.
Anyone writing in .NET is going to be familiar with the style of the 6500+ base classes used in the .NET framework, so it's as good a standard as any for public facing APIs, and better than most
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
That seems like a childish response, tbh
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Seriously though, when you get older you live and let live. Truths become less absolute.
|
|
|
|
|
I agree with that. In most aspects of my life I am very buddhist.
In most of my coding I am. Public facing APIs are a hill I'll die on though.
And by public facing, I meant interfaces that are intended to be consumed by a wider audience than one's company/team
Standards here are sooo important, for reasons I could practically write a book on.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Well, do you think any API became unusable because of the style of its interface?
|
|
|
|
|
I think what happens is people get less inclined to use it as the learning curve grows.
Especially with the rate people are expected to learn technologies.
The more one-off your style is, the more difficult to adapt to it.
Furthermore, when integrating many components it makes the glue code clunky if the APIs don't even remotely match up to each other in terms of how they're named and how you navigate them.
Pretty soon everything is spaghetti. Glue has always been glue code, and somewhat messy, but how messy largely depends on how standardized everything is in terms of how it's programmed against.
It's hard to put a point on specifically, if only because so many APIs with a one-off style suffer from other problems (libutp is a good example) but problematic APIs lead to less adopters.
So if you want wider adoption and higher quality code it's a good idea to keep your public APIs playing nice and consistently with as much else as you can.
This means in .NET for example, at least familiarizing oneself with microsoft style and standard guidelines.
Why? because the 6500+ base classes in .NET are coded out that way, and people already know how to use them. So make your API similar and the learning curve is less steep - seems obvious to me but then i've been coding for a long time too - not quite 40 years like i guess some people here
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|