Ask Slashdot: What Makes Some Code Particularly Good?
itwbennett writes: When developers talk about what makes some source code particularly 'good,' a handful of qualities tend to get mentioned frequently (functional, readable, testable). What would you add to this list?
When it's mine.
Not being PHP would have to be in my top two list for what makes good code. Not being Visual Basic would be #1.
"Murphy was an optimist" - O'Toole's commentary on Murphy's Law
Doesn't every self important developer think that their own code is the best?
How many managers does it take to reach a decision to begin a study to determine whether a light bulb should be replaced?
I'll see your senator, and I'll raise you two judges.
Not encumbered by patents, NDAs, or licensing restictions the keep me from making good use of it.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
Code needs to fail in an easy to understand and predictable way. If possible and practical provide descriptive and easy to follow details through logging or return values...
What makes good code? Most of the time it is 'mine is good yours sucks'. That is the mantra MANY unfortunately follow.
And say "thank you, my past self for making this so easy to understand and versatile!".
'nuff ...
For newly written code, things like readability, testability, and maintainability all can come in to whether it is "good" or not
For legacy stuff, Good code is code that works. Who cares how easy it is to read or test as long as it works?
My motto is "The only bad code is broken code. Anything untested is broken."
is a sense that "experts" (10,000+ hrs of experience) acquire, much like good design, only applied to something textual. Sometimes, you just need to look at the code from a different perspective (UML helps, so does explaining to an XP partner).
Code that you can change, and the change does what you expected and did'nt ruin something else in a seemingly unrelated place.
Doesn't matter if the code is otherwise butt ugly, as long as you can do this, the code is good enough to be workable.
Notice that the set of qualities which make code "good" are also the set of qualities not taught in any school.
Think they'll ever fix that?
-Signed, an Anonymous CS student
Good code feels obvious and self-evident, as though its design springs directly from the problem, rather than from the cleverness of the developer.
Good code is free of regret; regardless of how much it's been modified and refactored, it feels as though it was written in a single sitting, by a developer who somehow knew the right way to do it already.
Good code is not just readable, but inviting. It feels as though there is no wrong place to start reading it.
Good code doesn't have a single goddamn class named "Manager".
The opinions stated herein do not necessarily represent those of anybody at all. Deal with it.
That it works.
See: Subject.
I don't give a shit HOW readable, efficient, testable, etc. code is if it doesn't do anything useful.
You'd (or maybe people not in the coding profession) be surprised how often you go through large programs and find unreachable code, code that doesn't do anything once it IS reached, and code that simply burns memory for no real reason, but taking it out is difficult because it was band-aided in a thousand times over.
Lots and lots of GOTO NNNN and I know it's good code!
-The wise argue that there are few absolutes, the fool argues that there are no probabilities.
When it works.
No, seriously, that's the prime criteria. I'll take crap code over good code anytime, it it works and the "good" code needs some arcance and/or bizar setup procedure that I have to put up with to perhaps get it running.
Point in case: WordPress, a PHP driven Web CMS that today runs about 20% of all websites, is a huge pile of typical PHP spagetti. And don't even get me started on the data model ... the WP crew probably doesn't even know what that is. Anyway, just the other day I spent two hours hacking the login template to coax it into not getting in the way of an auto-login feature built with Active X and JavaScript (...don't ask, the customer spends 150 Euros an hour, I'm sure as hell not gonna make stupid remarks on all this).
I mean, just look at it! (Surgeon Generals Warning: Looking at WP code can cause instant heart problems and depression!)
It was quite an adventure.
However, it works. My grandma can setup WP in 10 minutes. Come around the corner with your flashy new Java whatnot, clean model and all, if I spend more than a week trying to get it runing on Debian or some other widespread Linux, I will ditch it, no matter how well the app itself is coded.
Programms are for users, and they have to work. The rest is icing. End of story.
We suffer more in our imagination than in reality. - Seneca
Personally, I like speed. It must be fast, you can comment out a nice readable version, but the one to be compiled must be fast.
Testability is critical, but it's pointless without actual tests. By tests, I do not mean a single test case verifying only the "normal" path where everything goes exactly as expected. I mean testing every boundary case, varying degrees of complexity where applicable, and failure modes, ensuring that it fails in the way that it is intended to fail and in every case where it is intended to fail.
I think i can shed light on this subject, having several years experience in this field. New programmers and seasoned alike often make this mistake, either through carelessness or ignorance. When working to write good code, you must make sure to set good="yes" or good="veryyes." ive written code for 20 years now and this has only ever failed me in PHP. Apparently the language does not support "good" code.
Good people go to bed earlier.
IF THE ANALYST codified CORRECTLY THE SYSTEM OF BUSINESS RULES , THESE WILL BE EXPRESSED AS FOLLOWS :
1- DO SOMETHING INITIALLY
2- DO SOMETHING TO ANSWER A QUESTION LOGIC
3- DO SOMETHING WITH OPERATION LOGIC PRODUCT
4- SAVE!
RULES :
1- USE FUNCTION OF LIBRARIES
2- NEVER CREATE A JOB WITH THE SIZE OF ALL THE BIBLE BYTES ! YOU ARE NOT GOD!
3-ASSEMBLY IN LINE, ONLY FOR THE ABSENCE OF A API !
4-DEBUG!
Fast; efficient; not bloated; not buggy; respectful of the user's privacy; hardened with regard to hacking if that's relevant; not encumbered by dependencies; adequately featured; well supported; well documented for the end user.
As far as I'm concerned, if you can't hit those 00001000 or 00001001 targets, you should be looking for different line of work.
Of course it is lovely if it's easily read code, well commented, well structured -- but if the former list is covered, I'll give the 00000011 latter a pass.
I've fallen off your lawn, and I can't get up.
The rules in "Code Complete" make for good code. Just read it and do everything it says.
- My coworkers
- Google
- Microsoft
- Twitter
- Amazon
is good code. just for starters.
If you have no rhyming variable names, then your code sucks. 1 stars
If you have one or two, it is barely acceptable. 2 stars
Half rhyme, then 3 stars.
If most, but not all, rhyme, 4 stars.
If every single variable rhymes with at least one other variable, you have a great job, 5 stars.
To get the coveted 6 stars, all the variable names have to rhyme with each other.
excitingthingstodo.blogspot.com
Some code is small enough that it's feasible to prove that the code is correct, assuming that the underlying hardware, libraries, operating system, etc.. don't fail. For example, in most languages you really don't need to put error-checking in code as trivial as this pseudo-code:
boolean isGreater(int a, int b)
{return (a>b);}
Sometimes, particularly when running in "small/tight" or real-time environments or when security is more important than debuggability, you may want a failure to be nothing more than something basic like "return -1" or "turn on aralm and halt the CPU" or even "flush caches, destoy security keys, and power off."
But you are corrent, in most cases good souce code will have good, clear, easy-understand debugging code.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
This type of article comes up continuously on /. and without some concrete defining attribute asking what model/version/etc. of "X" is "Good" is going to turn into a poll.
I would consider "Good" code to have the following attributes:
1. Runs under all operating systems and platforms
2. Source code is readable (note, this does not mean "Well Commented")
3. Takes up the minimum amount of space
4. Operations execute either apparently instantaneously or provides a progress bar for the user
5. Installs quickly
6. It's operation is intuitive
7. Does not share user information
8. Supports many/all user languages
9. Does not have extreme licensing conditions
10. Is free
11. Source code available
If I thought about it for another five minutes, I could probably double this list.
And, it's *my* list of what I would look for in "Good" software, I suspect for anybody else here, YMMV.
myke
Mimetics Inc. Twitter
When it's written by a gender and race balanced team, in a positive, multicultural environment, then it's good code!
By far the most important criteria is that the code must be easy to maintain. People with many years of coding experience will relate to this
That is... as brief as it can possibly be to accomplish the stated goal. Very simple.
I also like it when the code is commented properly so that every operation is broken down and and annotated to explain what it is doing.
This lets me go through the whole program and see what it is doing and the way it is doing it very quickly.
The code that makes me crazy is the rube goldberg code that does some thing very simple in the most elaborate way possible, has no annotations so I have no idea what the actual point of the code is, and then to make things worse various parts of the code will randomly switch between doing different things for no reason.
THAT code I hate. I see that shit and I delete it and write over myself.
Part of the problem is that people don't know how to do somethings. They understand the language but they haven't memorized the really short code snippets that are the ideal way of getting from point A to point B. And that's just something a programmer should either have memorized or stored somewhere for recall.
Using those code snippets tends make the code far more elegant and much more readable because you can see beyond the annotations what they're doing because you recognize that snippet.
If they never use them, that is fine too... just so long as they don't make their code look like that breakfast making machine from Chitty Chitty bang bang. If they do that, I will murder them all. :-D
I've decided to stop wasting my time responding to AC trolls/sockpuppets... so if you want a response from me... login.
When it has two functions, written by two different female programmers, that call each other recursively.
...not having your fucking article spread across 9 pages with about one paragraph per page. That would be a great start!
It communicates clearly what it is trying to do.
It doesn't, actually. Looking at that as someone who doesn't know what a CRC32 is I have no idea why it's doing what it's doing. Some actual useful comments might be nice.
After 5 years you can still read it and understand what it was supposed to accomplish, and it does so.
Good code starts with the right language for the job and the developer, then you have to follow the best practices for that language. How I program in C# and PHP is far different from how I program in C and ASM. The one thing that doesn't make code is abundant use of catch phrases.
not to be confused with code that sorta looks like it, but surely doesn't smell like it...
if this is supposed to be a new economy, how come they still want my old fashioned money?
Could be less than 27 lines, D-.
void crc32_init() { for( short byte = 0; byte 256; byte++ ) {uint32_t crc = (uint32_t) byte; for( char bit = 0; bit 8; bit++ ) ...ann so on
I would definitely add "simple". Everybody can write complex code but it takes experience and great knowledge to be able to choose the best fit for the implementation. More experience and knowledge you have more options to choose from. Beginner will usually go with the first hunch that will get complex sooner or later as he will meet challenges he didn't expect...
So yeah, simple, readable, documented, functional, consistent...
Well, I've got to get back to work. When I stop rowing, the slave ship just goes in circles.
And this is why closed source combined with black-box development is so much safer than open source. Sigh.
I really don't mind -- actually, I think I'd be kind of of flattered -- if people were able to look at my code, go "hey, I can use that" and then proceed to use it. And in fact, I've written a fair bit of code I think would fall into that vein. I think I could write something book-length in the line of "cool coding stuff" and quite a few programmers would find it quite useful. I've been doing this since the early 70's. I write signal processing, and image processing (but I repeat myself, sorta) and AI code, with a strong background in embedded and special-purpose systems, a bunch more.
But because a lawyer might look at my code, and use it to screw me, and through me, my family and employees quite harshly?
Bang. Closed source. The opposite of furthering progress by virtue of passing along what I've learned. I give away some of my work product such as this, but you will never see my source code because of the legal environment.
As far as I'm concerned, if I wrote it without referring to "other" source code, then no one else has any claim on my work. I don't have any idea how to fix copyright and patent and still retain the supposed commercial motivation to create, but fact is, as it stands, it's completely fucktarded.
Pisses me off, it does. :/
I've fallen off your lawn, and I can't get up.
No one's even mentioned the Bechdel test yet.
You only wrote the code I asked for to meet my requirements.
If it's unique code, you did NOT write it to fix every possible future use of said code.
If it's not unique code, and it's something we already have a library for, you used that library, correctly, and didn't reinvent the fucking wheel.
You followed our coding conventions (regardless of how arbitrary or silly they are) and did not suddenly start your own coding convention just to be different.
And most importantly
You covered your code 100% with FUCKING TEST CASES that actually work, and pass. This obviously means that you also wrote the code to be testable (no methods with 5000 lines of code in them, and 30 input parameters).
_When_ was the last time you actually needed a different CRC function from the standard 32-bit one?
When trying to create unique crcs to use as hashes for 8 billion pieces of data daily so as to find them quickly. 32 bits isn't enough. 64 bits is way more than enough.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Seriously. Good, readable names for everything make code far more self-documenting than otherwise, don't cost the compiler a single cycle, and make it far easier to understand when someone comes across it five years down the road.
Other than that, I'd add methods that only perform one action, with no side effects, and that only work at one level of abstraction.
Finally, code that matches its method name - don't say "if thing.checkValues()", say "if thing.isValid()" - and if isValid() does anything like trimming whitespace it should do it on its own transient copies of things, since its not obvious that the method would ever change state.
And so on. It all boils down to code that doesn't surprise you.
You're special forces then? That's great! I just love your olympics!
For me the big thing is documentation. Whether it is my code (from the past) or someone elses, I need to know what it is doing, what it is supposed to do and why. The best thing I can hope to see in a source file is a lot of clearly written comments.
Having code that does error checking and throws clearly defined errors is nice too.
Good code has documentation for knowing what it should do, and has unit tests to verify that it actually does that. If there are any problems good code can be modified to meet the (possibly changed) requirements better, while unit tests ensure the modifications do not make the code worse. Code which cannot be modified is not good code. It's that simple.
I don't care how bad or tangled the logic but as long as it's not using Hungarian notation, It's good.
Harrison's Postulate - "For every action there is an equal and opposite criticism"
There needs to be a compiler (not language) that can convert mathematical proofs to an optimized assembly listing. How it would work, the files it would take in, and who would use it - I don't know.
That is a fairly typical CRC setup. Make a lookup table. Use that table to 'and' and 'power' with in a loop across the input data.
It is done that way to speed up the computation. CRC is a fairly common operation so it has been optimized over the years.
Someone who has never made a CRC function before? Yeah it probably looks like gibberish. As it is pretty much polynomial math with some optimizations.
Whomever made it should have put a comment they were using the optimized version and what the original function was. The original function is probably much more readable. But MUCH slower (if I remember correctly ~40x slower).
Library code is often like that. It's mostly a result of having to work on multiple compilers, and multiple versions, and numerous language options and versions. Also CRCs aren't limited to 32-bit, and the library handles general cases. Library code is different to program code. Your code isn't suitable for a library. The error handling, for example, specifically uses printf, where a library would return an error state, or, in the case of C++, throw a standard exception. This is because someone might not want to use printf for errors. So here's my code:
#include <boost/crc.hpp>
typedef boost::crc_32_type crc_type;
I think you're comparing program code to library code. The only way you'll get elegant library code is if it only works with one version of a compiler, using one version of a language, and with a single set of options. Otherwise, it's lots of engineering to cope with quirks, and macros galore.
Their whole mindset still makes me want to puke.
Obfuscated crap. Techno-machismo teens playing games trying to get their code into the least number of characters and the least amount of memory. I've had to fix or test so much of this junk and it's still just plain stupid.
The *human* part of the system is what *matters* and that includes the code interface. First, I want comments not about *what* is happening. I can read that. I need to know *why* it was done, so I don't undo it, or I can do something different safely. Comments should be one liners, limited to "why" and sometimes "how".
If adding a variable aids readability, add the fucking variable! Shove all the results into a meaningful, readable variable name and then shove *that* into your function argument, not some long series of nested function. It's not the 90s. You don't have to save memory! Memory is there to make your code readable. Use it!
Ok, rant over. I'm going back to work now.
Please do not read this sig. Thank you.
One of the most important criteria is that good code be easy to modify. Readability, testability, elegance, and simplicity all lead back to that. When you change code, you should be assured that it will do what you expect. Bad code produces surprising side effects when you change it. Good code warns you (possibly through unit tests attached to the code) when you are doing something questionable. If you have to run the code to determine what it does, then that's not good code.
Needs evolve and change over time (or simply become clearer). Good code needs to be able to follow.
Good code does exactly what it needs to do, no more, no less. It does everything in the simplest, most obvious way. It should be possible to cover every piece of business logic with tests (if not, why is the logic there in the first place?).
Combined, these traits should make it possible to refractor across the entire codebase when somebody else has to add something new. You can't anticipate everything, so don't add complexity up front to deal with a possible future which may not come to pass - focus on making it easy to make changes.
Spaghetti code is good.
With lots of meatballs.
Have gnu, will travel.
and how would the compiler read your proof? it has to be in a compiler readable language.
Windows = hugely dominant on PC + Server platforms worldwide for decades (before there were smartphone toys) so until you can show otherwise you're full of it. C & C++ are also hugely used in the *NIX world for decades before it as well before there was PHP or Java. Thus, when a language is used for so much longer and on so many things, it's going to have more users of it since that's where the money is to be made. Period. Your illogic logic astounds! It's hilarious seeing bs come out of some youngster like you that thinks he knows it all and only showing us he knows nothing since he hasn't gained any experience or wisdom yet (as is the case with youth).
Coding a prototype of something that's rapidly changing in huge ways should be done differently than production code that's worked on by lots of different developers. One will not be optimal for the other.
In debates about Christianity, there are two groups: those looking for answers, and those looking to just ask questions.
Code is good when the data structures clearly model the problem domain. The algorithmic code / control flow then follows naturally and is easier understandable.
Take all work you've written and entrust it with someone who will publish it a few years after you die and after your estate is settled or a few years after the last company that would have any claim to it ceases to exist, or after any copyrights or patents other than yours that apply can reasonably be presumed to have expired (probably 95 years after you wrote the code), whichever comes later.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
The Wayback Machine...
Or, see the Slashdot article, "Beautiful Code Interview" that discusses an entire book about the very topic.
"Made in India".
I agree with most of the earlier posts, but the main thing I look for is conciseness and clear & consistent naming of variables. If your methods/procedures/classes/functions/subroutines are are obnoxiously long, it makes it less readable, harder to test, and just longer to debug. Modular design also lends itself to be more reusable. I've always been of the mindset to name your variables what they are. You shouldn't have to go to a comment or read the code to see what it does. It should speak for itself - even for someone who isn't super familiar with your code/project. Or at least that's what I think...
There needs to be a compiler (not language) that can convert mathematical proofs to an optimized assembly listing. How it would work, the files it would take in, and who would use it - I don't know.
Mathematical proof is only a tool the arithmetic optimizer can use, it's not something that you can generate code from.
Most of the time it doesn't work, because the compiler has an obligation to follow the ISO/IEC/IEEE 60559:2011 standard and mathematical proofs that takes intermediate rounding into consideration is complicated.
Yanno, it's been years since I've coded (beyond looking thru code to tweak a definition here or there anyway). Decades, even.
But I was taught on the job that range checking of inputs and boundary conditions was essential to reliable code.
Obligatory XKCD reference.
I can see the fnords!
When it is done by people, code can be art sometimes. I have no good example immediately available, but I mean there is a huge difference between generated code such as jquery-1.11.2.min.js and code that can be read by humans. By optimized, I mean the lowest time and space complexity during run time. And there are basic and obvious maintenance constraints that everybody should follow like avoiding hardcoded values (unless necessary), keeping it easy to read, avoiding +1000 lines routines if not necessary, ...
Regarding debates on comments vs self explanatory variables, I have no opinion on this. Depends on how it's done.
Library code is often like that. It's mostly a result of having to work on multiple compilers, and multiple versions, and numerous language options and versions.
And most of all, they aren't used just once, so there is a reason to go back and clean up and clarify and optimize.
For a lot of other code you write it once and forget. As long as it works there is no reason to go back and tidy up the code.
does it do something you need done that has not been done before, or has not been done before as efficiently?
too many people reinvent the wheel (which is why linux on the desktop is always such a huge fucking mess and will never challenge windows or mac in that arena). when something works, and it's available to use (via licensing), then use it. don't run off and do all the work all over again, or fork the shit out of it.. just use what's already there if it does the job you need done.
Clean, elegant code doesn't handle real-world conditions where exceptions, workaround, and hacks build up over time. "Bad" code is usually battle-tested and bullet-proof code that has been deployed in the real world and has built up screen after screen of special conditions, hacks, workarounds, exceptions, and so on to handle the conditions encountered in the wild. So good code at least has comments explaining why each hack is in place and what it works around and what problems it solves.
You know your code is good when other developers use it with out feeling the need to rewrite it. As a software manager I find that an important trait of a successful developer is having the discipline to program to an existing interface. Cleanliness (in C++ formatting, static analysis, correctness, properly sized methods) are all important. Isolation from hardware and unit tests, are IMHO, paramount. I actively weed out the cowboys who suck all the oxygen out of the air and rewrite everything. Also, I find outside of driver development, tend to EE's make lousy developers.
Good code does one thing well:
It communicates clearly what it is trying to do.
Personally, I'd say that good code does what it is trying to do. Great code will do that and communicate what it is doing clearly.
Code has to be AVAILABLE - this is the most important. That means it must be OPEN SOURCE.
If it is CRAPPY code, it can be MADE BETTER if it is open source.
If it is INEFFICIENT code, it can be REWRITTEN if it is open source
If it is HARD TO UNDERSTAND code, it can be COMMENTED if it is open source.
So any code that is OPEN SOURCE, even if it is crappy, inefficient and hard to understand, can be improved.
But any code that is CLOSED is absolutely useless in my opinion.
... functional, readable, testable ...
From the maintenance perspective, when you can't make the code meet some standard, comments describing what you missed and why (time, spec conflicts, didn't care enough) are helpful. This hints to the next maintainer that modifying a piece of code that missed some good-practices target has additional considerations or hidden pitfalls, or that it can be fixed/extended/replaced with impunity.
Good Code
'Nuff said.
What are qualities of a good movie? What are the qualities of good art? How about what's good music? Nobody has been able to come to conclusions to whhat the essentials of goodness for any of the above are. Why would good code be any different?
"Good" is inherently subjective, and will vary highly. You can phrase the question: "What do YOU think good code is?", but there's no general answer
You skipped the case in which it's not unique code but for which you don't have a library.
What the hell is this?
Why is there a block comment at the beginning that does nothing... and what the hell does that trailing comment mean?
The best code must have something that is very special - although all good code should look simple and even boring to those not paying attention.
Good code has comments for edge cases, I mean "why the fuck are you checking if foo is less than bar?" with "//checking if foo will not overflow because ..."
Edge cases are by definition very unlikely, usually the code that handles them are bugfixes. Too many times I come across code that is full of bugfixes for those edge cases but no comments whatsoever, to me those kind of comments are more important than method comments (aka javadoc).
It doesn't, actually. Looking at that as someone who doesn't know what a CRC32 is I have no idea why it's doing what it's doing. Some actual useful comments might be nice.
Well said. Also, not using Hungarian Notation in the variable names would also improve its readability.
Every line you add increases your maintenance burden.
If you need a 64 bit hash, write a special 64 bit hash function. It's only going to take a few lines, and removes dependencies on bizarre external code, like 64 bit CRC that nobody ever uses.
Besides, CRC functions aren't very good for hashing, as CRC(x) XOR CRC(y) = CRC(x XOR y)
Over-commenting is a very real problem, and CRC32 is CS101. If I was reviewing code which described what CRC32 was, I would remove the comments.
He was saying good code communicates clearly, not the code above.
Also, you don't really write comments in code unless it's doing something unusual. Comments are for WHY something is being done, not what is being done. The what is already explained by the code. You don't know what CRC32 is because you don't need to (and that's ok). If you were in an industry or hobby where you did, you would know because CRC32 is pretty ubiquitous.
Computer Science is [a] a misnomer, and [b] more properly a subset of mathematics. I might characterize it more as giving you tools to reason about code rather than teaching coding practices. It is not generally meant to be a practical education. There is always time to learn the practical stuff, and the practical stuff changes often enough that it's not necessarily worth teaching.
I'm in the opposite camp: I'm self taught, and know a bunch about deployment and the intricacies of source control, and refactoring, but very little about, oh, algorithmic complexity or parser/compiler design. The theoretical stuff isn't quite as useful on the day-to-day as the practical knowledge, but it's much more useful when trying to learn new things. Similar to how you don't necessarily need music theory to play guitar but if you want to transpose a piece of music or pick up a new instrument, it would be pretty useful. Composing a piece of music might be more like writing a compiler. In both cases you'd be relying heavily on theory.
If you thought you were signing up to learn how to be a programmer, you've made a mistake, but it's not so bad as you think. The stuff you're learning is useful, even if it doesn't seem like it. I feel like I could stand to know quite a bit more about it myself. And the lesson is, that you need both parts, and you'll miss whatever you don't have, but you miss the practical stuff all the time, and the theoretical stuff only when it's really, really important.
Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
When one has to wade through a "slide-show" presenation, intended to maximize page clicks/ad revenue, instead of just reading an fricking article.
And this is *after* being presented with a 20-second interstitial ad.
BLEAGH.
Absolutely. Thanks. CS and Programming are fucked.
Nobody in power to actually improve the situation seems to understand that current programming practices and goals, exacerbated by the usual management stupidity, results in a continuous spiral downward of code quality. security, reliability, maintainability, etc.
You cannot achieve the impossible, and aiming for it, and requiring it, simply means that defects will be hidden, often until they can cause the most possible damage.
The profession and industry desperately need broadly applied engineering practices and requirements. Including licensing. Will never happen, because too many coding cowboys and lucky CEO's of tech companies think their shit don't stink.
The first thing is, most of us are coding as house painters rather than as Rembrandt. So it needs to do the industrial job. I tend to put as much effort into documentation and style for my personal code as for working code.
If the code is for a micro-controller in C then the emphasis might be more on raw efficiency and preciseness. A command line utility run ad hoc with low resource usage can afford to be a little less efficient and more readable. Code for an online transaction system needs the efficiency, perhaps as a tradeoff to readability but in most cases hopefully not.
I have written code and products and have had to go back to stuff I wrote 15 years ago. So I learned a long time ago to document as clearly as possible for the poor sod in the future (i.e. me) who will have to come back and make sense of everything. Mostly I succeed here but sometimes I fail.
I also supported other people's assembler code for a few years. That provides lots of what not-to-do's.
If you are coding examples for a book or website then the rules and aesthetics can be changed again. Maybe think more Rembrandt here.
Functionally, document everything, use meaningful and consistent naming conventions, catch errors, log, provide trace capabilities where needed, be as generic as possible and think about reusability but don't obsess over it (depends on the context as always).
Elegance.
Well in this case I'd say there's Google and Wikipedia, use them. The source code is not the right place to teach someone about what CRC32 is or when, where or why you might want to use it. It's almost as bad as comments that try to teach you the programming language you're in. If you're implementing something that's not in an RFC or standard of some sort, I'd agree with you.
Live today, because you never know what tomorrow brings
When it passes the modified Bechdel Test of course.
Tooooo many points of uncommon good practice to mention.
Document interfaces and algorithms, but don't over-comment.
Make public headers CLEAN and with 100% correct descriptions. Do not put private declarations in public headers (I see this all the time and I hate it).
What else....
Decouple program flow code and data declaration code.
Be CONSISTENT with names and tabs and formatting.
Emphasize structure of DATA over structure of code.
Don't unnecessarily copy data around or duplicate things.
Don't re-define the language via macros.
( Can you tell I'm a C programmer ?? )
CRC32 is CS101
Bullshit. I have never heard of CRC before today. I understand it and see why it's important, but it certainly didn't come up in CS101.
There are several metrics which can help you to identify code which is not bad. One is cyclomatic complexity. Another are connectivity metrics going over the graph your code spans. For cyclomatic complexity there are good boundaries available. However, it is a complexity metric. And complexity is not the only thing which affects code quality. Other elements are labeling operations, such as methods, functions, and procedures. There is plenty of lit. available in the area of code comprehension.
It's a trick question. There is no good code.
What's the server to PC ratio? Let's say a few million to 1 (it's huge): What runs the most on PC's? Windows. I've seen stats showing it's about a 50/50 split on servers vs. *NIX variants (who have to be lumped all together to compete with Microsoft products). See subject. No spin is possible vs. hard fact.
https://xkcd.com/844/
Eom
CRC's were in my first year of CS, in 1996.
I'm a minority race. Save your vitriol for white people.
DUH! Is there any other way do judge the quality of code then through the eyes of the hardware executing it?
If I was reviewing code which described what CRC32 was, I would remove the comments.
Well, you are Doctor Evil.
"First they came for the slanderers and i said nothing."
You can see it on Netcraft's "what's that site running?" -> http://toolbar.netcraft.com/si... & for showing what academic institutions run what (that could also be done for the Fortune 100/500 & really *ANY* type of servers out there).
I've used here a few years back to see for myself:
http://news.slashdot.org/comme...
& yes, to prove that very point WITH VALID DATA FROM A REPUTABLE SOURCE (2 of them, CNN list of Fortune 500 + NetCraft)...
All that happened vs. it was downmods and ad hominem attacks (the last resort of "defeated trolls", lol, & invalid proving my points all the more).
It works & since you demand it? Take a look for yourself there... get a list of the Fortune 100/500 & see what you see nowadays I suppose. That's only on servers though. There's millions of PC's out there vs. servers. What do PCs run the MOST (94++% of them worldwide as a KNOWN fact? Windows!)... you can't win on that note alone.
Facts used that way work, & I've used that before here, to shut fools up on that very account + face it: The ONLY real reason say, Linux, gets used, is to keep per unit costs down (on servers AND smartphones)
+
Face this about that much: ALL THOSE YEARS OF "Windows != Secure, Linux = Secure" is falling apart around your ears here - ANDROID, yes a Linux, proves it for me (& I love it + hate lying bullshitters/deceivers - not because I hate Linux, I don't & ADMIRE it actually as a socio-technological phenomenon that proves folks CAN & DO work together globally doing nice things for free).
You bullshitters don't realize 2 things: Your deceits shoot you in the foot, I make SURE it does (lol) & you can't EVER ever get the best of me - you don't HAVE what it'd take in truth & facts.
APK
P.S.=> However, the "noobies" inexperienced youthful stupid view here isn't aware of the fact C/C++ have been hugely successful on ALL platforms and have gained a gigantic following & momentum that other languages just do not have since time + success will do that for me (selling itself better than bs & "pr spin" that goes on around here like mad, lol, that's for sure ala my "Linux = Secure, Windows != Secure" b.s. that went on here for years)... apk
If the code has a useful function and exposes it with an interface that is no more complex than absolutely necessary, it doesn't matter how ugly it is inside. It will be used and, in time, there will be resources to clean it up. UNIX system calls, libraries and command line tools are a good example. There is not much in common between original code and various modern implementations, but code written on top of these over decades still works and both developers and users are able to leverage their experience.
Also, even the best written code will have bugs. With simple interface, it's at least feasible to write good tests and find some.
A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupéry
Escher was the first MC and Giger invented the HR department.
FACT: The PC to Server ratio is MILLIONS to 1 alone
This does not stand to even 5 ms of thinking. I am living in a country with 5 million people. You are claiming we have 5 servers or something like that.
Or if you are an american: How many cities do you have with more than 5 million people? How many cities with more than 5 servers? ...
Or ... there are about 7 billion people on the earth. Lets assume that each have a PC (many don't). You are claiming there are only 7000 servers on earth.
Servers running Windows vs. *NIX variants (50/50 split) http://news.slashdot.org/comme... with reliable data from CNN & NetCraft + the # of PC's running Windows vs. all others recently found (recently enough, 2012) & I haven't seen any different... you're free to check though yourself using that same data, it's all there for that much (some might have even changed in your favor, especially in the Fortune 100/500 since "money talks" & the very thing that makes Linux the MOST appealing is that it costs nothing UP FRONT (till support becomes a nightmare issue that DOES cost more typically than Windows since not as many folks are as proficient in *NIX as in Windows, since not as many run Linux vs. Windows). Common sense & fact ALWAYS win (especially when I back it solidly).
ANY FOOL KNOWS WINDOWS *IS* MASSIVELY DOMINANT ON PC's - must I produce data on that too? It'd make a NICE "SIDE-DISH" FOR THE WORDS YOU & MightyMartian are ALREADY EATING (yours), lol...
ABOVE ALL ELSE HERE: Your 'sampleset' is not as complete as mine, you have not produced documented facts from reputable sources as I have, & ANY fool can try those 'spinmaster tactics' only to FAIL, as both yourself & MightyMartian have... period!
* :)
(Took me less time to shoot you down in flames & I was "demanded" by MightyMartian to produce that data, so... lol, why don't you join him in HIS DINNER of "eating his words" that he challenged me on producing such data & I did - I love doing that to fools, everytime, since they don't think I have it from valid reputable sources & I DO!)
APK
P.S.=> By the way: Change your diet - EATING YOUR WORDS != GOOD NUTRITION... lol! apk
Code needs to be easy to understand, that's all. You can't keep a long list of priorities in your head, that simply doesn't work at all. Just keep one: easy to understand.
Of course it needs to work, but that's obvious so not really worth stating - testable is part of this obviousness, if you need to test it, and you can't, well, then it doesn't work.
Sometimes code needs to be performant, but often this is only the case for small parts of it, so it's better not to think about it or it will tend to compete with making the code easier to understand.
I'm deliberately using the phrase "easy to understand" and not just talking about readability, because ease of understanding often doesn't not come from just superficial readability tweaks like spacing, consistent styling, self-explanatory naming, etc. Often it may require approaching the problem at hand from a different angle, modeling it slightly differently or otherwise shuffling things around a bit to reduce accidental complexity and avoidable dependencies.
Prove your words, prove me wrong, & take a course in statistics: Your anecdotal evidence fiction isn't standing up very well vs. documented facts from reputable sources I produced that "MightyMartian" (who shut up suddenly & you shows up SUDDENLY NOW ALSO, well, lol... "Gosh Golly Gee" - you his 'sockpuppet support to the rescue' or what?) shut up quickly vs. it.
I even GAVE YOU THE OPPORTUNITY to prove me wrong, check the data I produced yourself as it *MAY* have changed some (maybe even in YOUR favor, but I doubt it in only 2++-3 yrs) - you can't or rather I suspect WON'T (since you & he probably have finding it hasn't changed in your favor).
* Keep name tossing - hell of a way to prove your point.
APK
P.S.=> Now, when I do it it's only a statement of fact since you're proving yourselves bs artists & 'spinmasters' that aren't even GOOD @ IT, lol (because it's truth & verifiable, undeniable, concrete FACT I use, especially when it's demanded of me vs. a pack of loud-mouthed "Open SORES/Pro-*NIX" morons that shot their mouths off demanding I produce valid data from reputable sources & I DID, shutting you all up, forcing you into the ONLY thing you know how to do in illogical off topic ad hominem attacks, attempting & FAILING @ attacking myself, rather than my points? Your flaccid nature BETRAYS YOU, & I know it always will - I know you ALL, better than you KNOW YOURSELVES... "Know thy enemy" & destroy him with it works... you prove that for me in fact, lol...)
... apk
A single reference to the literature would have been better. Most of the other comments would then be redundant. And even someone who knows C++ but not CRCs can easily review the code.
"Eat your words" http://ask.slashdot.org/commen...
* :)
(Tell us - how do they TASTE, flavored with your bullshit vomit mixed in, spiced w/ the BITTER taste of "SELF-DEFEAT", & your foot in your mouth RAMMING IT ALL down your throat?)
I'm primarily a Windows programmer (since 1994 professionally) & yes - I've worked on most everything from mainframes/midranges, into the Client-Server world using BOTH *NIX variants + PC's (often as a full-blown network-wide admin since I can't DO my job fully unless I'm not & before being a programmer I was a network tech & admin too - can't DO the job that well, imo & yes experience, unless you run the FULL gamut).
APK
P.S.=> IMPORTANT: You just *MAY* be young & inexperienced, talking out your ass, with a LIMITED sampleset... & it sounds like you're working in companies with 'specialists' that don't have a lot of range OR experience...
So, my busting your nuts?
It's more vs. the result of the LACK OF RESULTS I've seen vs. pure bullshit spouted here vs. that links facts from reputable sources & a wide range of data from government, educational institutions, & Fortune 100/500 data proving your words incorrect (yes, includes you too BUT I think YOU may be victim to "believing the HYPE" that gets VOMITED AROUND THIS SITE LIKE NO OTHER I've ever seen online... THAT may NOT be YOUR fault, but take a lesson from it I suppose... don't believe the hype, from fools that picked a FAR LESS USED PLATFORM on PCs & Servers only to see it can't displace Windows there (same with competing less used language users vs. C/C++ too))... apk
R. Pirsig wrote a paper on the philosophical and mental challenges in defining "quality". I suggest reading it.
Dewey, what part of this looks like authorities should be involved?
1st: I never said "ever" (don't put words in my mouth I never uttered) & take a read of documented, concrete, undeniable & reliable data from BOTH NetCraft & CNN vs. your words http://ask.slashdot.org/commen...
*:)
(That's valid data from 2012 by the way, only what? 2-2.5 yrs. old or so?? Pretty SOLID evidence is what was demanded of me, I produced it... I see none disproving, & thus, I "rest my case"... some fictional anecdotal bs I shot to pieces easily, with statistics facts too (which I also took in STAT I/II since anecdotal evidence is frowned on AND with a fictional dataset one fool produced he can't backup as WAS DEMANDED OF ME no less & I did so from valid sources, with his LIMITED & yes, lol, fictional pseudo-'dataset'... pitiful!)
What I found FUNNIER?
These guys spout "logic" all the TIME here (how many I wonder HAVE actually taken formal logic? I had to in my CS degree work... well, how come they use illogical off-topic ad hominem attacks vs. my facts, attempting to "attack me" & failing right there, since they're unable to disprove my data??)
ANSWER = flaccid worms shot down ALWAYS betray their TRUE nature as weak effete worms...
What else proves it? Ok - for SUCH A SITE WITH SUCH "Freedom of Speech" fans on it I see here quite a lot? WHY do the use downmods vs. that data when it's demanded of me & it shoots them ALL down in flames -> http://news.slashdot.org/comme...
Hmmm?
ANSWER AGAIN = they're bullshitting liars that WILL do *anything*, including spouting MASSIVE DECEITS & downmods to "hide" truth & fact that doesn't suit their OWN failing agendas - so much for "FREEDOM OF SPEECH" in s system of "moderation" that gets MASSIVELY ABUSED by sockpuppeteering bullshit artists... prove otherwise.
I can with valid results & proof yet again (especially when it's 'demanded' of me, & they can't!)
APK
P.S.=> You'd best rethink your words, & consider NOT saying them so quickly - never know WHO you're arguing with & what they are aware of + what they can use vs. those words of yours as I have (fact & truth are the greatest weapons in debate + knowing thy enemy & knowing thyself I have found @ least) - PLUS, in the end? I truly *think* MOST of you have been outright DUPED into believing the "wannabe experts" around /., who as you can see in the case of MightyMartian & others, are being SHOT TO PIECES by myself, easily - don't believe their "hype" bullshit - seriously: DO YOURSELF A FAVOR ON THAT ACCOUNT (and yes, I can state that - I haven't seen them prove me wrong with valid data from 2012 & I don't think it's changed that much IF @ all, & probably NOT in favor of Linux)... apk
> What the hell is this?
The 8th entry is set to zero so that the test can verify the table was initialized properly.
> 4))
> Why is there a block comment at the beginning that does nothing.
For alignment of CRC32_REVERSE, CRC32_VERIFY, CRC32_Table since /. fucks up formatting.
> and what the hell does that trailing comment mean?
The comments lists entries [0] and [1]. The first 8 entries are these :
i.e. 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
Whenever you generate a table it is always helpful to list _expected_ values so someone can _verify_ them with _actual_ values.
Yeah, I forgot to include
I wrote a 64-bit crc function, and it worked fine over billions of records of random-length text, was extremely fast (written in c), only required 8 bytes of storage, and was thread-safe.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
When you read the code and say to yourself "God, I wish that I wrote that".
Take a read http://news.slashdot.org/comme...
* Data's pretty recent (3 yrs. old ALMOST to the day) & from reputable sources as was demanded of me by MightyMartian (shot down in flames & shutting him up...)
APK
P.S.=> Thanks for being @ least SOMEWHAT fair (though YOU TRIED PUTTING WORDS IN MY MOUTH I *NEVER* ONCE SAID) vs. these bullshit artists here on this site...
Oh, I can tell what they're going to do next (just like they did in that link above) - downmods!
(It's always the "last resort" weapon of the WHIMP troll as always since I know they better than they know themselves - too bad most here browse below the bs moderation 'threshold' & see facts I use anyhow vs. their bs):
DOWNMODS & illogical ad hominem attacks is "the best they have" vs. "yours truly", every SINGLE time & from such "champions of free speech" too (another thing I see here quite a lot & it's bs demonstrated right there alone with fact, again) - they're the BIGGEST ABUSERS OF IT THERE IS with sockpuppetry galore (to 'support themselves', lol, only shooting themselves in the foot doing so vs. facts) to mod their own posts up that are full of bs which I have demonstrated, AND to downmod those they CANNOT GET THE BEST OF... apk
All this other shit is useless unless:
* the way the problem under solution is broken into solvable, understandable pieces is well chosen. Make a bad choice here and your code blossoms in complexity and fragility.
* naming and spelling is consistent. Don't show me code that has shit like "frobURI()", "tweakTheURI()" and "makeUriPretty()". Components of names must be consistent. 'do', 'get', 'put', 'fetch', etc. must always mean the same fucking thing.
When with a few tiny changes you open up whole avenues of functionality that hadn't been conceived before. Sometimes you get that and it gives me immense pleasure. It opens up potential your code didn't have earlier.
Am I babbling or does that ring a bell for anyone?
Code should be symmetrical. For every "put" there should be a "get", etc.
Good code doesn't allow submissions from people named Bennett. Great code uses a browser location API, exploits vulnerabilities in UAV control protocols and takes aggressive action.
There are many axis for rating software. One of them is how easily a newcomer can contribute. It measures simultaneously code clarity, architecture choices, software usefulness (who wants to contribute to something useless?), maintainers mindset...
See subject: That's the "best ya got"? It ain't much vs. fact-> http://news.slashdot.org/comme... from reputable sources, now is it? Nope... lol!
* I'm a fan of whatever works & that doesn't have a pack of spinmaster trolls spouting lies, trying (& failing) your "seize the youth & seize the future" easily destroyed by verifiable facts (as I used) from reputable sources!
FUNNY you're all "dead silent" vs. the data in that link, eh? NOT!
(Man, if you're going to pull your 1/2 truth + lies B.S.? BE GOOD @ IT at least - you're not, see the results vs. what's in that link above after all as my proof thereof) trying to deceive others with bullshit propoganda they can't backup validly OR being able to disprove what's in the link above (when I posted it in 2012 vs. you "Pro-*NIX fanboys"? You downmodded it - truth & facts aren't "real big" here on /., now are they?? Nope... just bullshit!))
TL:DR? Yea,right - it's not MY fault you need "Hooked On Phonics" & have a brain-damaged "ADD/ADHD" brain!
APK
P.S.=> Love how you all spout "LoGiC" when what you really use, especially when you're shot down in flames, is ILLOGIC LOGIC (hence your weak failed ad hominem attack, snide b.s, & what-not vs. what I have)... & as far as "taking me seriously", Mr. weasel? When you've done MORE, & BETTER (+ earlier) than I have in the art & science of computing (such as a commercially sold code to my name, having my wares place as a finalist @ esteemed tradeshows like MS Tech-Ed, 2 yrs. in a row in its HARDEST category, SQLServer Performance Enhancement, being in books, newspapers, trade magazines, & more MANY times? THEN, you can talk the way you have to me, as a PEER... not a bullshitter off topic destroyed by REAL logic & facts troll... m'kay?)... apk
See subject: Quit projecting your own issue & get on topic also... m'kay?
APK
P.S.=> You have FAILED vs. this http://news.slashdot.org/comme... & you know it, I know it, & so does anyone else with 1/2 a brain even... apjk
The best code is code that when you have to go in to make a change, was built in such a way that new features just slot in nicely, with little rework or fuckery. I LOVE when code I built previously means what someone thinks will take me 3 weeks takes me 1 hour (billed at 2 weeks)
Can you honestly expect to get a worthwhile answer to this question on Slashdot?
Wouldn't it have been better to ask people to link Git repositories with examples of good, clean code instead? Better yet, make a site which allows people to link a repository instead and explain why that code is either good or bad. Let people vote as well.
I can show you massive portions of the Linux kernel tree which is both good and bad. Good because it's functional, tested and works well. Bad because it was ransacked by the spaghetti monster. Want a great example?
https://github.com/torvalds/linux/blob/master/lib/glob.c
This code is fantastic because it is rock solid and has been tested to death. It's even relatively clean, but while some people can actually use it, maintaining it would be nightmarish due to lack of documentation. It's documentation isn't entirely awful, and I really wouldn't say "replace it because it's not pretty", but it's code is simply not pretty.
It also has to be handled with care. It makes assumptions that the parameters passed are proper. Used improperly, it can cause overflows. There's no real error handling or bounds checking. It's not what I would personally call "secure code".
But it's great code all the same.... if called from a function which ensures what is passed is valid.
The best piece of code I ever wrote in my life was nearly 100x faster than the next best algorithm ever written to do that problem. That took the expected run time down from a few days to an hour.
It was not a particularly well-commented piece of code. If it were, it would have been even better.
It was not a particularly obvious algorithm for solving the problem. If it were more obvious why one would choose to do it this way, it would have been even better.
If the primary concern is runtime (because it normally takes days to run), and you literally make it orders of magnitude faster, that's good code. It could be better if it were also better commented and easier to maintain, but those aren't *always* the primary concern (yes, sometimes they are. That's the point -- criteria differ!)
[TMB]
What is missing is the word 'design'. You may comment why you made a design (or write a paper on it). You may understand the design by reading the code. If you don't it is either too complex (because there is a possibility to write the same functionality with the same complexity with easier-to-read code) or you need to explain the design for it.
nosig today
How about: it's bug-free?
licet differant, aequabitur
Now that's a tool which really helps producing great code. If you don't know this one yet, give it a try. But don't look at the code in anything different than X32. You have been warned.
And yes, this tool is actually being used for safety critical code (SIL3).
In my experience, no matter what kind of code you write, there's always people who think you've done it wrong. Always.
Composing a piece of music might be more like writing a compiler. In both cases you'd be relying heavily on theory.
As for composing music, I disagree that it relies heavily on theory - and I have composed quite a bit of music. If you want a good composition, then just come up with something that sounds good (duh!). My point is: this requires no pondering of theory whatsoever. Of course, what sounds good to you is affected by what you have grown up hearing, but if that consitutes 'knowledge of music theory' then the ability to walk is 'knowledge of gravitational theory'. Whether or not the composer is aware of the theoretical underpinnings of his composition is not very relevant, the audience will never know.
I personally view music theory mostly as descriptive of common structures in music, both harmonically and rythmically. Music theory does not say anything about what you can compose or play, or even what will sound good, it merely allows labeling it a posteriori. In most contexts, 'music theory' is effectively equivalent to, or perhaps a subset of, 'music nomenclature'.
Much music is composed by re-using ideas typical of the genre, but is that applying theory or just imitation? I think it's the latter. People will rarely like music that is 100% novel (i.e. very unusual). It makes much more sense to most listeners if you take e.g. 10% novelty over 90% familiar sounding stuff. If you do that, you'll sound quite original since any unusual stuff stands out so much.
In my experience, knowing music theory is most useful if you want to efficiently *communicate* to others what their parts in the composition are. Like: "Just play a I–V–vi–IV progression", or "can you play a son clave pattern on the kick where he lets that Bb7#9 chord ring?". There are of course many more uses of theory. E.g., it can help you improvise a solo over a certain progression while avoiding dissonant intervals (if you happen not to want those at that particular place and time). Very usefull in, say, jazz.
In summary: music is an art form, and in it anything goes. Music theory expands to include whatever strange ideas people come up with, so don't worry about it when you are composing.
The most importnant thing is simplicity high cohesion, low coupling and VERY rarely usage of design patterns.
Every new educated programmer sees the need for patterns everywhere- I did too.
But after learning to write good C code- I started seeing the light- design patterns have their place but that is not often.
My OOP coding skills have increased after ive learned to write good none OOP code.
Everything is not an object- and everything should not be, but it is fine to use it for coupling data together- like a struct.
Inheritance if used should be very very low in number of layers.
Seperation of Business logic and implementation details is also always a good goal.
Lots of comments about WHY the code does what it does- sometimes what it does- but if that is nessesary it is a sign that the code is not nice written.
Good code is a simple as possible, but no simpler. Thank you Einstein.
Perhaps he's been listening the that IBM guy from 1968.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
Yes folks, we have a winner. The referenced page contains nineteen, count 'em, trackers in just one page.
I think re-usability and properly formed and conceived libraries and classes if it's object oriented should be in there. I've seen plenty of people meet all 8 of those requirements, but have all their code in one giant file that really should be divided up into separate logical pieces that could be used again in other projects.
AS YOU EAT YOUR WORDS here http://ask.slashdot.org/commen...
* :)
FACT: The PC to Server ratio is MILLIONS to 1 alone, & what do 94.5++% (roughly) run worldwide? Windows... you can't win right there alone.
The ONLY true reason Linux is used in a 50/50 (roughly) split vs. Windows is it's "free" (up front, try it on maintenance/support) cost keep initial per unit costs down (funniest part's all the YEARS of "FUD" around here of "Windows != Secure, Linux = Secure"'s falling apart around your ears now since ANDROID, a Linux, is being TORN UP on the security front daily for more than a decade now... lol!)
* LASTLY: As was predicted by myself & other posts? DOWNMODS of my posts, totally unjustified (forget validly) to "hide" what you demanded, & you got, & it made you STFU easily -> http://ask.slashdot.org/commen...
You're predictable & I know you trolls better than you know yourselves - real Sun Tzu being used on YOU - Know thy enemy & know thyself - you will never lose in a 1,000 battles.
You're FAIRLY given the opportunity to check my data from reputable sources you demanded, as were others - my guess is you have & it hasn't changed much IF @ ALL in 3 yrs. (you fail on MULTIPLE grounds).
APK
P.S.=> I've already "Been There/Done That" & used it to make you eat your words in that link above - Evidence from educational institutions & the Fortune 500 ARE THAT EVIDENCE from reputable sources (CNN & NetCraft data) - funniest part? YOU "DEMANDED" I produce it, well, there you are... Change your diet - eating your words != GOOD nutrition, lol... apk
See subject: Does the job on you all easily enough http://news.slashdot.org/comme... shutting you down, easily ("too, Too, TOO EASILY - just '2ezily'").
Especially after MightyMartian "demanded" citations as I've seen he's wont to do via his posting history...
Well, that got put to rest & so did he, along with yourself + the other off-topic illogical ad hominem attack utilizing dolts who *tried* to use "fictional data" & his partial sampleset vs. what's in the link above... which, of course (since I know you fools better than you know yourselves), was downmodded in effete 'retaliation' since it's all you can manage when shut down...
Again - So much for the 'freedom of speech' mantra you bullshitters spout here!
Fact is? Man - you're the WORST abusers of it there is that I've personally EVER seen, & it's hidden from others as well so there's no confronting such whimps too (says much about the character of those that created this place in fact - yes, your GHOST comes thru in the machine when you write code, & as the saying goes? "I SEE YOU"... so does anyone else)).
* NOW GO & EAT YOUR WORDS... lmao!
APK
P.S.=> In the end? It's been a REAL PLEASURE knocking you boys right out, using what you yourselves demanded (proof from reputable sources) - you only did it to yourselves, as you always do, every single time you try it vs. myself... lol!
... apk
"My programming" http://start64.com/index.php?o... has advanced BEYOND your commands: BEYOND your weakness..." Quote from https://www.youtube.com/watch?...
(... & that weakness of yours is your inability to prove my points on hosts being superior to "the new hotness" (AlmostALLAdsBlocked by default, crippled intentionally + sold out to NOT do its job, & it only had 1 thing to do no less, & doesn't DO it very well, bolting on more bs to increase CPU use, RAM overuse massively, & messagepassing overheads...))
Of course, you "web 2.0" fools don't *WANT* people to be blocking ads - ESPECIALLY VIA HOSTS FILES! Those ads are your "raison d'etre", & they track + infect people like mad, plus steal bandwidth etc. we pay for as online users!
(Yes, "I see you", transparent's your FAVORITE COLOR, & I see right thru you attempting to 'further your own agenda' with pure bullshit... just like how I smoked you ALL with what you asked for - citation & proof from reputable sources!)
APK
P.S.=> Keep coming (what's the matter boys? "Cat got your tongues"?? Yes... but it's more you shoved your foot into your mouths to RAM your words you're eating down your throats in self-defeat - what's it taste like, washed down with the 'bitter taste of SELF-defeat", lol?)... apk
I offer Sendmail in its mid-1990s form as an example. We had several dialup customers with Microsoft Exchange servers. They'd connect and Exchange would issue an ETRN to dequeue waiting messages. The problem was that Sendmail by default, would send a "Warning: could not deliver mail for 4 hours" reply back to sender after the email had languished in the queue that long, and they dialed in sporadically and not at all on weekends so folks who emailed them would get these messages. It was bad. I wanted to disable this warning specifically for ETRN domains but not for everyone.
Does this feature exist? Sendmail documentation defined 'queuewarn' as a global setting but did not address this "deferred delivery by design" problem. Could there be a presently-undocumented or undiscovered workaround? Delving into the source it was visually apparent the answer was no, the warning was unconditional. The only workaround would have been to run a completely separate SMTP server on another IP address with the queuewarn off, and MX 'em to that. What a bother. Are domain-specific attributes available? Yes, these had a mailer flag of HOLD. Can it be addressed with a one-liner? Yes. So the _FFR_NODELAYDSN_ON_HOLD compile/config flag was born, off by default because we don't want to break things.
Just a couple of hours to discover, patch and test. another hour to render it into a contrib patch where it made its way into Sendmail. Open source is cool and when you see your own contribution being proposed as a solution to solve someone else's problem years later... that is quite satisfying.
Sendmail had the right balance of code-to-comment. What comments were there would not make sense until you understood the underlying process, and tag names were explicit enough that comments were seldom necessary.
<blink>down the rabbit hole</blink>
I don't understand the aversion you people have to comments. Comments help people understand the shitty code you've written. You may think it's great, but the rest of us don't, and your "clever" solution makes sense to no one but yourself. In the interest of the team, COMMENT YOUR F***ING CODE.
crc32 is the name of the algorithm. If you dont know what it is, what it is for or why it exists, comments aren't the place to describe it. Incorrect, misleading or unnecessary comments are worse than no comments at all.
Some actual useful comments might be nice.
Well, when the function is named calculate_crc32()...
Slashdot, fix the reply notifications... You won't get away with it...
You don't merit a +4 & there's far more PCs running Windows than anything else!
It will come up in your Comp. Sci. education.
If it doesn't you have really bad teachers, or a really bad school.
All good programmers should understand the basics of one-way-hashes.
public class paulaBean {
private String paula = "Brillant";
public String getPaula() {
return paula;
}
}
C/C++ are hugely used on all platforms vs. obscure bs you seem to favor (and yes, my data's REAL vs. your 'theoretical bs' blowhard) even MightyMartian, who brought us there, admits it (and I shut him up, as I have yourself, vs. the concrete, verifiable, & undeniable REAL dataset I put up, vs. your "phantasyland" crap that doesn't stand up to statistics as a valid dataset).
FACT: Since you nitpicked? Windows on PCs & Servers COMBINED (as I initially stated it using a "+" here dimwit http://slashdot.org/comments.p... ) stands a real statistical sampleset test (vs. your theoretical nitpick BULLSHIT, whimp).
You are a NITPICKING little BULLSHITTING done zero I can see of worth pud that I made "eat his words" like all your kind, online scumbags spouting bullshit.
APK
P.S.=> Last thing, for YOUR own sake: I'd wager you DO NOT toss names in illogical ad hominem attack frustration in the REAL world (if you did with me? I'd promise you 1 thing - I'd blast your FUCKING TEETH OUT for it - especially after eating your words here vs. real data anyone can verify, & YOU CALLING ME STUPID - since it's online, I don't HAVE that opportunity, so the data did it for me... you worthless little windbag - I've done things in the art & science of computing while I wager you were STILL IN DIAPERS you won't EVER manage - want proof of that too? Shoot your mouth off again, I'll make you eat your words on THAT too)... apk
"You are more stupid than a kid in first grade." - by bbn (172659) on Friday March 27, 2015 @07:17PM (#49358399) FROM http://slashdot.org/comments.p...
The # of PCs + Servers on Windows combined's > than Linux by huge orders of magnitude.
Additionally (per the ACTUAL debate here) - The use of C or C++ is huge on ALL platforms, so fools like yourself using obscure languages like Haskell and Scala which I see you seem to favor is also hugely outnumbered.
See below - THAT explains your illogical off topic ad hominem attack since I wagered you checked & found it's what I said which even rHBa agreed on PC client desktops Windows rules also by HUGE orders of magnitude (frustrated little *NIX noob that you are, & networking menial @ best from what I see in your posting history).
In fact, I LITERALLY gave you, & SUGGESTED YOU CHECK, all the opportunity using the very data I put up in 2012 to test it & you're running from that simple test: Actually, I'd say you looked and found it it's still much the same.
NewsFlash: I looked again for posterities' sake (Some HAVE changed in your favor by the way OR are a "mix" of both, but it's not by that much (from the list I provided of nearly 400 varied organizations in total)):
---
The sampleset data still shows tons more sites from the Fortune 500 (5 changed to Linux by the way but I am still way, Way, WAY ahead even 3 yrs. later), Government, and Educational Institutions running Windows or IIS vs. other *NIX variants combined... but I'm still ahead by roughly a 32 of 37 listed ratio.
29/30 of "best companies to work for" in that data also STILL use MS IIS & Windows Servers too!
The next 30 are STILL much the same as well in favor of Windows/IIS.
State Government offices (20/52 states) are same as they were too, using Windows/IIS.
Of 90 top universities tested? 3 changed but it's still hugely showing Windows Servers in place.
The remaining are also MUCH the same, in favor of Windows or a mix of them, only 2 changed that I saw.
* Feel FREE to recheck this yourself... by all means.
---
Linux does apparently get used as a load balancer in some (like CISCO, Compaq Tru64, & F5 Big IP) but the servers from my list for the web & otherwise ARE favoring Windows, hugely.
My point stands strong with valid data used from reputable sources (CNN & NetCraft) - yours? Pure fantasyland bs!
Smallfry cash-strapped STARTUPS *may* use Linux, OR the "new hotness" languages you're into (Scala/Haskell), since they're poor, but see here http://it.slashdot.org/story/1... & that *might* explain WHY they're attacked too possibly - especially via NOOBZ running them (young folks minus experience & wisdom that comes with age).
Still, UNLIKE you (moving the goalposts illogical bs from the ORIGINAL debate here, which languages are used most & where, etc.) - I have ACTUAL data that's verifable - NOT "fantasyland" bullshit like you & ALL the other dumbshit "penguins" attempted.
So "argue with the numbers" dummy, not me & your nitpicking bs isn't standing up to verifiable, concrete, undeniable fact you BIG MOUTHED LITTLE BLOWHARD!
Then again, tossing names when you can't attack my points & instead attempt to attack me proves my point you're an ignorant illogical imbecile!
Am I tossing names now, doing what you did to me? Absolutely - you, however, prove you MERIT it in return (what's good for the shot down goose, you, is GREAT & justified for me, the gander, asswipe...)
APK
P.S.=> In the end, it's YOU who ARE stupid & eating your words with your fictional invalid 'sampleset' statistically & with your nitpick bullshit as well as tossing names at me (which signa
Great software design is usually the incumbents...
Chris Lukehart
No software is built or maintained without a reasonable return on investment (real, perceived, or expected). Even toy programs written in one’s basement are written for a return: amusement and/or education. If code isn’t cost effective none of the other factors matter.