Slashdot Mirror


Ask Slashdot: How Would You Teach 'Best Practices' For Programmers?

An anonymous reader writes: I've been asked to put together a half-day workshop whose title is "Thinking Like a Programmer." The idea behind this is that within my institution (a university), we have a vast number of self-taught programmers who have never been taught "best practices" or anything about software engineering. This workshop's intention is to address this lack of formal training.

The question is, what should be covered in this workshop? If you have an idea -- that also has an example of best practice -- please share!

It's really two questions -- what "thinking like a programmer" topics should be covered, but also what examples should be used to illustrate best practices for the material. So leave your best thoughts in the comments.

How would you teach best practices for programmers?

220 comments

  1. Learn math by Master5000 · · Score: 5, Interesting

    There is no way around it. Never seen a great developer without strong analytical skills.

    1. Re: Learn math by Reverend+Green · · Score: 3, Insightful

      Imho grammar is at least a important as math. If a person speaks like an illiterate rube, chances are he'll program like one too.

    2. Re:Learn math by PolygamousRanchKid+ · · Score: 4, Funny

      I think a combination of the "Wizard of Oz" approach and Cognitive Behavior Theory would be very effective here.

      Never seen a great developer without strong analytical skills.

      I've never seen great developer, or actually, someone who thinks that he is a great developer, who didn't look, smell and act like one.

      Do not shave your neck any more.

      Stuff yourself with unhealthy junk food; preferably, while working at your keyboard.

      Think that you are a super-genius and all your colleagues are idiots. Convince yourself that your code never has any bugs, and the problem must be somewhere else.

      Showers and baths? Forget it. The whole world is in a drought, and you need to save water.

      Get yourself into meaningless arguments about trivial things like vi vs. emacs. Refuse to stop arguing, even when everyone else has left the room.

      In short, you don't need to be a great developer! Just play one on TV!

      --
      Schroedinger's Brexit: The UK is both in and out of the EU at the same time!
    3. Re:Learn math by Anonymous Coward · · Score: 2, Insightful

      Logic is a branch of mathematics.

    4. Re:Learn math by K.+S.+Kyosuke · · Score: 1

      Agreed, that's one of the minority of things where "I'm following the best practices" means something else than "I've decided to copy everyone else's mistakes" for a change.

      --
      Ezekiel 23:20
    5. Re:Learn math by Immerman · · Score: 3, Informative

      Other way around - mathematics is a strict subset of logic, which also applies to realms well outside mathematics.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    6. Re:Learn math by angel'o'sphere · · Score: 1

      And why do you write Math in your subject line but talk about analytical skills in the comment?
      Math != Analytical skills

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    7. Re:Learn math by Bongo · · Score: 1

      And why do you write Math in your subject line but talk about analytical skills in the comment?
      Math != Analytical skills

      That's what I was wondering. I imagine there is a reason that development uses the word "architecture". Design is often about understanding where and how to make compromises between contradictory requirements. And didn't IBM originally think that programming was something like music composition? Which is not to say that some problems are not extremely mathematical, just that that is one form of cognition, and there are other intelligences which come up in other problem types. So perhaps the question is a bit too general. A question is, has a developer handled the particular type of problem before and did they manage to produce a pretty good design, having, through trial and error, and insights, explored the possibilities?

    8. Re:Learn math by arth1 · · Score: 3, Insightful

      There is no problem finding good mathematicians that knows jack shit about logic

      Name one.

    9. Re: Learn math by Anonymous Coward · · Score: 0

      Probably because math is widely available, uses symbolic language, with well defined rules that use similar skills to debug as programming.

      Additionally, it's relatively consistent country to country even if teaching methods and focus vary somewhat.
      Not to mention that you need math in order to properly optimize complicated code.

    10. Re: Learn math by Anonymous Coward · · Score: 0, Insightful

      Programming includes some logic, but it's only a small part.

      Programming is about understanding the effects of decisions from many angles. How a choice will affect correctness, maintainability, and performance.

      These topics are too subjective to be tied to logic. Sadly, this is why programming is still an art.

      Software engineering is an attempt to improve on this, but even those few who are good at engineering are still making their compromises based on their beliefs.

      It's all very fuzzy compared to logic, and using the two in the same sentence is disrespectful to logic.

    11. Re:Learn math by Z00L00K · · Score: 5, Insightful

      Always break down the problem into small parts that are easy to manage and test.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    12. Re: Learn math by Anonymous Coward · · Score: 0

      How about 'at least *as* important' ?

      Yes, grammar is important, Rube.

    13. Re: Learn math by Anonymous Coward · · Score: 0

      Emacs!

    14. Re: Learn math by jimtheowl · · Score: 2

      "These topics are too subjective to be tied to logic"

      Correctness and performance are directly tied to logic.

      "Sadly, this is why programming is still an art"

      That is not sad at all. Musical theory requires understanding some physics and mathematics. No one would ever despair at the thought that great musicians are creating art.

      ".. using the two in the same sentence is disrespectful to logic."

      That very sentence lacks the latter. Do you think that logic is offended?

    15. Re: Learn math by Reverend+Green · · Score: 1

      And yet your "witty" retort itself contains a miscapitalization. Perhaps an illustration that:

      a) typographical errors != grammatical errors
      b) text input on a mobile device is prone to typos
      and
      c) Slashdot's mobile interface sucks donkey balls

    16. Re: Learn math by Anonymous Coward · · Score: 0

      Actually, one can speak and write quite differently, in opposition to to your assumptions. Though, you will probably still be a condescending asshole, even if you do both well.

    17. Re:Learn math by TheInternetGuy · · Score: 2

      There is no problem finding good mathematicians that knows jack shit about logic

      Name one.

      Hey, now... you can't just go around demanding that random people on the internet be ready to back up their claims with sources, or facts even.

      --
      If my comment didn't sound as good in your head as it did in mine, then I guess we all know who's to blame
    18. Re:Learn math by Aighearach · · Score: 1

      Architecture is the combination of known design elements to meet a particular use case.

      Engineering is design based on mathematical calculation of all the strengths of the necessary materials.

      Software can be created using either of those systems, or using almost any other creative pattern or procedure.

      Code is normally designed as in architecture, but sometimes (spaceships and traffic controls) it is engineered.

      You don't actually need to learn how to "do" math in the sense that they mean it in math classes, which is to memorize the steps to solve each type of formula. Instead, you have to have an internalized understanding of the use cases for different types of formula, so that you know when to use them. That's it. Many people lack that understanding even after having taken and passed advanced math classes, too. But something like trigonometry is totally useless to a programmer; you're never in your career going to want to write a function that computes a sine, you're always going to use some sort of library function or lookup table for that. And you don't need to memorize how to use the functions, either, you just need to have the API documentation available while you work. You just have to know the use cases well enough to recognize how to get from A to B well enough to look up the algorithm. If you never learned any trig you might not realize the possibilities to calculate various positions or angles based on what you already have; but also there is very little utility in actually remembering the details.

      The problem with all these stupid questions about "best practices" is that programmers haven't agreed what the best practices are. Lots of people want to know how to brainwash new programmers so they'll be less wrong about it, but that doesn't actually move us towards agreement. It becomes critically important to be able to compartmentalize determinations about best practices at the project level; local consistency in practices is important, and we can't agree what is really best, so treat any local idiocy as a best practice. Now, why the hell would we want to teach any of that to new people?! Let them learn it on their own and be horrified, maybe they'll solve it.

    19. Re: Learn math by synaptik · · Score: 1
      --
      HSJ$$*&#^!#+++ATH0
      NO CARRIER
    20. Re:Learn math by 14erCleaner · · Score: 2

      Get yourself into meaningless arguments about trivial things like vi vs. emacs. Refuse to stop arguing, even when everyone else has left the room.

      God intended Man to put the opening bracket on the same line as the if statement. No corporate drone's so-called "standards" can convince me otherwise.

      --
      Have you read my blog lately?
    21. Re:Learn math by angel'o'sphere · · Score: 1

      Actually we agree what "best practices" are.
      You can google for it and then you find the 5 steps/levels of CMM(I) which are centered around about best practices.
      https://en.wikipedia.org/wiki/...

      The question however is for a single developer which of the best practices he should know. That is why we developed agile methods like Extreme Programming (XP) and Scrum, to focus on the stuff that is relevant for a single developer so that others can focus on the bigger picture (like acquisition, planning etc.)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    22. Re: Learn math by Anonymous Coward · · Score: 0

      Imho grammar is at least a important as math. If a person speaks like an illiterate rube, chances are he'll program like one too.

      Grammar != Syntax. What you are complaining about is simply more of comments/documentation than anything else. In programming, English is used only in naming variables. That has nothing to do with the language syntax. If the program is simple enough, comment may not be needed; thus, it has nothing to do with grammar. Besides, the question is about programming skill, not documenting skill. I understand that big projects should have good documentations, but that is a completely different topic/discussion.

    23. Re: Learn math by Anonymous Coward · · Score: 0

      Always...uh...never...forget to check your references.

    24. Re: Learn math by DutchUncle · · Score: 1

      Oddly enough, the BBC and other news services have been eschewing all-caps for acronyms. OTOH I agree with you that IMHO should be all-caps.

    25. Re: Learn math by lsatenstein · · Score: 1

      A student should have an uncluttered mind. A mind that is cluttered is a sign of someone impatient and lacking in self-discipline.

      Have a programming apprenticeship program where the student writes code and the "advisor" reviews it for correctness, completeness and style. At first once per day review, then once very two days, to once per deliverable.

      Most of all, the student for a few weeks, be given ample time and low priority tasks, and as the skills improve, tighten up the student's timeframe to deliver.

      --
      Leslie Satenstein Montreal Quebec Canada
    26. Re: Learn math by Anonymous Coward · · Score: 0

      A student should have an uncluttered mind. A mind that is cluttered is a sign of someone impatient and lacking in self-discipline.

      This has dogged me all through school. Can you recommend any good books/courses on uncluttering the mind?

    27. Re: Learn math by Reverend+Green · · Score: 1

      Histories, by Herodotus

      Natural Logic, by Neil Tennant

      Twilight of the Idols, by Nietzsche

  2. based off my formal education by Anonymous Coward · · Score: 0

    You don't, you throw random DOS, linux, math, english, and then languages like .net, c++, javascript, java etc all into one giant pot, never explain anything at all, then get mailed a diploma.

    *cough* Algonquin College in ottawa ontario canada *cough*

  3. Back to basics by Calydor · · Score: 3, Insightful

    Indentation and comments.

    Stopping for a moment to ask yourself if you NEED to load a 50 MB library for two lines of code.

    --
    -=This sig has nothing to do with my comment. Move along now=-
    1. Re:Back to basics by Anonymous Coward · · Score: 0

      Yes. Do you want bugs? Because that's how you get bugs.

      The library contains code that has been used hundreds of thousands of times. The odds of introducing a bug is much lower than reinventing the function on your own.

    2. Re:Back to basics by Rockoon · · Score: 1

      Indentation and comments.

      And many so called comments are a no-no. New programmers comment the steps in the procedure and they shouldn't. The code itself is supposed to be the documentation of the procedure. Name your variables and functions appropriately, refactor down large functions, and document the damn data.

      --
      "His name was James Damore."
    3. Re:Back to basics by umghhh · · Score: 1

      so because some comments are bad you advise to not comment at all?

    4. Re:Back to basics by Anonymous Coward · · Score: 0

      Sure.. i'll use npm and get my production-servers bricked after an update.

    5. Re:Back to basics by Anonymous Coward · · Score: 1

      Comments are not a big no-no, but they should be short and used sparingly... Like "This code is used to identify X" or "This code handles X because of third-party input may do Y"

      Comments are there to be able to bring in a new developer and make it easier for them to understand why things are done, not to explain what each for-loop do.

    6. Re:Back to basics by Strider- · · Score: 5, Insightful

      Oh hell no. So-called “self-documenting code” isn’t. You can write the most comprehensible, clear code in the history of mankind, and that’s still not good enough.

      The issue is that your code only documents what the code is doing, not what it is supposed to be doing. You wouldn’t believe how many subtle issues I’ve come across over the decades where on the face of it everything should have been good, but in reality the code was behaving slightly differently than what was intended.

      --
      ...si hoc legere nimium eruditionis habes...
    7. Re:Back to basics by JaredOfEuropa · · Score: 4, Insightful

      The issue is that your code only documents what the code is doing, not what it is supposed to be doing

      Mod this up. I aim to document my intent, i.e. what the code is supposed to do. Not only does this help catch bugs within a procedure, but it also forces me to think a little bit about the purpose of each method or function. It helps catch bugs or inconsistencies in the software architecture as well.

      --
      If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
    8. Re:Back to basics by Racemaniac · · Score: 1

      Yeah, and the library is guaranteed bug free and optimized for your needs -_-

      If like above, it's literally a few lines of code, just write them, if a bug is ever found in them fix it (i'd prefer having to fix an error in those couple of lines of code (and then adding a test making sure it never happens again), over losing hours when something is going wrong in the library and that being a lot harder to do something about/work around it)

      Using a library is always a trade off.

    9. Re: Back to basics by johnsnails · · Score: 1

      "Comments are lies waiting to happen". Just be mindful that a comment could become deceitful and learn what the purpose of comments are. What makes a good/bad comment. I suppose the same could be said of once well thought out variable names.

    10. Re: Back to basics by johnsnails · · Score: 1

      I agree with everything you said besides being short (whatever that is precisely). Sometimes a good comment will be a solid 4-5 line paragraph. But maybe I should fix the code instead that needs that long of a comment.

    11. Re:Back to basics by AmiMoJo · · Score: 1

      Sometimes I'd rather they load a well tested, robust 50MB library that try to write it themselves.

      Naming is where most programmers go wrong. I have some rules, like putting the units in the name, and am not afraid to re-factor if it makes something's function clearer.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    12. Re:Back to basics by Anonymous Coward · · Score: 0

      If you use something like doxygen, generate a full set of documentation, give it to someone else (like your non-programmer kid brother), and ask them to explain to you how to use the documented thing using only the given documents.

      If you're Keith Packard you're going to find you just upset your victim beyond all reason.

    13. Re:Back to basics by Anonymous Coward · · Score: 2, Insightful

      Don't comment your code. Code your comments.

    14. Re:Back to basics by Anonymous Coward · · Score: 0

      Depends. If they're doing datetime handling, always use the library even if you think "it's just two lines".

      The number of times I've picked up code and found people just doing simple arithmetic operations on dates that would either fail completely or generate incorrect results around daylight saving change or leap years is ridiculous. Especially when you consider that I primarily work in .net, which has a robust set of datetime functions built-in to the core runtime!

    15. Re:Back to basics by Anonymous Coward · · Score: 0

      Apparently you didn't read the **comment**. The **comment** was about two lines of code, not rewriting 50Meg worth.

    16. Re: Back to basics by pjt33 · · Score: 1

      I once wrote a library for (essentially) GIS which was full of comments that were 20 lines or longer. When the correctness of the code depends on theorems in non-Euclidean geometry and you can't assume that the maintainer will know any, I don't think it's a bad idea to make the proofs quite explicit.

    17. Re:Back to basics by CaptnCrud · · Score: 1

      Agree. The footprint is negligible vs the headache. If you've chosen well and leveraging your library correctly you shouldn't need more than one.

    18. Re:Back to basics by CaptnCrud · · Score: 1

      Oh, yea npm...well all I can say is tough shit. Do a rollback and what till its fixed or switch to yarn in the meantime, womp womp, life goes on. If you really want to be fair, that could happen to lots of package managers. And if you don't do backups for globals and source control you have bigger issues.

    19. Re:Back to basics by swillden · · Score: 2

      The issue is that your code only documents what the code is doing, not what it is supposed to be doing.

      You can document that with good names. No need to add comments that are likely to become actively misleading.

      Javadoc-style comments are useful (and, actually, if you're writing appropriately-small functions provide all the space you should ever need for documenting the rationale), but inline comments are a code smell. If you feel the need to type a comment explaining what a small block of code does, that's a hint that the block should be factored out so that you can name it something that documents its purpose. Then the function call will be self-explanatory -- and your code will be more modular and probably more testable as well.

      You wouldn’t believe how many subtle issues I’ve come across over the decades where on the face of it everything should have been good, but in reality the code was behaving slightly differently than what was intended.

      I would absolutely believe that because I've been there more times than I can count... and most of them were cases where the code was commented but the comments were wrong. This has happened to me so many times that when wading into complex new code I often make a pass first and delete all of the inline comments. And I treat those that remain with skepticism and never believe them without double-checking the code.

      The problem with comments is that they bitrot more than the code does, because code often gets changed without careful updates of the comments.

      Note, however, that when I'm teaching beginning programmers, I teach them to comment the hell out of the code. Beginners forget that their primary audience isn't the compiler, it's other programmers. Once a programmer has a few years of experience under his or her belt, though, it's time to start treating comments as a hint that the code needs to be improved until the comment is unnecessary.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    20. Re: Back to basics by c6gunner · · Score: 1

      She tried to refactor your comment but lost part of it on the way.

    21. Re: Back to basics by Anonymous Coward · · Score: 0

      Generated documentation doesn't explain intent , it only makes the same information available in a different format , that looks like a document instead of source code ... Not a substitute for real comments by the developer

    22. Re:Back to basics by Aighearach · · Score: 1

      Comprehension fail.

      "document the data" with comments != no comments.

      Unless you have no data. In which case you're very lucky, because you also have no bugs or misfeatures.

    23. Re:Back to basics by Anonymous Coward · · Score: 0

      Excellent Remark. Also, surely everybody knows that the intent of code should be documented via unit tests.

    24. Re:Back to basics by Aighearach · · Score: 1

      I remember in `99 printing out all the C headers for Gtk+, because it was better documentation than whatever existed for the Perl bindings I was using.

      Yes, when the code is well written enough, like Gtk+ 1.0 was, then that is all the library user should need.

    25. Re:Back to basics by Anonymous Coward · · Score: 0

      It also makes it so much easier to trouble-shoot down the line.

      "The code seems to be breaking when it tries to do X" ... lets do a quick search and find the comment that says "this is the part where the code does X"

    26. Re:Back to basics by david_thornley · · Score: 1

      Self-documenting code can make it easy to see what the code is doing. It doesn't describe what the code is doing, or why. That's what comments are for.

      Comments that don't tell you anything the code doesn't are mostly useless. Worse, someone will change the code and forget to change the comments. Comments that tell what the code should do are a lot more stable.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    27. Re: Back to basics by Anonymous Coward · · Score: 0

      Well it depends on what you write.

      I use the "///" tags in C# and doxygen to produce my documentation.

      If I actually write something useful ("intent" is a great way to describe this) in the comments then my documentation comes out looking pretty good.

    28. Re: Back to basics by Anonymous Coward · · Score: 0

      What? Someone out there has a library that does exactly what you needed for each of your apps, you chose it well and never needed another one ? Your apps must not do much

  4. Condescending much? by Anonymous Coward · · Score: 0

    If you've taught yourself to program at anything more than a trivial level then you're already step ahead of most 1st or 2nd year engineering or computer science students.

    Anything you could teach in half a day is less that what would be useful to a generic audience (what's useful to a C++ programmer is not useful to a JavaScript programmer, what's useful for someone writing GL shaders is not useful for someone programming an STM32)

    What's the other half day? "How to solve all your personal failings and live happily ever after"?

    1. Re:Condescending much? by Anonymous Coward · · Score: 0

      Of course you're limited in what you're going to be able to teach them in half a day. That doesn't mean you can't teach them SOMETHING of value. A few topics I'd suggest for consideration:

      Testing. IME, most self taught programmers have no idea how to write tests or use a testing framework.
      Modular programming. How to break your program into functional areas and separate code from the data, so you car write reusable libraries.
      Version control. Many self taught programmers know how to use git to clone a project and that's about it. Create branches, commit often, etc. are foreign concepts
       

    2. Re: Condescending much? by c6gunner · · Score: 1

      Testing. IME, most self taught programmers have no idea how to write tests or use a testing framework.

      That's easy. If it compiles, it passes the first test. If it compiles without warnings that's like an A+.

      For the second test just put it into production and see if anyone complains.

  5. Learn and Grow by Anonymous Coward · · Score: 0

    Really thats all, whats this crap about best practices and all that ivory tower crap.
    Learn lisp and c and python, then if you are not thinking like a programmer then , after that you never will. Formal procedures should be specific to your institution and job flow, not some arbitary waterfall or agile shit that just turns people off their jobs and creates a lack of motivation for its best programmers.

  6. Teach them worst practices... by Anonymous Coward · · Score: 0

    Then let them work out best practices for themselves from other people's failures.

    Really that is the best and only way to teach, because it requires them to *THINK*, and in thinking come to their own conclusions, then from those conclusions make (hopefully minor in comparison) mistakes, which will allow them to refine further until they make few mistakes, and no critical ones at all.

  7. There are papers on this subject... by Anonymous Coward · · Score: 0

    See for example

    Wilson G, Aruliah DA, Brown CT, Chue Hong NP, Davis M, et al. (2014) Best Practices for Scientific Computing. PLoS Biol 12(1): e1001745. doi:10.1371/journal.pbio.1001745 and https://dx.doi.org/10.1002/2015EA000136 . Those are for geoscience, but of course you can find similar papers in your field(s). And then find the papers they cite and who cites them. Your acadmic (university) audience will prefer lessons based on this, with citeable references, than lessons based on Slashdot comments, me thinks.

  8. Laurie vosses presentation by Anonymous Coward · · Score: 0

    It's all you need and covers all high level things with 20 years experience

    https://youtu.be/JIJZnF_L5KI

    https://youtu.be/4H8VTCSbYQg

  9. Team skills by sanf780 · · Score: 1

    I am talking from my old days. When I was at university, most of the things I did was on my own. However, in the real world, it is hard to see a single person carrying all the burden and responsibility of a project. Team skills are important if you want to get out of your mom's basement.

  10. bottom up is best. by Anonymous Coward · · Score: 1

    One should start with assembly language, machine code, or even gate layouts. Higher level languages evolved as a pile of shortcuts and safety measures on top of this, and programmers should understand what is being shortcutted or protected against and why.

    Once you've learned from experience all the terrible mistakes you can make in assembly, and learned the self-discipline not to make those mistakes ever again, you are ready to move on to the next level.

    1. Re:bottom up is best. by david_thornley · · Score: 1

      Nope. Start with a usable language. Higher-level languages evolved as abstractions over the machine code, and the abstractions are very useful. The hard part of programming is taking an informal problem statement and turning out an accurate formal solution, and that's enough to learn on its own without worrying about which register has what.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  11. Not that difficult to say but hard to do by Anonymous Coward · · Score: 1

    1) There are always things to learn
    2) KISS
    3) If it can go (and it will) wrong then test for it and handle the error.
    4) There is no one solution for anything
    4a) There is no one RIGHT solution for any problem. There are always different ways to skin the cat.
    5) Never act like you know it all even if your name happens to be D. Knuth. (joking)
    6) Read, ask, read, ask and then think. Think again before you even start to think about coding.
    7) Don't be afraid if your first solution is crap and really does not work very well. Learn from that and make it better next time (difficult with Agile and reluctance to sort out Technical Debt)
    8) Trying things out is not a sin.
    There are dozens more but you would be surprised at how many recent grads know 'none of the above'.

    1. Re:Not that difficult to say but hard to do by Immerman · · Score: 2

      9. Distrust your darlings - if you've done something very clever that you're quite proud of, it's probably a good idea to give it a good hard looking over with a critical eye (or better yet, have someone else do so), and see if you haven't made a grossly over-complicated solution in search of a problem, when something much more straightforward could do the job better.

      I'd disagree with (6) though - it needs more thought between "read" and "ask".

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    2. Re:Not that difficult to say but hard to do by Anonymous Coward · · Score: 0

      #6 is think, think, think, then do NOT the reverse.

      It applies to many things, not just writing s/w.

    3. Re:Not that difficult to say but hard to do by pjt33 · · Score: 2

      Point 5 could be strengthened. Don Knuth doesn't act like he knows it all (source: personal experience), so certainly no-one else should.

  12. The Clean Coder by Anonymous Coward · · Score: 0

    Last year I began coding professionally for the first time in my life. I read a few language specific books and then âThe Clean Coderâ(TM) itâ(TM)s available on Amazon and Safari. The chapters on test driven development, automated unit testing, people skills (learning to say no/yes) and professional development outside of working hours were superb and would make ideal topics for such a half day course. That book impacted me greatly and last year my peers at my work awarded me.

    1. Re: The Clean Coder by Anonymous Coward · · Score: 0

      I never liked how clean coder is somewhat language specific, but I would love to see more in these lines. It is an excellent guidebook for anyone who is trying to accomplish what the original poster is asking.

      Of course, I think Clean Coder is becoming a religion and I never cared to that.

      Thumbs up to this guyâ(TM)s recommendation though :)

    2. Re: The Clean Coder by Anonymous Coward · · Score: 0

      I like Zed Shaw's critique of Bob Martin types, writing culty books and selling training/consulting while not having actual code written with those practices in public spaces.

  13. work backward from maintenance by Anonymous Coward · · Score: 0

    Most of my time as a programmer is spent in maintenance, not developing new code. I think most (all?) of our best practices are driven by the need to minimize time spent on maintenance. Unit testing, source code control, issue tracking, OOD, continuous integration, are all driven by maintenance. In order to get someone to "think like a programmer" they need win that hard experience for themselves. Maybe you could set up a running piece of software and give your students a list of bugs and features and tell them to start knocking them out.

    1. Re:work backward from maintenance by Immerman · · Score: 1

      Agreed. And in the same vein, good comments that concisely capture the *intent* of the code. What exactly the code does is usually pretty self documenting*, nobody needs "assigns 5 to x" style comments, but *why* it does it, what it's trying to accomplish, is often much less clear, and discrepancies between the intent and the reality can often highlight bugs

      * there are times when it's good to document *what* code is doing, usually in the case of the occasional bit of performance-boosting cleverness (magic-number based inverse square root approximations come to mind)

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
  14. Fuck Off With Your Workshop Bullshit by NicknameUnavailable · · Score: 2, Insightful

    The basic summary is: you don't know how to code or you would know it takes a decade of trial and error to get good, even after learning the basics. It's sure as shit not going to happen in a half-day workshop and teaching "best practices" will at most create a zealot who doesn't know what the Hell they are doing and is adamant about not learning. Code workshops don't work, best case scenario you're a lazy low-or-moderate-ability programmer, worst case you're a marketing hack.

    TL;DR: Stop tricking idiots into giving you money, you parasite.

    1. Re:Fuck Off With Your Workshop Bullshit by Anonymous Coward · · Score: 0

      What he said ^^^^^^^^^^

  15. Be a team player by Hal_Porter · · Score: 1

    When they arrive, slap them hard on the back and then look them in the eye and say in as sinister a manner as possible.

    "We like team players here, Nugget. Are you a team player?"

    Emphasise the words 'team' and 'player'.

    Then walk off.

    Also have a broken build bear

    http://www.vikingcodeschool.co...

    Be ready to break things. Sometimes things get through QA, sometimes you break the build. A lot of times that will get caught in your continuous integration systems and testing and everything like that. But sometimes even you just push production, like bad code to production, so you're going to break stuff. The most important thing I can say from day one is to know how to fix it. Know how to back the changes out, know how to do things that can undo the damage that you do and then just accept it. It happens, we have a "broken build bear" that we pass around our office for people that do it as a shaming mechanism, but it's mostly in good fun. But it is important to sort of know how to undo.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  16. Electric shocks by raynet · · Score: 4, Funny

    The most efficient way to teach best practices is to give the programmer electric shocks for every error, and more for bugs caught in testing. For approved commits you may award them with treats.

    --
    - Raynet --> .
    1. Re:Electric shocks by PolygamousRanchKid+ · · Score: 0

      The most efficient way to teach best practices is to give the programmer electric shocks for every error, and more for bugs caught in testing.

      Wasting our precious bodily electricity on humans!?!? Heresy! As a limited Earth natural resource, electricity should be used where it makes the most economic sense . . . mining cryptocoins. At your university, remove wasteful outdoor and indoor electric lighting, and mine cryptocoins with the electricity. By Christmas your university can use the cryptocoin profits to go tuition free, double the salary of all the staff and buy your own nuclear reactor to generate all the safe, clean electricity you need . . . to mine yet even more cryptocoins!

      --
      Schroedinger's Brexit: The UK is both in and out of the EU at the same time!
    2. Re:Electric shocks by Anonymous Coward · · Score: 1

      ... and more for bugs caught in testing.

      I know this is a joke, but you want to encourage testing. Shocking harder for bugs found in testing will encourage commit-and-hope-for-the-best. I propose no shocks for bugs found in testing and harder shocks for bugs discovered in production.

      More to the OP's question - I would suggest to start them out fixing or retrofitting other people's code so they get a feel for how frustrating it can be when you come across a wall of code with no comments and you have to locate and correct the logic error.

    3. Re:Electric shocks by Anonymous Coward · · Score: 0

      see :
      https://www.youtube.com/watch?v=O1mmePD549o

    4. Re:Electric shocks by Anonymous Coward · · Score: 0

      I know it sounds counter intuitive but such systems do not work.

      https://www.alfiekohn.org/punished-rewards/

  17. CERT Secure Coding Standards by achowe · · Score: 2

    Start with the CERT Secure Coding standards, especially for C programmers it covers many of the "gotchas" to watch out for.

            SEI CERT C Coding Standard: Rules for Developing Safe, Reliable, and Secure Systems (2016 Edition)
            https://resources.sei.cmu.edu/...

    Apparently they them for other languages like C++, Java, Perl.

    1. Re:CERT Secure Coding Standards by Anonymous Coward · · Score: 0

      Actually - ANY secure secure coding skills would help.
      And a culture of accepting "near-zero" defects.

      In today's world, infrastructure is not the security problem - it is the applications that connects attackers to data.

      20,000+ CVE records of security flaws in a single year! Something wrong with this picture if it's considered 'good enough'.

  18. Here are some suggestions by Anonymous Coward · · Score: 1

    1) The art of commenting
    1a) What are good identifier names
    1b) Why magic numbers should always be avoided
    1c) When, why and how to use comments
    2) The importance of unit tests and what they are
    3) The importance of modularity

    Then, to get them to *really* appreciate why these are important, have them look at a program loaded with magic numbers, bad identifier names, lacking comments, huge source files and no unit tests. Have them chase down a bug for a while in that source code. Give them a deadline for additional fun.

  19. Read by Anonymous Coward · · Score: 0

    Same as with natural language writing, reading is important.
    Go read the code and understand the design of a well structured project. And no, an internal tool of a company usually doesn't count. Read something worked on by tens or hundreds of people.
    My favourites are the linux kernel and Qt.

    Then go read anything that gives you insight into how these people think. (Qt: https://wiki.qt.io/API_Design_Principles)
    At the same time, really understand the language you are using.

  20. at a University? by tomhath · · Score: 1

    Don't you have any Comp. Sci. professors there? There job is to teach students how to think like programmers (as opposed the "learning to code" that gets so much press coverage).

    1. Re: at a University? by Anonymous Coward · · Score: 0

      My experience was that computer science professors more taught students to be computer scientists, not computer programming. But that was 25+ years ago, maybe that has changed.

    2. Re: at a University? by Anonymous Coward · · Score: 0

      You are correct.

      *Proper* CS profs are - or should be - essentially mathematicians. Most of the top ones I know pretty much know jack shit about programming - some even have trouble with email. And I think that’s just fine.

      The problem is that when we say we teach computer science, most universities are actually teaching nothing of the sort. And, in the main, they don't need to.

      Computer Scientists, should be theoreticians – Computer Science is the study of the Theory of Computation – it’s not fucking Python programming! Think theoretical physicists, or materials scientists. Computer Scientists should – before they call themselves as such - have a Ph.D. in it - ideally from a top university. I'm sick to death of hearing some fucking retard from the University of Shit-for-Brains who just got their degree in 'computer science with basket weaving' calling themselves a 'Computer Scientist'! And don't get me started if they call themselves a 'Software Engineer' as an alternative!

      Bricklayers aren’t architects; and architects aren’t material scientists. The Architects learn the properties of materials without knowing the underlying material science (do you know just how fucking deep that subject is!); and they in turn hand their plans to structural engineers; and they in turn hire reliable, thoughtful builders. You don’t need masses of materials scientists; you don’t need masses of architects etc – and you don’t end up telling a bricklayer that he’s also a scientist.

      It really pisses me off – this confusion over what Computer Scientist actually is (same with SE) - all part of the dumbing down shit this world seems to embrace.

  21. Easy by 110010001000 · · Score: 2

    With a bat.

    1. Re:Easy by Anonymous Coward · · Score: 0

      You mean a bath? a daily bath?

  22. Don't push your conventions to other people by Anonymous Coward · · Score: 1

    People need to learn themselves what is good style to write code. Pushing whatever you consider to be good practise is very bad, since it steals the students the experience to learn the stuff themselves, and thus they wont have proper reasons why some practises are bad. Once they've seen it themselves, they can make the right choice in every situation, but if you push it to people, they don't know _why_ the recommendation is important.

  23. a whole "half a day", eh? by Tumbleweed · · Score: 1

    If that's all the time you've got, you've got a systemic problem. This kind of thing needs to be an ongoing process of education. You can't cover anything like this in half a day. Or a full day. WTH.

    Schedule "brown bag" sessions once a week for ongoing training and discussion, and get subject matter experts in for different things: security, TDD, algorithms, optimization, etc. And keep going; don't just do each of those once, because each of those is a full course full of stuff (at least).

    If you're only going to get one day for this, collect a bunch of online resources for people and go over it. Then find a job at a place that values ongoing education, because HOLY CRAP. How can a *University* not value ongoing education?!

  24. Impossible by zmooc · · Score: 1

    I don't think there's a reliable way to teach programmers best practices. Programming is like composing music: you can teach all the rules and be a technically perfect musician but in the end the real difference between a good programmer and a bad one is elusive. The trick is not to teach programmers, the trick is to find them.

    --
    0x or or snor perron?!
    1. Re:Impossible by angel'o'sphere · · Score: 1

      Of course there is.
      Just like for composers. For composers you would assume he can play at least one instrument or can use music programs good enough to compose tracks that sound not to bad.
      Same for a programmer, he should be able to use his tools properly, like a version control system and a build system and depending on organization know about continuous integration etc.
      Then probably comes a ticket system. And learning how to pick up requirements, aka Use Cases or Stories or more technical requirements in case he is working on highly formalized systems.
      Then again: be able to write tests. And then again: have an idea about how installing/deployment works and how to roll back in case of failures during deployment.
      This are all simple things, and in the end everyone working in those areas could become a specialist and really a rock star in one or some or all areas.
      But to jump from "just a programmer" to one with "best practice" you only need to broaden your field and learn the basics.
      I don't expect one to be an CI expert and move a build that works on his machine to a CI system. But I expect him to know that the CI system is watching his commits (and he should commit often) and builds them. So he gets email or has to check the build server to see if his build worked.

      Etc. p.p.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re: Impossible by Anonymous Coward · · Score: 0

      Yup. Mod up

    3. Re:Impossible by Aighearach · · Score: 1

      You wanted to disagree with it, you really did!

      But you don't seem to have understood the point.

      Instead of getting hand-wavy and dismissing the idea that good composers can't be reliably taught, consider first the ways in which it is true. Then you can understand the points being made, and when you go to argue with them, you'll succeed at finding them! Instead of just talking past them and arguing from ignorance.

      Hint: that a competent musician might not be able to write anything that sounds good even on that one instrument, is a truism of music composition. Another one is that if you're the one who wrote it, you might not be able to tell if it stinks or not. And if you doubt that: Mussorgsky!

    4. Re:Impossible by angel'o'sphere · · Score: 1

      Composing is more an art, and the composer has ofc to accept the judgement of his audience.
      The internal quality and external quality of a piece of music is the same.

      Programming software is just a craft (yes, you can drive it up to higher levels and the highest might be art ...) as long as the software passes a test (probably automated) it is fine.
      The internal quality and external quality of a piece of programming is not the same. The software can look from the outside perfect, my be even perfectly useable. That is called external quality.

      From the inside it might still be a complete mess.

      So: you can not really compare music composing with programming. Even if there are similarities.
      And, yes, imho both can be thought. But that does not mean that a composer has the spark to make really creative art. And a programmer does not need that spark, he has a spec instead.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  25. KISS by Anonymous Coward · · Score: 0

    Keep the code as simple and maintainable as possible. Slick and too compact code may look good at first, but it makes maintaining and upgrading the code a nightmare.

  26. Ask Slashdot: How Would You Teach 'Best Practices' by ruir · · Score: 1

    I've been asked to put together a half-day workshop whose title is "Thinking Like a surgeon." ...
    I've been asked to put together a half-day workshop whose title is "Thinking Like a pimp." ...
    I've been asked to put together a half-day workshop whose title is "Thinking Like a police." ...
    I've been asked to put together a half-day workshop whose title is "Thinking Like a plumber." ...

    Why not, while you are at it?

  27. Where to begin? by cjonslashdot · · Score: 1
    1. 1. That programming is not "coding". Programming should include designing - otherwise, it is "hacking" (pejorative).
    2. 2. Teach about race conditions, aka "TOCTOU errors". This problem is the most prevalent in real time systems - such as phone software, Web software, and pretty much everything we use today.
    3. 3. The value of type safety when refactoring.
    4. 4. Basic concepts such as information hiding, decomposition, interfaces, and that the more shared an interface is, the more stable it should be.
    5. 5. Some machine learning basics.
    6. 6. The value of a formal syntax, and the maintainability horrors of semantic free syntaxes such as JSON.
    1. Re:Where to begin? by angel'o'sphere · · Score: 1

      1) I guess "coding" is just the new word everyone likes to use because it sounds cool, so yes, it is programming.
      2) Race conditions by definition only happen in multi threaded systems. And plenty of software is not. Your examples are wrong. A web server will be multi threaded, but most of the time will only use exactly one thread per request. In other words, the programmer of the web application will never see race conditions ... the programmers of the web server will ... and those are likely 2 or 3 levels above the mere coder in (1)
      3) Agreed, but that is e.g. difficult in languages that don't offer IDE supported refactorings
      4) agreed
      5) completely unnecessary if s/he does not work in that area
      6) JSON is a way to serialize data, no idea what you think is wrong with it

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:Where to begin? by Gavagai80 · · Score: 1

      2) Actually it's not uncommon at all as a web developer to have a problem arise because two people are viewing a website at the same time and the two threads make database alterations in the wrong sequence. You have to be aware of it and make decisions about how to handle it.

      --
      This space intentionally left blank
    3. Re:Where to begin? by Aighearach · · Score: 1

      lol if you don't think you can have a race condition in single-threaded code, wow... that's what I call "sheltered."

      Doing consulting work it isn't even surprising or uncommon.

      Race conditions are any time the algorithm relies on things happening in a certain order without checking. So any type of non-blocking read, for example. Or you might have to set some system register, and then wait for some other register flag to show up before doing the next step. Screw it up and you've got a race condition.

      I had one a few weeks ago where an interrupt service routine simply made a faulty assumption about the maximum number of cycles it could take to start, and created a race condition!

      It is hard enough to teach people that race conditions are always bad, even if you think you'll always win the race. But then when you add in that people can't even remember what the words mean, how could you hope to "teach" anything? They either learned it independently, or they simply don't know it. Measuring if they understand race conditions is probably a lot easier than teaching anything about anything.

    4. Re:Where to begin? by angel'o'sphere · · Score: 1

      Sorry, that is not how databases work ;D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    5. Re:Where to begin? by angel'o'sphere · · Score: 1

      lol if you don't think you can have a race condition in single-threaded code, wow... that's what I call "sheltered."
      No you can't.

      So any type of non-blocking read, for example. Or you might have to set some system register, and then wait for some other register flag to show up before doing the next step
      That is nonsense.

      I had one a few weeks ago where an interrupt service routine simply made a faulty assumption about the maximum number of cycles it could take to start
      That is not a race condition.

      Interestingly however the whole engish wikipedia article is wrong ;D https://en.wikipedia.org/wiki/...
      Perhaps you use the term "race condition" for several distinct things that have nothing to do with each other?

      A simple introduction you can find here: https://stackoverflow.com/ques...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  28. Depends on the tool. by Anonymous Coward · · Score: 0

    If you are not targeting any technology/programming language specifically, I think you should focus on what Best Practices means, and it's benefits. Some general examples would be great, but then your students should go and learn the ways of their own tool. Each tool is based on some ideas on how it should be used. What are dose ideas? What where the designers of the tool thinking? How they envision their tool being used? That is, I think, what your students should ask themselves.
     

  29. i need this! by AndyKron · · Score: 1

    I don't know sign me up! Seriously I need this.

  30. I think you mean standard practice by Pinky's+Brain · · Score: 2

    Stumbling towards a steaming pile of shit with flavor of the day development strategy, flavor of the day framework and flavor of the day lingo and absolutely never with any structural ways to avoid the most common security flaws we have been aware of for multiple decades. That's what you have to teach them.

    They want a job, knowing best practices isn't conducive to that.

  31. What is a programmer? by Anonymous Coward · · Score: 0

    A person drawing webpages with the latest ultra-high-level tools and a person writing firmware for a real time transmitter with 4K of RAM and two registries needs different skill sets and "best practises". What is a programmer in the eyes of the OP?

  32. Find the errors and fix them strategy by Proudrooster · · Score: 1

    Teaching people by showing them errors or bad code doesn't move the needle very much. In technical subjects I prefer to used researched based teaching strategies. Put attendees into groups, give them bad code examples, and have them find the errors or ways in which the example could be improved. Then have a discussion about it and guide them all to a common understanding. If you show someone a bad example or give comments for improvement, it typically goes in one ear and out the other, if they find the errors themselves, according to research they are less likely to make those errors again.

    Take a read through this article, https://www.tieonline.com/arti...

    From one of the most brilliant minds in education today.

  33. There is a huge problem with math though ... by Anonymous Coward · · Score: 0, Interesting

    The culture is just wrong for most people and goes directly against software development principes.

    * Th Paul Lockhart argument: True math is the skill of solving very abstract problems by finding very abstract patterns/principes.
    But the math we learn is merely the memorization of some of those patterns without understanding them and without the ability to come up with new ones. Missing the entire point.

    * The 3Blue1Brown argument: Math is unfortunately taught like a written language. But most people do not think of patterns that way. They fail at math, not because they are bad, but because the form of communicating it only serves a small elite (who somehow always act like they want to keep it that way).
    Then they notice that when it is taught in a geometric way ... like 3Blue1Brown does so well ... suddenly the most complex topics become natural and easily approachable.

    * The programming principles argument: That mathematical language goes directly against principles like using descriptive identifiers, and makes Perl not even hold a cande against how write-only it is.
    Generally, mathematicians think that because it is so abstract, they get to not only use useless one-letter identifiers, but preferably ones that you can't even enter on a computer, and that, even if Google would not ignore one-letter things, would be completely ungoogleable. Preferably with them secretly being not just variables, but substituton conventions using multi-parameter higher-order functions in a way way that even finding the structure of the expression by looking at it becomes impossible. (But if you transate it from Snobist to Human, suddenly it is quite easy to read. And if you explain it in a geometric way, it becomes almost obvious!)
    I'd say this is deliberate harmful obfuscation for the pure sake of exclusive elite snobbery.

    * The scientific method / incompleteness theorem argument: Many mathematicians seem to not bother caring if the thing they do have any relation to reality or usefulness, don't plan on getting there, or even actively reject it. But the problem is: Math is just a set of patterns/hypotheses, that only become scientific theories, once they are actually backed by (statistically reliable) observations from reality, and only become useful, when they allow predicitons in reality!
    But instead, many believe that math can stand on its own, and is the best science because it has perfect "proof"! Nevermind that those axioms can never be proven with math themselves, and the true scientific method rejects the concept of absolute "proof" anyway, since the best we can do is statistically reliable patterns in our observations, backed by peers that have also been shown to be ststistically reliable (by us).
    Many even suggest that reality is based on math!
    I'm sorry, but like religion, thst is literally (nkt even figuratively) the definition of full-on schizophrenia! At that point, they are not scientists anymore, but a cult/religion.
    And that poisons the useful math too.
    The same problems exists in philosophy, which also shares with math that it predates proper scientific concepts, and is halfway between religion and science.

    Because of this bullshit, it took me three decades to find out that I actually love math, and just hate the above madness.
    Now I can even get the girliest of "I hate math" girls to see and love the beauty and usefulness of true math. By speaking in human language and using real-world cases that they can actually use.

    So: Learn *proper* math. The right way! Yes, I *fully* agree with you there.

    1. Re:There is a huge problem with math though ... by Immerman · · Score: 1

      No argument that math is taught in a way that only seems to really "click" with the minority of people that already think in a way suitable to become mathematicians (aka extremely theoretical logicians) within the current framework - which is a shame, because regardless of whether you're suitable to become a mathematician in *any* framework, math is beautifully elegant, and being able to effectively use math to solve the relatively simple problems in life, engineering, etc. is immensely useful.

      I think the variable thing has a very different source (and you see the same things in engineering and the other sciences) - math has traditionally be done by hand, in steps small enough to make avoiding (and spotting) errors relatively easy. Meaning you'll quite likely be writing slight variations of the previous line thousands of times when solving even relatively simple problems - and mathematicians are lazy.

      There's also the fact that unlike code, where you generally want to do as little as possible on each line to improve clarity, a line of mathematics is very often a large and inseparable thing, and a moderately complex line of mathematics can easily span multiple blackboards, even when written with single-letter variable names. Having descriptive names would dramatically balloon that space, deeply obfuscating the overall patterns you're trying to find and untangle.

      As for proofs and scientific theories - that completely loses touch with what mathematics fundamentally is. It's a purely theoretical construct designed to sit upon its axioms with utterly logical soundness, using formal logical proofs to construct each new building block from those that came before. Unlike Science, where proof and truth are logical impossibilities, and only successively more accurate approximations are even attempted.

      The real world is irrelevant to math - it's a purely logical construct. It's broadly useful in the real world only because those fundamental axioms were chosen to be as simple and obviously true in the real world as possible - most are based in simple concepts such as basic counting and geometry. Formal logic guarantees that *if* those handful of simple axioms are true, then so is all the immense complexity built upon it. The truth of the axioms is well understood to be outside the realm of mathematics, and there are even fields of mathematics built upon adding an axiom or two known to be inconsistent with generally accepted truth (hyperbolic geometry for example), that nonetheless were later proved to be both very useful, and mappable to more generally accepted the axioms (i.e. anything that can be expressed in it can also be expressed in "normal" mathematics, though potentially much more verbosely)

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    2. Re:There is a huge problem with math though ... by Anonymous Coward · · Score: 0

      I have been finding the same, that I really do enjoy math. But it has been slow going taking things apart piece by piece on my own, figuring out what the pieces are and how they work together within a greater context, and thinking about how I can apply what I figure out. Have you come across good resources which provide clear conceptual understanding and which make math topics more concrete?

    3. Re:There is a huge problem with math though ... by arth1 · · Score: 2

      They fail at math, not because they are bad, but because

      Oh, in many cases they fail at maths because they are bad.

      It's politically correct to pretend that there is no such thing as aptitude and that everyone is equal. This is a blatant lie, and everybody knows it's a lie, but everybody plays along, because either you benefit from the lie, or it is the least dangerous move if you value your future and career opportunities.

      I worked as a maths tutor for people who struggled, and in some cases, they had not been properly taught the underlying fundamentals and "seen the light". Those were very teachable; finding out just where the blockage was would generally lead to going through years of missed teaching in weeks.
      Others... lacked ability, and the job was making them do the most of the abilities they had, and perhaps become good at particular tasks. But they would never understand it and intuitively be able to apply it for new situations, just be able to do tasks.

      Much like a colour blind person can never truly understand the colour differences he (most likely) isn't seeing, someone without the ability to see the logic and abstractions of maths will never truly understand what she (most likely) isn't seeing. Yet both can function well in society despite their handicaps. But part of that is acknowledging that there is a handicap, and that the correct response then isn't go give up and blame the handicap like too many do, but to learn to compensate for the handicap as much as possible.

      As for aptitude deficiencies, they vary, and seem mostly based on different levels of abstraction. While most are able to understand concepts like calculus or dimensional transformations, some struggle. A few have a hard time with algebra and statistics, and yet others are unable to intuitively grasp a concept of zero. At the other end, a majority seem unable to grasp relativity, and especially being able to abstract time as a local phenomenon where words like "before" and "ago" loses all meaning.

      Teaching can help people cope with the different levels of aptitude, but not change the underlying brain any more than you can teach someone to distinguish colours they just cannot see.

    4. Re:There is a huge problem with math though ... by Anonymous Coward · · Score: 0

      Failing at math needs to be defined here. Getting passing grades in a series of math classes doesn't say much if anything about succeeding in math. For example, I know a former math major who eventually switched majors because she felt like every class was just going through the motions, without ever gaining any real understanding. And I know math instructor has won awards for being able to get students through math classes, although he is a lousy at teaching for understanding.

    5. Re:There is a huge problem with math though ... by Anonymous Coward · · Score: 0

      First off, the more we've tried to "fix" the curriculum for the unintelligent, the worse it's gotten. People who are lazy, unintelligent and lacking in curiosity are always going to do poorly at math, that's just the way it is. The idea that is mysteriously just clicks for some people is a bunch of nonsense. It "clicks" with some people because they do the work. Excluding people with learning disorders or a disruptive home environment, there's relatively little difference between those that do well and those that don't other than the actual effective use of time.

      As for your second point, there's a reason why mathematicians generally prefer to copy entire lines piece by piece. The math is being written to run on a human brain, and having all of that in one place is much more efficient than having it in a dozen places. But, there's nothing to stop a person from defining variables or functions to represent larger pieces of the expression, and we do that with things like u substitutions. But, in most cases, you're still doing as little as possible on a per line basis, that's no different between math and programming. If you're doing more than one thing per line, you run the risk of introducing an error that's hard to track down. But, because a computer can more or less work with an entire file all at once, there's not much point in copying the entire thing down that often.

      When it comes to proofs and theories, you do have somewhat of a point there. The theoretical circles and spheres that math works with don't actually exist, the nearest we've come to a perfect sphere is ever so slightly off. But, math has tools for estimating the error and if you need something that's more accurate than what math provides, you'd probably be running tests and including a larger margin of error anyways. It's why teachers generally get on students about the difference between the domain and the practical domain.

      As for the real world, you probably wouldn't and shouldn't be trying to apply math that way. It's the ability to identify, express, generalize and extrapolate relationships that you'd probably be more interested in. Some of them aren't even expressable using math. Or at least not in any reasonable time frame with what we currently know about math.

    6. Re:There is a huge problem with math though ... by Anonymous Coward · · Score: 0

      Much like a colour blind person can never truly understand the colour differences he (most likely) isn't seeing

      More like teaching a blind person how to paint a portrait. They can fumble around blindly, touching everything with their hands, learning from the mistakes that others told them they made. What I hate the most is the blind leading the blind, with no one truly understanding the issues or the proposed solutions, it turns into an echo-chamber. Many times they seem to also be deaf. You can tell them they're wrong, why they're wrong, and what the real solution is, but they cannot tell the difference between the wrong answers and the right ones, and made worse is the right ones tend to be more difficult to understand, so they are biased towards choosing a wrong answer, of which their are nearly in infinite supply while the right answers are rare. "Told you so" when your predictions happen, while unprofessional, is extremely apt.

    7. Re:There is a huge problem with math though ... by Anonymous Coward · · Score: 0

      Aptitude doesn't really even factor in until quite far along the path. I've yet to meet a student that didn't have some diagnosable learning disorder that couldn't handle at least calculus. And even with learning disorders, they can generally do it, they just need to have the material handled differently.

      It's a load of crap to say that teaching can't change the underlying brain. The whole field of education is literally about changing the underlying brain. If teachers weren't changing the underlying brain, then there'd be no point in having teachers at all. We'd just use the much cheaper books and videos as there'd be no point in customization.

      It's why the traditional approach to teaching math involves so many moving parts being isolated and put together into ever increasingly complex systems. You can't handle calculus without algebra and you can't handle algebra without arithmetic, and you wouldn't deal with multiplication typically before being taught to add and subtract, which in turn you wouldn't learn without being taught to count. Just one example, but you see those all over the place in typical math curricula because that causes the underlying brain to change.

      I didn't personally start out much ahead of the other students, but over time, I've caused my underlying brain to change to make it easier for me to do things related to math. I didn't start out being able to hold entire equations in my head or have a large number of values for my multiplication tables, that was pure work over a prolonged period of time and most people could achieve what I achieved in less time as they're not dealing with brain injuries and learning disorders.

    8. Re:There is a huge problem with math though ... by Anonymous Coward · · Score: 0

      I haven't found any good resources for that. What helped me the most is that the college that I tutor for has some foreign born instructors that use old school math with unknown constants that require subtle tricks and manipulations in order to solve.

      FWIW, they were educated in Russia and China, so, you might find some good problems in those books. Probably won't have any language problems as they should still be written in math rather than the relevant local language.

    9. Re:There is a huge problem with math though ... by Immerman · · Score: 1

      I agree - seems like recently especially we've gone the way of "shortcuts to make doing arithmetic easy", which strikes me as utterly ridiculous. Calculators are everywhere, and do arithmetic faster and flawlessy. Use those for applications, and focus on teaching the basic principles that work everywhere and form the basis for further learning.

      My point with proofs and theories was perhaps badly expressed, it had nothing to do with errors. Math and Science are much more fundamentally different.

      First, lets be clear that calculation has about as much to do with math as spelling has to do with literature. It's relevant, but not really the point.

      Basically:
      Science is a description and depends entirely on experiment - it doesn't matter how beautiful or ugly your description, all that matters is that your experiments match the description within the margin of error of measurements and noise, even in the face of people trying to replicate your experiment to prove you wrong. If you can do that, you should get taken seriously.

      Math though is a language for logical manipulation built upon "absolute truth" (declared axioms) and gains *nothing* from experiment - it doesn't matter if you've done a billion experiments (sample calculations) showing that "New Expression" equals "Old Expression" with infinite accuracy - nobody will care. All that matters is whether you have a logically sound proof that "New Expression" is an inevitable logical consequence of "Old Expression", based on nothing but the handful of fundamental axioms of mathematics.

      If you've ever taken a math proof-writing class you really come to appreciate how every complex concept must be exhaustively derived from pre-validated laws and theorems - which were themselves exhaustively derived from less complicated laws and theorems, all the way down to the original axioms. It does not attempt to describe anything outside itself, except as expressed in the axioms, and can thus be proven absolutely true within the framework of those axioms.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
  34. Don't... by Anonymous Coward · · Score: 0

    "Best practices" Are for cubical code monkeys that bash out generic code. For creative and scientific coding, leave these hindrances out of coding. It is like best practices in painting or music, it stifles creativity. The world is better off with both types of programmers.

  35. Fast learners? by Anonymous Coward · · Score: 0

    I've been working on that for 50 years. 1/2 day might be a bit optimistic.
    You didn't say what caused this class. Is there some problem being solved?

    Basic project engineering skills are good to review. Why am I making this. What does it have to do. How can this be done. Which path is best. Where can I get each piece. When is the best time to add each piece.

    As projects get bigger, respect for complexity is more that useful. Keeping things simple is hard work. Talk about partitioning, interfaces, and abstraction?

    Re-inventing the wheel is easy to do with software and dumb. A good reading list for fundamental algorithms and also major open source components might be nice. How major things work like the Internet, or this web browser.

    Understanding the consequences of your actions. Order notation is nice for algorithm selection, but having a clue of what is under the hood is also. What is a computer, compiler, interpreter, and the speed differences between something in cache, versus in memory, versus on disk, versus on the network.

    Programming languages and tool kits come and go, but there are common concepts that flow from one to the next. Opening this in a 1/2 day lecture is probably hopeless, but at least you could provide some good reading resources.

    (You realize that to even offer this in 1/2 day kind of says that the Computer Science isn't?)

    1. Re: Fast learners? by Anonymous Coward · · Score: 0

      Good summary! Well said

  36. Comments by Anonymous Coward · · Score: 1

    As someone who has to support the code written after it's deployed I would say.

    In your comments, explain what the code is *supposed* to do.
    I can read the code and tell what it is doing now, but I have no idea if that is what it's supposed to be doing or even if it's working as intended.

  37. Design and architecture by Anonymous Coward · · Score: 0

    Read these three books and summarize them for the developers in the order below. It's not everything they need to know but it's a good start. Most people spent way too much time on syntax and language without thinking about design and architecture. Learning to code in any language is easy. Learning to be a software engineer is hard.

    https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

    https://www.amazon.com/gp/aw/d/0137081073/ref=pd_aw_sim_14_2?ie=UTF8&psc=1&refRID=QXDK4PNZSZHE776XZJQ5&dpPl=1&dpID=5154eSTKUxL

    https://www.amazon.com/gp/aw/d/0134494164/ref=pd_aw_fbt_14_img_2?ie=UTF8&psc=1&refRID=QXDK4PNZSZHE776XZJQ5

    1. Re:Design and architecture by Anonymous Coward · · Score: 0

      dcreamer affiliete spam, don't click

  38. Teach the process by jb_nizet · · Score: 1

    From my experience of answering tons of questions on StackOverflow, a huge deal of newbies or self-taught programmers program the following way:

      - try some random thing
      - get an error
      - ask how to fix the code (and not even post the error)

    You should teach them the right process, which is based on reading (a lot), experimenting, analysing errors, making deductions on what needs to be changed, and repeating the cycle:

      - read documentation, before starting programming. You need to understand the big picture and the fundamental concepts before using some technology. You need to know what's in there, otherwise you'll reinvent the wheel or follow the wrong direction. This can take hours, or even days, but will save a much bigger amount of time later.
      - don't try random things (like guessing method names, guessing what arguments to pass, etc.). Read the API documentation.
      - Experiment, compile and test what you did very often. Don't write 500 lines of code before even compiling them. When you have an error, read it, carefully, using your brain. Try making sense of the words in the error. Don't guess. Don't try another random thing to fix the error. Read the documentation again. Make deductions based on observations.
      - Format the code religiously, and comment it, while writing it. Reading your own code is what you make the most when programming. If it doesn't have the right structure, you cannot reason about it. If it doesn't have comments, you'll forget what a method does or what arguments represents immediately, lose time rediscovering it, and take bad decisions based on poor understanding of your own code. Commenting code also makes you realize design mistakes
      - Use good names. Forget about single-letter variables. Programming is not math. If something is a save button, name it saveButton (or save_button, depending in the standard naming conventions). Not s. Not sb. Again, you'll read the code a lot, and good names is what makes it bearable.

    All of this is based on a quite simple competence: reading. Unfortunately, many would-be programmers don't know how to do that.

    1. Re:Teach the process by Qwertie · · Score: 1

      There is so much advice one could give. Here's mine.

      Organization is key - both within a file and across the whole program - to letting anyone else understand your code. At the project level, try to make it obvious how the project is structured by choosing appropriate names and, if it's a large-ish project, break it up into folders in a logical way and provide a readme.txt that tells readers about the main parts of the project, where they are located (files and names of types/classes) and how they fit together.

      Use good names. Method names should be verb phrases if they perform an action, and the name can be very long if it is only rarely called (e.g. DeleteRecordIfOlderThan(...), GetListOfRecentRecordsAndDetectCorruption(...)). In many projects, a function name can be a noun phrase if it is a property (e.g. students() or studentList()) while others always require a verb phrase (getStudents() or getStudentList()). Personally I use a noun phrase for properties (O(1) time) but a verb phrase for queries that return a list (O(N) time) or access a file. Variable names are less important but should usually be more than one letter (except: i and j for index, x and y for coordinates).

      Use stream processing for shorter, more readable code (LINQ in C#, Streams in Java, map/filter/reduce in other languages). More broadly, take advantage of functional programming techniques where applicable.

      You know the Single Responsibility Principle? Well, if you find it hard to give each class or type a single responsibility, at least minimize the number of responsibilities until you eventually figure out how to break things up into smaller pieces. Try to keep individual functions small enough to fit in your head: if it looks taller than the height of your head, it's probably too big.

      Understand big-O notation and computational complexity. Avoid O(n^2) and especially O(n^3) algorithms.

      Modularization, isolation and generalization are important. I think of it as "knowledge compartmentalization of programs": to the extent possible, components of a program should not "know" about other components. Low-level components should be reasonably general, too, so that you could copy the algorithm into a different program unchanged (or with some added functionality, such that compatibility with the first program is not broken). As the joke says: "No well-trained ethically conscious engineer would ever write a 'destroy Baghdad' procedure. He would write a 'destroy city' procedure, and pass Baghdad as a parameter." Or generalize to 'destroy area' and support cities as one overload of the method. Where it makes sense, use type parameters (or not - a lot of these decisions still depend on good judgement gained over years of practice and experimentation). Higher-level code that uses lower-level code should also generally be unaware of how the lower-level code works. Two unrelated modules should be especially unaware of each other.

      Learn about and use dependency injection in nontrivial programs, preferably constructor injection. See also the Ambient Service Pattern.

      Use unit tests and integration tests and understand what they are for (I briefly taught a junior class in software engineering and found that they had no idea what kind of tests to write. If nothing else, your tests should check if the basic functionality of your program work. If your unit tests all pass but your program's basic features don't work, you're on the wrong track.) Eventually, learn about mocking.

      Use different quantities of comments in different situations. Few, short comments are needed to explain what code is supposed to DO. Longer comments are needed to explain WHY the code works the way it does, like architectural decisions. If the same explanation applies in several places, make a design document or long description on a relevant class and

  39. Code workshops by VTEngineer · · Score: 1

    Pick your problem and don't constrain the language. Let them solve the problem and have seasoned programmers critique their code. The best way to learn is by doing and avoiding piques is a good way to ingrain better patterns.

    1. Re:Code workshops by Fringe · · Score: 1

      Not constraining the language is the worst error you can make. New programmers and fledgling developers tend towards the newest bright shiny object... which often cannot really do the job.

      Five years ago, many "developers" who had been at large companies but never a crucial part of an existentially-important project, such as at a smaller company where completing and shipping functional software matters, jumped onto the Node.JS bandwagon for micro-services. Node is single-threaded, doesn't have good type safety and, even with promises, very hard to inspect. It is very portable, but not the correct choice for services. Especially in a CI/CD world.

      That is a case where constraining the language absolutely should have been done. C++, C#, Java, GoLang... many far better choices.

  40. Debugging: one change at a time!!! by Anonymous Coward · · Score: 0

    Amazing how many people make a bunch of changes simultaneously. It is hard to understand the impact of individual items when you change multiple items.

  41. Programming is easy if you already think like one by technosaurus · · Score: 1

    If you are good at identifying problems or inefficiencies, programming is easy. -Most people really can't, it takes practice.
    Good programmers can identify the real problem underlying the problem that is presented to them. Most projects (in any field - not just programming) are poorly specified and don't have well defined requirements. Think of the Obama-care website or pretty much any government construction project.

    If you are good at predicting possible mechanisms for failure, programming is easy. -Most people don't even look or think about it.
    Good programmers will identify safety hazards in their everyday life. This translates into fewer bugs due to anticipated user behaviors and more secure code.

    If you are good at breaking large tasks into smaller, more manageable ones, programming is easy. -Most people get overwhelmed by large projects.
    Good programmer's would make good leaders, provided they had the people skills. Figuring out several ways to split up a task is easy, but determining an efficient separation of tasks based on the resources at hand is more difficult. If you are good at abstract thought, programming is easy. -Most people would rather binge on Netflix than solve a brain teaser.
    Good programmer can follow and improve upon a flow chart, identify the underlying concepts and translate them into interconnected algorithms implemented in code.

    If you know grammar, programming is easy. -More than (not then) half of people don't know (not no) their (not there) grammar.
    A good programmer has to understand the syntax of multiple programming languages, sometimes in a short period of time. If they haven't figured out the syntax of their first language in their whole lifetime, there is no reason to expect that they will ever fully comprehend the syntax of any programming language.

    If you can understand the concepts of mathematics, programming is easy. -Most people have no concept of boolean or linear algebra.
    Good programmers don't need to be _good_ at basic math. In fact it is a hindrance that causes them to work out results in their head (sometimes wrong) and then put some magic number in the code with no comment on how it was derived. Compilers do this for you and the code is more understandable.

    If you are good at making processes more efficient, programming is easy. -Most people are satisfied with the status quo.
    Good programmers will program themselves out of a job and move on to a new problem. If a tedious task can be automated, they automate it. If it can be eliminated completely by other means, they do the multiple hours of work that will save the time over the long run.

    If you are good at comprehending complex literature, programming is easy. -Most people can't put together their IKEA, much less follow a patent or understand a master's thesis.
    Good programmers can read through a complex specification (like an RFC), understand it and translate the algorithms into code.

  42. Maintainability by Anonymous Coward · · Score: 0

    Unless you are writing something quick-and-dirty to do a small task one time, take the time to design but also write your code for maintainability. This means writing code with clarity in mind and adding comments for those instances where you are being "clever". If you revisit your code after having not touched it for a year, you won't remember much.

  43. I'd go with the specifics of being self-taught by Kjella · · Score: 1

    I don't think you can teach then to write "better" code, like the actual ability to break an task into programmatic steps. While you could learn some useful algorithms and patterns that's a long topic and more something you get with experience. What I would focus on is a self-taught programmer has probably mostly worked alone, written all the code themselves and done relatively small projects with a limited lifespan and a lot of greenfield projects where you deliver version 1.0 in the end. This may not be true like if they've been part of a big OSS project, but in general think it's true.

    So the first thing I'd take a round on is developing software as a team, both in terms of process and in terms of code. These days I'd probably just skip the check out/check in and go straight to branch/merge and how to develop in your sandbox, when you got something working you make a pull request or push it to the master branch. The code part would be about interfaces and "edge" documentation, that some might study your implementation but most simply want to call your code and know what to expect.

    As part of this you should also talk about clear and meaningful naming, how your code should not have unexpected side effects and that your code should not expect everyone to understand how to use it correctly. That it's your job to make sure bad input is rejected properly and doesn't crash the whole system, as that's generally not acceptable in a multi-user system or as a small function in a big program. That goes for other developers calling it wrong, bad data from users, other services or hackers and includes writing test cases with both "normal" input, edge cases and bad input.

    Finally you should talk about long term maintenance and running production systems. It goes back to documentation, you got handed down code from your predecessor and you'll be handing down to your successor. Don't expect people will be there to answer questions or explain indefinitely, it can even be you coming back to the same code years later. Requirements change and expand, you need test cases to make sure you didn't break things that used to work. You need to know what code branches are in production and how to patch those in parallel with developing new code.

    I think those are the essentials, there's still the issue if the actual code is good or not but it's like trying to lecture someone on how to be a chef. It needs the right amount of cooking and the right amount of seasoning, sometimes you're plain doing it wrong other times you're just overdoing it. Lectures may expand the toolbox but it takes experience to apply the right tool the right way in a given situation. And there's usually more than one solution, some more elegant than others.

    --
    Live today, because you never know what tomorrow brings
  44. Sytematic program design. by AeiwiMaster · · Score: 2

    A couple of years ago I took a MOOC called "systematic program design."
    Even though I was a self tough programmer and had been programing for 25 years,
    i still learned something new.

    They used this book
    https://www.amazon.com/How-Des...
    I recommend you check it out and google the course name.

  45. well... by Kierthos · · Score: 1

    I'd tell 'em to look at code I wrote five years ago, and then say "Never ever write code this sloppily."

    --
    Mr. Hu is not a ninja.
  46. Good software development by seniorcoder · · Score: 1

    Here are some good practices for developers:
    1. When a bug is reported in a group project, there are 2 types of people.
    1.1 Without any investigation, a developer declares that it isn't his/her problem.
    1.2 A developer who assumes it might be his/her problem and starts investigating.
    I certainly prefer the latter. This isn't about ego, it's about code doing its intended job.
    2. Developing always creates bugs.
    Prolific developers create lots of bugs.
    Developers should not be judged on the number of bugs.
    Instead, they should be judged on the ratio of bugs versus the amount of code they produced.
    A corollary to the above is that good developers create a minimum of code for a given requirement. More code = more bugs.
    Beware of developers who create complex solutions to not-so-complex problems.
    3. If your ego is so fragile that you cannot handle making mistakes, you are in the wrong job.
    As long as you are creating code, you will always make mistakes.
    The key thing is to find techniques/procedures to avoid making the same mistake ever again.
    4. Good developers assume something will go wrong in their code and put in more code to handle "unexpected" scenarios.
    When something fails, it is really good to have it not fail badly.
    5. Test, test and test again. Never assume anything works properly.
    I have had code fail several times after many years in production.
    It took all that time before the circumstances were sufficient to trigger the obscure bug.
    This also ties in with point # 1 above, it is very easy after a few years of success to assume it is bug-free, when it isn't.
    6. NEVER stop learning.
    You can always improve.
    7. With so many opportunities for self-education, learn to choose the most useful ones.
    Learning the intricacies of one niche application will cause you to be good at that job, but what happens if that job ends?
    A resume of widely-used skills is good for employment longevity.
    8. MOST IMPORTANT.
    Love what you do. Take pride in your work.
    If you don't love what you do, find a new job.
    You cannot pay someone to take pride in their work, but you can reward them for doing it.

  47. Armed Computer Science Teachers by Anonymous Coward · · Score: 0

    Learn or die. It's the American Way. Recursion is for the weak.

  48. I wrote a book about it by Anonymous Coward · · Score: 0

    I wrote a book about it, for a very similar purpose as yours, and for good reason: focusing on fixing bugs really seems to clean up programming style faster than anything else.

  49. Re:Ask Slashdot: How Would You Teach 'Best Practic by angel'o'sphere · · Score: 1

    And which of your workshops was the most successful? I like to join it sometimes, perhaps :D
    Well, the pimp thing probably not ...

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  50. Hahahaha, fail by gweihir · · Score: 1

    If you had half a year, it would be doubtful you could achieve much. Half a day is a complete joke.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  51. Sanitize input by schklerg · · Score: 1

    For the love of trump, just sanitize your input!!!

    --
    Be Excellent To Each Other
  52. Be aware that other people cannot read your mind by Anonymous Coward · · Score: 2, Informative
    Before you change anything ask yourself the question "Will this affect someone other than myself?"

    If the answer is "yes":

    1. a) Have you updated the docs?
    2. b) Have you consider users who may be reliant on the old way?
    3. c) Have you considered the people that have to support, sell or market your software?
    4. d) Does the change need to be verbally communicated in meatspace to other people in your org?

    Basically, never assume that checking in code is the final step

  53. Humilty, but you can't teach that by petes_PoV · · Score: 3, Interesting

    we have a vast number of self-taught programmers who have never been taught "best practices"

    Arrrrgh! The worst sort.

    These people tend to be rank amateurs. But with the "experience" that makes them think they are actually professionals. Almost none of them are. And most never will be.

    Most people, even people who make a living from programming, are much worse at it than they think they are. They are impatient, they are hit-and-miss, most can't think clearly and an unfortunate number share in the twin misconceptions that "if it compiles cleanly, it works" and that testing is merely a stage that comes between coding and release to production (and is not there to fix problems, merely to tick boxes).

    Personally I would focus this workshop on the cost of the errors made - and target it at the senior people there. Drum it home that "good" software - best practices is not about how many million lines of code you can write in a day, nor about how complex you can make an algorithm. It is about being able to hand your work off to others and the ease with which they can understand what it does.

    --
    politicians are like babies' nappies: they should both be changed regularly and for the same reasons
    1. Re:Humilty, but you can't teach that by Anonymous Coward · · Score: 0

      I've worked in both environments - self taught academic/scientific programmers and formally trained (college degrees in computer science) professional programming teams. And each have their strengths and weaknesses.

      Obviously the self taught programmers can have some very weird programming styles.

      But the formally trained programmers have weaknesses, too. The key weakness is lack of domain knowledge. Usually good software will have a structure that closely matches the problem being solved. But if you don't really understand the problem being solved then it's hard to have a good structure. And there tends to be a lot of "cargo cult" programming. You'll get a formally trained programmer who is trying to write perfect code who was read that the body of a function/method should ideally be only a single line of code - so the code is this spaghetti of tiny little functions scattered in random places with no higher level structure. And the code reviews are more about pecking each other than improving the code quality:

      TED super-chickens

    2. Re:Humilty, but you can't teach that by ausekilis · · Score: 1

      My best advice for "being a good programmer" doesn't have anything to do with writing code. One of my professors taught us to "define, defend, and attack" something to show you have a solid understanding of it. Another lesson I've learned is to never come to a manager/leader with a problem. Come to them with a problem and at least 3 well thought-out solutions. I've really taken these lessons to heart in my career. Going into a design meeting, concisely and thoroughly explaining the problem and being able to argue the pros/cons of solutions shows a real understanding of the environment and opens up for a productive debate about which direction the code needs to go.

      To that end, it's more than just being able to hand your work off to others. It's about being able to show others *why* something was done - or needs to be done - the way it was done and *how* that is better than the alternatives. This goes way beyond "for loop versus while loop", it promotes learning, discussion and understanding within your team.

  54. Software Carpentry by stevelinton · · Score: 1

    You could take a look at what Software Carpentry https://software-carpentry.org... teach. They cover relatively practical skills like version control, regression tests, etc. which are still a big step forward for many research programmers.

    At a more conceptual level you are aiming towards "abstraction" and "separation of concerns". Self-taught academic programmers are usually quite good at getting individual methods to work, but hopeless designing software so that changes are localised.

    1. Re:Software Carpentry by Anonymous Coward · · Score: 0

      I was going to suggest Software Carpentry https://software-carpentry.org as well, but you beat me too it.

      I thought Software Carpentry used to have a lesson on unit testing but don't see that currently. Some other 1 hr topics ideas I would add if I were doing something like this (probably already mentioned previously), would be the importance of literate programming, meaningful and intentional names and comments, and recommendations for debugging software and fixing errors using a scientific approach (hypothesis, experiment, test, confirmation).

  55. Me code pretty some day by swm · · Score: 1

    Me code pretty some day
    A voice in the wilderness
    http://world.std.com/~swmcd/st...

  56. Software carpentry by Anonymous Coward · · Score: 0

    Software Carpentry is an organisation that recognised the lack of software engineering skills in academic computing and seeks to address it. Their most basic workshop containing the bare minimum is two days long.

    Rather than going through half a day of bullet points barely touching each one, which wonâ(TM)t sink in or hangs behaviour, focus on one thing. Three things to consider that each could be done in a half-day and any of which would be a major boost:
      - The shell and shell scripting (https://swcarpentry.github.io/shell-novice) - academic colleagues who have worked through that have commented on how much itâ(TM)s boosted their productivity
      - Version control (e.g. https://swcarpentry.github.io/git-novice) - this is valuable in areas outside of programming too
      - Software testing - so at least they might notice when their code starts producing wrong results.

  57. The Elements of Programming Style by davebarnes · · Score: 1
    --
    Dave Barnes 9 breweries within walking distance of my house
    1. Re:The Elements of Programming Style by Anonymous Coward · · Score: 0

      More creamer affiliate spam. Don't click!

  58. version control and documentation by Anonymous Coward · · Score: 0

    1. Teach them to put *every* piece of code under version control, preferably something like git. I can't tell you how many times having version control came to my rescue in regression analysis and finding where, when, and who introduced a bug into a code set.

    2. Teach them how to properly document code, and by properly document code, I mean specifically how to document function prototypes -- what does function foobaz supposedly do; what are the arguments to foobaz supposed to be; what kind of values does it return; does it have default values; are there any edge cases you should watch out for? Documentation doesn't have to be "War and Peace" in length, but it does have to be useful.

    3. And to really hammer (figuratively speaking) the point onto their foreheads, introduce them to github.com. Give them the stats on how many projects are hosted on github.com, how many developers, how many languages, how many lines of code, etc.. Point out some of *your* favorite projects hosted on github.com and what the code quality looks like on those projects.

  59. Maintenance and Support by Sesostris+III · · Score: 1

    Get them to work in a support team before allowing them to develop code from scratch. Having to maintain the mess that is other people's code will soon instil an abject horror of those things that should be avoided.

    --
    You never know what is enough unless you know what is more than enough. - Blake
  60. Teaching explicitly what experts hold tacitly by michaelderaadt · · Score: 2

    During the 1980s, there was much research into the psychology of experts and that included programmers. Soloway et al found that experts exhibit tacit problem solving skills that they apply automatically. I completed research work a few years back looking at the effects of teaching such skills explicitly to novice programmers. If you're interested, here's a good starting point... http://crpit.com/confpapers/CR...

  61. Testing by Anonymous Coward · · Score: 0

    If your code is not tested, it will have bugs. If your code is tested, you have ruled out some bugs.

  62. Uncle Bob... by Anonymous Coward · · Score: 0

    I hate his style, but love his message. His programming practices are gold.

  63. Learn sociology by Anonymous Coward · · Score: 0

    You can teach anything, but what is needed is a lot of scientific research to determine what the best practices actually are. Current thinking consists of old IT staff exchaning anecdotes from their personal past experience. This lead to a proliferant of influential software engineering methodologies and no one being the wiser if these actually improve programmers' productivity and/or quality.

    1. Re:Learn sociology by Anonymous Coward · · Score: 0

      Let me teach you how to see a 12D image in your mind's eye. Abstract reasoning cannot be taught, or at least there has been zero known successful attempts. My co-worker is a math and programming guru from MIT, but when I program, I see images that I can't fully describe. I can look at a programming problem and find the answer in seconds or minutes, then tell him the "answer" I see in my head. It can take him a week or two to actually prove my answer is correct. I just see the answer, but I have zero proof it's correct, even though I've never been wrong.

      Because we're in the business of correctness, I'm not very useful on my own because I cannot prove my answers are correct. On the other hand, the people who can, can't come up with answers nearly as quickly as me. Some of my designs, I've been told, are beyond what my co-workers claim they can fully understand. They can prove the answer, but they can't understand it.

      I cannot consciously use abstract reasoning, I perceive it, which also means I cannot explain it to others since I can't even explain it to myself.

      Actually, a small fib. I can explain my reasoning, but at level higher than what I perceive it. It's like explaining a visual scene to someone who has been blind from birth. After talking to some psychologists, sounds like perceiving thought is a common occurrence for those who think a lot about certain things. Like how many great musical artists could perceive the music in a way different than just its sound.

  64. Google "Software Carpentry" by Anonymous Coward · · Score: 1

    We used their resources and people to put on a series for LANL scientists. That was the initial impetus for this organization back in 1998. They have lessons freely available under the Creative Commons license. I recommend them.

  65. Code reviews by Anonymous Coward · · Score: 0

    Review all code they write, bitch about every bad practise they do, but also tell how it should be done. Review also to changes they do when they fix the errors, as at first those will also have mistakes. If you have many people to educate, write a list of common mistakes and answers to them to save your time. At the beginning, expect something like 20 mistakes per review. Always explain what are the benefits of doing something the way you say.

    I tested this with about 200 developers. After about a month the amount of mistakes drops dramatically.

    Pros:
    - It is impossible for them to hide that they don't learn something as you see the mistakes yourself.
    - Most common errors in your situation are educated first and most often, making it most efficient educational tool to your scenario.
    - Single person can quite easily educate about 200 developers if done as a full time job.
    - No risk of wasting time. If someone already knows how to write code, this will have no effect on them.

    Cons:
    - Rare scenarios might be left uneducated completely. If you want to cover these, you need to give people assignments or similar to see how well they behave in those scenarios.

  66. Hackers by Anonymous Coward · · Score: 0

    Write all input processing and file processing as if a hacker was trying to get in. Users WILL do the stupidest things to your program. So put in lots of input verification. Lots of error trapping code (try/catch). Pretend that the user has deleted the file you are in the process of reading it, and trap for it. Got a text file for configuration (XML)? Pretend that the user likes to change an e to an i in random places.

    Remember, no program is foolproof as users are ingenious!

  67. You could look it up by discowriter · · Score: 1

    How To Become A Hacker, by Eric S. Raymond http://www.catb.org/esr/faqs/h... There's other stuff by ESR, like The Art of Unix Programming: http://catb.org/~esr/writings/... But essentially, I think you'll find the first web page gives you a good start.

  68. Help Them Understand Why by Anonymous Coward · · Score: 0

    I'm of the belief that the best teacher in the world is yourself. I think the more important challenge here is helping them to see that having best practices will make their lives easier. If you succeed at that, there'll be nothing you could do to stop them from learning them.

    For the goal of teaching the value of best practices, I'd do code reviews of their own code, talk about stuff that wasn't done right, what best practices would make it better and then have them add a feature to a version of the code that had been cleaned up and that same feature on the original version.

  69. If only someone had tried before. by Anonymous Coward · · Score: 0

    Do a public reading of the pragmatic programmer.

  70. think about the box by stigmerger · · Score: 1

    In my humble opinion, the gown-up way to think about a programming problem is to consider how it will perform (scalability, bottlenecks in network/memory/storage/etc), how it will be maintained (who will have to read and understand it, including a realistic understanding that it will look completely unfamiliar to you yourself in a year), where it will have to run (portability), how much time you have to write it, how the discoveries you make along the way will affect your collaborators, whether there will be opportunities to optimize later (and how much effort is appropriate to be prepare the ground for those efforts), etc.

    There are trade-offs in balancing all these issues; there's a difference between a quick one-off to assess a problem, versus a tool that may eventually see production use but only accessed by sys-admins, versus an application, versus a proof-of-concept, versus an exploration of constraints on a solution, etc.

    Pick the combination of trade-offs that will let you finish in the amount of time that you have, divided by pi, because it's going to take longer than you thought. There will be emails, meetings, surprises, changes of goals, etc.

    When you start coding, try to get as quickly as possible to enough of a framework that you can explore the parts of the problem that are most challenging. In other words, answer the biggest questions first.

    Try to maintain the attitude that you are a well-intentioned but fallible human who is attempting to solve the problem with the mix of trade-offs selected above, who expects to make some mistakes and is willing to make adjustments to respond to them. Expect that others will also see the problem differently, as they learn along with you about the problems you uncover.

  71. Best practices are meaningless without buy in. by Anonymous Coward · · Score: 0

    First, teach management why best practices are important and to require them, then worry about programmers. It does not matter who knows about best practices if there is no incentive to use them. Now go finish patching this bug ASAP and push it to prod before you go home ;)

  72. Consult "Uncle Bob" by vk2sky · · Score: 1

    You could do a lot worse than getting them to watch any video (or read any book) by Robert C Martin.

    1. Re:Consult "Uncle Bob" by Anonymous Coward · · Score: 0

      Mod parent up, please. Uncle Bob has really good ideas for making your code more SOLID.

  73. Maintenance programming by Anonymous Coward · · Score: 0

    Put them on bug fixes and minor enhancements for a year or two. It is very educational. I learned fast what crappy code looked like. That and to break their spirit ðY

  74. Block Stack Overflow ... by Anonymous Coward · · Score: 0

    Block Stack Overflow and all other places the programmer can copy and paste from.

  75. Avoid cargo cult programming by The+Evil+Atheist · · Score: 1

    The ideas of "best practices" and "design patterns" lend themselves to cargo cult programming. So let them be aware of best practices and design patterns, but what you should teach is that you should keep refining code until either the deadline runs out, or there's nothing left to remove.

    --
    Those who do not learn from commit history are doomed to regress it.
  76. A couple ideas by JoeCommodore · · Score: 1

    I would say the first best practices is to make code easy to read. That would include:
    - Syntax formatting all the indents and whatever case things are popular for variables, globals, functions, etc.
    - Breaking out of command packing lines, Indenting, how you present opening and closing brackets/braces/parenthesis
    - Descriptive naming of tables, fields, variable, functions, etc.
    So when you are done comments wont be apologizing, but just augmenting what is apparent. Once much of that is done class should start to recognize where things are messed up because... they still are kind of messed up.

    How to teach it? Easy, take some part (or a few parts, not to pick on one person) of existing code your team already has and go through formatting and then some refactoring to improve readability (assign better fields, variables, etc.) as it becomes more readable I would hope your team would see and suggest things, and maybe have an end product of the lesson that inspires them to spruce up the rest.

    Second, train them to use what you make, if you can get sample input and have the programmers actually try out the end-user processes to input forms, use collection tools, etc., on a sample data, reports, etc., they may realize that they could do some things better to make the system more efficient, and/or the end users job easier, or make the data more useful. Just getting the requirements and the user story doesn't do the same as trying to actually use what you make.

    How to train it? You can relate the story of Bill Gates and Satya Nadella trying to install, configure and use Windows 8, I'm sure that was a pretty sobering time for them, happens on all kinds of software..

    --
    "Enjoy what you're doing! If it becomes drudgery, you're doing it wrong!" - Jim Butterfield
  77. How Would You Teach 'Best Practices' For Programme by Goondra · · Score: 1

    That totally depends on the domain of programming. I am a scientist and program mathematical expression for physics. I don't do Web programming. Hence 99% of what people call programming I do not. I do not use C or any of its derivatives. I follow the School of Niklaus Wirth. "Make it as simple as possible, but not simpler" A. Einstein. A procedure is specified with the word PROCEDURE, not some hard to see syntax ala C. Best practices entail using MODULEs, TYPEs, VARiables, CONSTants. The language I use (Component Pascal) has built in garbage collection so no need for a deallocation routine. It is strongly typed. With C if you can get your code to compile you are only 50% done. With Component Pascal if your code compiles you are 80% done. Text editing and code development are woven together with the BlackBox development environment of Component Pascal. The carat is placed at the character where the error is detected (not just at the start of the line). That makes debugging very efficient. The compiler is very fast so quick error correction can take place and one just walks down through the code making corrections. That whole environment is very different from what most of you experience and consider "best practices".

    --
    DGDanforth
  78. "UML Distilled" book by Martin Fowler by mich.linux.guy · · Score: 1

    Get a copy of a small book called "UML Distilled" by Martin Fowler. Analysis and design are the keys to a successful software project. Read it; live it.

  79. Information is out there, Just not popular by Anonymous Coward · · Score: 0

    Best start is reading Kernighan and Plauger's "Elements of Programming Style".
    The rest is a combination of logic, math, and diligence both in programming and dealing with other people.
    Understanding that your program should be maintainable if all the people involved in developing it got hit by a bus is key. This gets into development prior to programming but isn't a popular platform any more.

  80. Odd that no one afics has mentioned the most impor by Anonymous Coward · · Score: 0

    Know what success looks like.

    As in, knowing what your program(s) are supposed to do, knowing when they do that and only that.

    The rest, well, buzzwords wrapped up in buzzwords.

  81. Sanitize your inputs!!! by Anonymous Coward · · Score: 0

    There's a reason sql injection is still the easiest way to compromise an application.

    And buffer overruns.

    etc.

  82. Sort out your infrastructure first. by Anonymous Coward · · Score: 0

    Before working on any functionality at all...

    - put in a source control tool
    - put in a configuration control tool
    - decide on a coding standard
    - put in place a tool to enforce code review practices
    - automate the build
    - automate the unit tests runs based on a passed build
    - automate the functional tests runs based on passed unit tests
    - automate the deploy based on passed tests
    - automate the documentation generation

    Only then think about writing any functionality.

  83. Think like a hacker by manu0601 · · Score: 1

    If you want to write good code, do not think like a programmer. Do think like a hacker, and try to imagine how your code could go wrong.

  84. Re:Programming is easy if you already think like o by i.r.id10t · · Score: 1

    All of this.

    But as a self taught programmer who works in education I'd love a half day or full day of hands on learning of how to use git and other version control systems

    --
    Don't blame me, I voted for Kodos
  85. Address The Lack of Formal Training by brian.stinar · · Score: 1

    This workshop's intention is to address this lack of formal training. Why not provide them with formal training (CS degrees?) if you want to address their lack of formal training?

  86. These are other science people, right? by russotto · · Score: 1

    For professional programmers, the most important skill is sniffing out unnecessary work (requirements that will be changed) and putting it off. But if we're talking scientists using code in their work.... 1) Learn to name your variables. No, nobody knows what "d2" is, and knowing it's "delta sub 2" doesn't help much either. Yes, I know your papers are filled with random symbols that are never explained and no one will call you on because they don't want to look stupid, but that's not proper practice in programming, unless you're a Real Programmer. And you're not; the last Real Programmer died at his terminal in early 1999, when he figured out he was going to get the blame for all the Y2K bugs. 2) Subroutines, methods, functions. Yes, you too can use these. Cutting and pasting code and changing variable names instead... not a good idea. 3) Tests. Yeah, you're going to need them. Or you're going to have to retract that paper because your code had a bug and your results were an artifact. 4) Beware loss of precision. Scientific programmers have spent a lot of time thinking about this. You will too. 5) Source code control. Learn to use it.

  87. Hire an experianced programmer to teach them. by Anonymous Coward · · Score: 0

    Often, some trainer with limited real world experience is used. Hire someone that has been in the industry, and has a ridiculous amount of real world experience. Don't be cheap, and realize that your investment in getting the right person for the job will pay dividends.

  88. Variables by Anonymous Coward · · Score: 0

    When to use heap vs stack vs globals vs when to pass things as a parameter
    Multiple error handling in functions - nested "if success" vs goto fail, etc

  89. Never forget; itâ(TM)s also a people problem by Mirvnillith · · Score: 1

    Even if embedded there are coworkers, project/process people and users. All system interacts with the human world so there are always expectations, written or otherwise. Accept that the value produced by your code is linked to this messiness and try to bridge the gap. Not only do they need your help to solve their problems, they often also need you to help them define their problems (and will often not even like you doing so).

  90. lef to right by Augmento · · Score: 1

    easy walk them through this poster from left to right https://uk.sans.org/security-r...

  91. From personal experience by Undead+Waffle · · Score: 1

    Having dealt with a lot of code (and programmers) who came from other backgrounds (EE or math), here are the top things I would try to teach them:

    1. Data structures and interfaces. Too many of these people create a sea of global variables and functions that manipulate them in difficult to follow ways. Discourage global variables in general except for constants because they WILL abuse them. If you get them thinking in terms of data structures and interfaces (and thus subcomponents of the problem) it will hopefully lead to clean(er) code. Or at least code that can be re-factored later without affecting the rest of the system when they make a mess. Of course, falling into endless layers of abstraction is the opposite problem many CS people have. But if you get good at coming up with data structures and interfaces everything else follows.

    2. Understanding the long term effects of their decisions. Hard-coding something might not be a big deal if it's easy to change it later. But some decisions are very difficult to change down the road. Identify them and spend your time accordingly. Consider risk mitigation strategies in these cases, such as prototyping. Experimentation is ok as long as it's done in a low-risk manner (maybe you shouldn't tell them this part). But it's good to try ideas out before committing to them too hard.

    3. Try to understand root cause when you run into a programming challenge. I often see what I call a chain reaction of bad decisions. For example, people who don't use IDEs (usually those dirty emacs users) tend to write very large files because managing multiple files is exactly what an IDE is for. Since their files are so large their functions become large because it's difficult to navigate subroutines and helper functions with such a large file. Because of this they end up with a lot of nesting and copy-paste code. Next thing you know they want to change the indentation to 3 or 2 spaces so they have more room with all this nesting.

    4. Communicate with your team. Everyone has different ideas on how to do things. If you don't communicate you will end up playing tug of war over competing approaches. Talk and sort it out before you try to force your plan onto everyone else. Approach those conversations with an open mind, LISTEN, and leave your ego at the door.

    1. Re:From personal experience by DutchUncle · · Score: 1

      this++. EEs are trained to instantiate rather than abstract; if they need two UARTs, then they need to put two chips on the board, so they expect to cut-and-paste-and-modify two copies of the UART code for the two devices. If they understand the concept of a subroutine, they pass in "1" or "2" and have a zillion "if" statements choosing between the two UARTS. They do *not* understand the idea of one subroutine using a pointer parameter with all of the code being identical - even though that's pretty much how the chips work (that is, they're identical parts, just addressed differently).
      And don't get me started on global variables vs. power/ground planes. EEs think global availability is a *good* thing.

  92. Re:Ask Slashdot: How Would You Teach 'Best Practic by Aighearach · · Score: 1

    Half-day workshop on Thinking Like a Pimp, targeted for theater beginners.

    1 hour vocabulary study with dialog practice.
    1 hour study of misogynistic tropes with role-playing exercises.
    [break]
    1 hour of gait study and exercises
    1 hour of costume study

    Method study not recommended.

  93. Learn English by Anonymous Coward · · Score: 0

    Documenting code is important.

  94. Test Driven Development by nowwith25percentmore · · Score: 1

    Test Driven Development is the single skill most worth teaching because: 1) it provides the programmer with an explicit feedback loop that tells them if their code is functionally correct (no matter how poorly the product code is written) 2) it forces the programmer to write the code in a way that it can be used sanely 3) it forces the programmer to decompose the software into small pieces (and decomposing a problem it one of the most important tools in a programmer's toolbox) 4) the tests effectively document the product code 5) the tests give them the freedom to go back and make iterative improvements on the code; iterative improvements both a) facilitate an immediate self-learning process and b) enable the application of improvements learned later on.

    1. Re:Test Driven Development by Anonymous Coward · · Score: 0

      Yes! In addition to TDD: - Reuse, reuse, reuse. Always fault on the side of using existing tools, even if it means you need to work a bit to be compatible. And during design, design components for reuse. - Don't swim upstream - it really isn't all that interesting to be "unique". Learn from patterns that exist and use them. It is unlikely that what you are doing has not already been done.

  95. what is being programmed? by Anonymous Coward · · Score: 0

    Creating some really complex algorithm requires an understanding of math. However, I would argue the vast amount of work out there deals with business logic and integration so teaching SOLID principles, instrumentation, team work (agile, business), business scenarios, cloud concepts (different way of thinking), tech-debt, code-tone. I know everyone wants to create some really useful tool or algorithm that gets accolades the world over, but it's more likely that you will work on mundane items initially.

  96. It's harder than it sounds by Anonymous Coward · · Score: 0

    Make them do some code, review it and explain things in depth showing consequences, etc. Lots of developers care about best practices but don't understand them. I can't tell you how many times I've looked at code and 90% of it is useless. I ask time and time again why this, why that and the answer is always "best practice". Best practices are dangerous because they can very easily become mandatory practices that you do all the time. Half the people preaching best practices are really just control freaks that want to make you do things you don't have to and that doesn't help.

  97. 2 things by travellingkiwi · · Score: 1

    1. Where are the logs? 2. When this goes wrong in the real-world, how will you explain what happened, with proof, when you don't have access to the machine it was running on. 3. Before you get to teaching a language make them do everything in pseudo code.

  98. maturity models can capture many things by lcall · · Score: 1

    At my last job there was an internal wiki with best practices captured in a handful or so of maturity models (MMs). Much work from senior engineers went into those, and the QA group asked teams periodically to report a consensus on their working level in each the various models, and then those simple metrics (like a number 1-5 per model) were captured on a simple dashboard per team, and made available on the wiki for everyone to see. There wasn't always a lot of management pressure to be at a certain point--reaching goals was the higher priority--but most or everyone wanted to do a good job, and the MMs seemed very helpful.

    MMs covered topics like i18n/l10n, testing, continuous deployment & operations, and probably others like design principles and technology choices (like how well they were using web services or something). (There were also clear standards and expectations about language choice etc--so we could move across teams more easily as priorities and projects evolved.)

    Each MM topic had a landing page in the wiki, with a table, showing across the top the maturity levels (0=do nothing, 1 might be ad-hoc, ~5=doing it all and optimizing/improving the maturity model's effectiveness/usefulness), and on the x-axis (down the side) were sub-aspects of the general topic, and text in the table describing what it is to be at that level, for that subtopic, and then text on the rest of the page for discussion, instruction on when or why something fits or matters, and references to learn more. Maybe there was (or should be) something about MM maintenance and removing parts that are no longer useful. Of course the wiki should preserve the discussion and history. (There was also a recognition program for developing skills in certain areas, where the topics, levels, and learning resources were written down and somewhat evolving, study groups sometimes formed, something like the maturity models, and evaluators were tech managers or designated staff from across all the teams).

    For code quality and reviews, I had started some writing and early discussions to add another MM on that topic. Really my motive was code quality/maintainability, using code reviews as the main mechanism. Level 1 would be ad-hoc but at least something by a teammate before committing to the master branch (I think everyone was already at this level), and other levels would start very simple (to not put someone off who really just doesn't want to think about it right now), including things like using a simple checklist (search the web for the "checklist manifesto"), checking for clarity and maintainability ("would you want to maintain this?"), if code is properly tested, if code comments explain *why* when necessary, if any documentation needs to be kept current, if another team or area needs to be notified about the changes that affect them, standards compliance (ie, with the team's expectations relative to the other maturity models), reviews should be asynchronous (if the reviewer needs you to walk them through the code for the review, how do we know they can understand it when it comes time for maintenance??), doing at least a quick self-review before asking a teammate, ongoing improvement, etc.

    I also advocated that every team team should have a wiki page listing the things they maintained or directly related to (ie, when joining a team, what systems do I care about getting up to speed on), and that each project should have a page (from a template you can just copy/paste and fill in or type "n/a", the "10-minute" documentation solution for any system). It included things like: where is the source code, who are the customers, generally what does it depend on, how is build/testing/deployment done, where does it run, what backups are done and who, and a few other things. I just hated having that info only in the minds of the few experts, as it made it seem like depending on individuals and not a well-run team working together. Probably each team should also summarize in the wiki their team-level expectations and practic

    --
    A Free, fast personal organizer for touch typists: onemodel
    1. Re:maturity models can capture many things by lcall · · Score: 1

      Other good things to consider in a peer code review (or self-done code-review) are reflected in other comments here. Some are: "will it have unintended consequences later", does it need design work?, does it create technical debt and if so when should/will it be paid?, etc.

      I started making personal checklists for when I learned lessons or got burned by a mistake, different process steps, and reviewed them more until they became habits, then less often. Something like the "anki" software does with learning other topics--reminders until something is more habitual.

      --
      A Free, fast personal organizer for touch typists: onemodel
  99. Software Design Principles by tbannist · · Score: 1

    You should probably start with Software Design Principles:

    DRY (Don't Repeat Yourself)
    KISS (Keep It Simple, Stupid)
    YAGNI (You Ain't Gonna Need It)
    SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation, Dependency inversion

    Then plan on having a lot more of these meetings, because you should not be able to adequately cover these principles in a half day. Afterwards, you should probably also have meetings on coding standards, methodology (waterfall, agile, or whatever), testing process (test driven, or whatever), writing good unit tests and writing bad units tests (ie. what not do do).

    Shaping self-taught programmers into professional developers is not a one day process. You'll probably also want to implement a peer review system if they're going to be working for you to enforce the standards and sanity checks that you'll want to implement.

    --
    Fanatically anti-fanatical
  100. Weinberg by Doctrinsograce · · Score: 1

    Begin with Gerald M. Weinberg's "Psychology of Computer Programming."

  101. Have worked in similar environments by werepants · · Score: 1

    I've worked as a developer in similar environments - where there are a lot of smart people with a background in math, physics, EE, or aerospace, who've googled their way to a moderate level of programming proficiency (they can probably hack together a script to do just about anything) but have zero understanding of code style, modularity, maintainability, or quality.

    Some of the things that I wish everybody understood:

    Very basic ideas about rules of thumb and sniff tests for maintainability and readability - avoid functions with 30 arguments, maybe? Try to identify discrete pieces of functionality and organize your code that way for easy reuse. Break up a few of those 500-line functions, mmkay?
    Regression testing and unit testing. How, when, where, and why.
    For the love of god, please comment. Also, HOW to comment (document data, document the WHY of your code)
    Profiling. Actually measure your shit and understand it before you launch a 1-year-long ground-up rewrite, where you repeat all the same mistakes.
    Style guides. The fast and easy way to prevent ocular injury in the workplace.

  102. Starter kit for best programming practices by Anonymous Coward · · Score: 0

    As a first step it would be useful to have a best practices template to follow. The IEEE Computer Society is the custodian and promoter of the "Software Engineering Body Of Knowledge" which has been created to provide a solid grounding for the "craft" of programming. For programmers and developers NOT to refer to this resource prior to picking up their pencil, stylus or mouse click is to miss out on a very credible resource that can prevent buggy code and misguided solutions. Give it a try...

    1. Re: Starter kit for best programming practices by Anonymous Coward · · Score: 0

      Not really an anonymous coward... Just an old Phart with a lot of miles on the treads that is tired of constantly having to wrestle with login procedures. If you want further comments based on real scars I can be contacted at John at maynestay dot com anytime for the full meal deal... Cheers

  103. Software Carpentry by Anonymous Coward · · Score: 0

    https://software-carpentry.org/

  104. web design resources by oloutt · · Score: 1

    When I first got started designing websites, it seemed like there were endless possibilities. But everything changes and it's vital to stay afloat with the latest web design trends. Resources like https://studioblackbelt.com/ . This resource offers neat tools and resources available that could seriously speed up the web design process

  105. Design Patterns and SOLID principles by Anonymous Coward · · Score: 0

    Cover this stuff:

    https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
    https://en.wikipedia.org/wiki/Software_design_pattern

    Languages and IDEs have a tremendous number of features you can learn, but for software design it’s more important to know the principles and patterns for software development that masters of the art have originated. Memory and pattern recognition matter more than creativity. OO business software development is about building models of reality using a mental tool bag of design patterns and according to a set of design principles.

  106. Mark Twain described some useful approaches by DutchUncle · · Score: 1

    Mark Twain's essay "Fenimore Cooper's Literary Offenses" saved me from a high school English paper. His opening thesis also turns out to be prescient regarding software design, if one replaces "personages" in a "tale" with the variables or objects in a software system.

    There are nineteen rules governing literary art in domain of romantic fiction -- some say twenty-two. In "Deerslayer," Cooper violated eighteen of them. These eighteen require:

    1. That a tale shall accomplish something and arrive somewhere. ...
    2. They require that the episodes in a tale shall be necessary parts of the tale, and shall help to develop it. ...
    3. They require that the personages in a tale shall be alive, except in the case of corpses, and that always the reader shall be able to tell the corpses from the others. ...
    4. They require that the personages in a tale, both dead and alive, shall exhibit a sufficient excuse for being there. ...
    6. They require that when the author describes the character of a personage in the tale, the conduct and conversation of that personage shall justify said description.
    9. They require that the personages of a tale shall confine themselves to possibilities and let miracles alone; or, if they venture a miracle, the author must so plausibly set it forth as to make it look possible and reasonable. ...
    10. They require that the author shall make the reader feel a deep interest in the personages of his tale and in their fate; and that he shall make the reader love the good people in the tale and hate the bad ones. ...
    11. They require that the characters in a tale shall be so clearly defined that the reader can tell beforehand what each will do in a given emergency. ... In addition to these large rules, there are some little ones. These require that the author shall:
    12. Say what he is proposing to say, not merely come near it.
    13. Use the right word, not its second cousin.
    14. Eschew surplusage.
    15. Not omit necessary details.
    16. Avoid slovenliness of form.
    17. Use good grammar.
    18. Employ a simple and straightforward style.


    I encourage perusal of the original: http://twain.lib.virginia.edu/...

  107. "Never underestimate naivete or maliciousness" by PrivateNotCoward · · Score: 1

    "Just because you can does not mean you should...." "Oh, look here: I can make this nuclear power plant fail, going core-melt-down, by deceiving these sensors. Let's see what happens!" Chernobyl, anyone? Fukushima? Only remotely caused, not natural or on-site disasters? "Well, they should have prepared for that. Sucks to be them." But maybe you and your family are "downstream" from the disaster? Somewhere, somehow, some time, some user will enter something that simply never makes sense. "Nobody would EVER do that!" Except they just did. Most likely: they are naive do something the programmer NEVER expected. Perhaps they were just trying to get through the "forms" or "input" or whatever and just chucked "some" value in the input blank to get the job done. More likely, they are malicious, trying to find failure modes using bots, fuzzers, and all those tools, free-for-the-download for the naive and malicious to use. Somebody else said it, but "NEVER underestimate bad taste and human stupidity." (To which, I respectfully add: "laziness and maliciousness". Every time I hoped for a better outcome in the past 40 years, I've been proven oh, So WRONG.) Yes, they will use meta-meta-meta-codes to exploit your program. Reject them and give an error code to whatever called that function, script, or program. Spreadsheets are not databases, although a self-taught "developer" used them as such. (He understood spreadsheets but had never beheld a normalized, rational database. But it showed pretty pictures. I cringed. He built a business on it. Somebody help them all?) Define the job, then find the correct tool(s). Protect those tools from misuse: ALWAYS type check AND range-check your input and use "safe" memory allocation and output functions. "If it doesn't fit, you must reject." from Hard-won experience. I set coding standards for a utility company and input (type / range) checking for a rather large organization, just protecting the little projects I happened to enjoy.

  108. Communications skills are everything... by wild_berry · · Score: 1

    It's not about programming: engineering reliable computer systems is about how you work with the organisation and people around you to deliver, to prove you've delivered, and to keep alive your system.

    If you don't understand your code well enough to teach it to anyone -- especially those less technical, educated or experienced than you -- you don't pass review.

    If you don't practise for critical incidents -- which firefighters and emergency-response teams do -- you'll make that unexpected bad day a whole lot. Be ready, spend time to be calm, prepared and (above all) practised.

    If you're fire-fighting -- and people love to praise a hero -- then get yourselves enough time to reflect and learn from what's going on. Trust your colleagues, because almost nobody shows up to intending do a bad job, to find out and prevent re-occurring mistakes.

    It's great that your planning, design, implementation, testing, deployment and monitoring can react in an agile way to changes in your business needs, but doing that with sporadic and ad-hoc meetings is extra strain on your team. Make the meetings routine and clockwork so that it can be low-exertion in contrast to the creative work of documenting the failure modes (in test cases) or designing the interaction, moving parts of the system.

    Learn from history:

    • The team that brought us everything-is-a-file paradigm of Unix got together later to think of the next iteration for networked computers. The pattern of small services responding to inter-process communication passed through message buses, so your containerised services can be daisy-chained together to provide your software-as-a-service, is an echo of the microkernel of Bell Labs' Plan 9 From Outer Space with its paradigm of every-app-is-a-server.
    • Mainframes had time-sharing and many programs running for a wide range of users back when there was 'maybe a market for six computers worldwide' (IBM's Thomas Watson), which enterprise virtualisation and cloud service providers are reprising today.
    • 'Your shipping software is your org chart' is a paraphrase of a 1967 piece of wisdom my Melvin Conway; Conway's law reads: "Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure."
    • Amdahl's Law for the limits of parallelism and how organising work to get speed ups from the embarrassingly-parallel bits has echoes in team structures where organising the work can dominate time spent in place of completing the tasks ahead of you.
  109. Declarative code, naming, testing & refactorin by whatUsay · · Score: 1

    Declarative code and sensible comments. Unit and integration testing, which helps to refactor and change the code. Refactoring often, reviewing their own code and code of their peers. The code should be understandable to other human beings. It should be well tested so that when changed, the important functionality wouldn't break without notice.

  110. Debug someone else's code by bigtech · · Score: 1

    When I was first starting, most of my time was spent keeping code written by the prior developers working. The main affect this has had on my development, is to write to the logs frequently. In particular, I want the log to reflect what it is the code is trying to do, anything about the state of the system that would help, and obviously the details when it fails.

  111. Rules I try to live by by Anonymous Coward · · Score: 0

    1. Make it work, then make it pretty
    2. Think like a user. Think like a user that will have to use your solution. Think like a user that will have to use your solution 100 times a day.
    3. Ask why? Why do you they want this change? What problem is it solving? Users typically bring you their idea of one "solution", i.e. can you add "due date" to this report? Sure I can. but why do you want "due date" on that report? Oh, so I can export it and calculate if a widget is nearly overdue, so I can email the customer to let them know. Uh, ok, we could do all that .... or how about we just email the customer a reminder automatically?
    4. Don't copy and paste code to reuse it ... refactor it.
    5. Don't sprinkle hard-coded values throughout your code, replace them with constants
    6. Don't build logic into primary keys

  112. Re:Ask Slashdot: How Would You Teach 'Best Practic by ruir · · Score: 1

    Any woman that uses the word misogynistic loses instant credibility, any man is a mangina.

    The opposite of feminism is machismo, no more, no less.
    You are an hopeless baizuo.