问:
Resume dilemma for professional job
On my resume, I list myself as having "7 years of hands-on experience programming in C".

To clarify, I am a self-taught C programmer with some college courses thrown in the mix. I've worked on some small personal projects, and I consider myself to be more competent than a Computer Science grad with no actual real-world experience, though by no means am I anywhere near being an expert.

The issue is this... I keep getting calls and emails from recruiters that see my resume on job sites, inquiring about my interest in senior developer positions, contracts, etc., of which I feel that I am completely under-qualified for. My resume only has 3 years of work experience listed (which is all IT stuff), so when they ask about my prior experience in C, I have to clarify that it was personal work, not professional work.

I'd really like a job as a developer, but I don't want to get hired for something that I can't handle, nor do I want to misrepresent myself while trying to show off my strengths. I deliberately chose the phrasing "hands-on" to imply that it wasn't professional. How should I phrase my C experience on my resume to clarify it better?

答:
I would leave your experience as you phrase it now. 3 years work experience and any personal projects you think are most relevant to the job you are applying for!

To be honest, it is not in the interest of any company to hire you for something you "can't handle", also "personal work" is just as important as "professional work". I think the fact you are doing "personal work" shows that programming isn't just a job to you, which many employers see as a good thing!!

My advice would be to go along to any interviews recuiters send you for, because when you think about it what have you got to lose? If nothing else you gain the experience of interviews and what companies are looking for, so you can develop your skillset further to reach your goal!

Good Luck

Title: Resume dilemma for professional job


问:
Should I use acronyms when listing technical jargon on my résumé?
I'm wondering if I should use acronyms or initialisms when I list technical qualifications or mention specific technologies on my résumé or CV.

For example:

Entity Framework vs. EF vs. EF (Entity Framework)

Graphical User Interface vs. GUI vs. GUI (Graphical User Interface)

Is there a reason to prefer one version over another? Is it better to be as clear as possible, companies view not using the correct acronym a sign of lack of knowledge about the subject?

答:
CV (Resume) searches today are performed exclusively by searching for keywords. So, the general rule of thumb is to never miss an opportunity to include in your CV any terms, keywords, buzzwords, etc which stand for technologies that you are familiar with, (and that you care to be hired to work on,) and to list them in all possible long forms, short forms, synonyms, abbreviations, etc.

The good news is that each one of those forms only needs to appear once, and it needs to appear somewhere in your CV, but not necessarily in any prominent place. So, in the prominent places you should use the most appropriate terms (GUI, not Graphical User Interface, but Entity Framework, not EF,) and then hidden within the details you should expound on the jargon.

By the way, when you feel you need to use both the long form and the abbreviation of a technology, the convention that a teacher of English would recommend is first the spelled out version, followed by the abbreviation inside parentheses. From that moment on, the teacher of English would recommend, you can continue using the abbreviation.

ContentLicense: CC BY-SA 3.0


问:
How can a programmer keep up with the hardware world?
I think that it's safe for me to assume that many, if not most, programmers are quite enthusiastic about computers, and even electronics in general. Now, I realize that a programmer should first and foremost keep up with the programming world, which is a difficult task in and of itself: with new languages and methodologies making their way into the fray every year, there is never a shortage of interesting things to learn about and try out.

Yet, the hardware world is also advancing very quickly, and is also highly interesting, I'd argue. I recall days when I would study the newest chipsets, CPUs, compare the popular (and not so popular) manufacturers, and read up on specs for my favorite graphics cards. However, since that time, I've stopped keeping up with the hardware that is being developed, and have instead focused my studies and attention on, well, programming.

I still intend to focus myself on programming, by and large. But, my question is, are there efficient / effective methods or learning resources that would make it easier for a programmer to keep up with the latest hardware, if only in a minimal way?

答:
I have found that I need to keep up with the latest in CPUs, video boards, OS and other technology only when it is important for the job. If I am focusing on how to get the best out of a piece of hardware, then I have to become an expert in that hardware and topics related to the hardware.

Many years ago my task needed open GL, so i tended the think about what calculations could be done on the board, to relieve the stress on the CPU.

When I was a GIS programmer, I didn't have to worry about hardware.

Now in my small company I am the software developer, IT support, and admin on the cloud server...

You find your sources (blogs and other web articles) though basic research. You keep up to date, until the need is no longer there. The toughest thing may be starting...or stopping after the project ends.


答:
Quick answer:

If your job involves providing customers with complete solutions (hardware + software) then you should keep up to date with stuff, in a place like Reddit/Technology.

If you are a bona fide programmer, all you need to do is just keep taking a periodic look at the stuff that are best sellers at any major computer store. If it ain't there, it ain't worth knowing. (*1)

But if you are a Computer Scientist, you do not even care about that. Computer Scientists scorn hardware and only deal with purely theoretical concepts. (*2)

(*1) Besides, you don't want to know much about the latest and greatest, because then you will know what your employer could have bought for you so that you can do your job better, but hasn't.

(*2) Dictionary definition: Hardware (noun) The part of a computer that can be kicked.

Title: How can a programmer keep up with the hardware world?

Body:
I think that it's safe for me to assume that many, if not most, programmers are quite enthusiastic about computers, and even electronics in general. Now, I realize that a programmer should first and foremost keep up with the programming world, which is a difficult task in and of itself: with new languages and methodologies making their way into the fray every year, there is never a shortage of interesting things to learn about and try out.

Yet, the hardware world is also advancing very quickly, and is also highly interesting, I'd argue. I recall days when I would study the newest chipsets, CPUs, compare the popular (and not so popular) manufacturers, and read up on specs for my favorite graphics cards. However, since that time, I've stopped keeping up with the hardware that is being developed, and have instead focused my studies and attention on, well, programming.

I still intend to focus myself on programming, by and large. But, my question is, are there efficient / effective methods or learning resources that would make it easier for a programmer to keep up with the latest hardware, if only in a minimal way?


问:
Make a big deal out of == true?
There is a colleague of mine who constantly writes:

```<code>if (someBool == true)
</code>```

It drives me up the wall!  Should I make a big deal of it or just drop it?

答:
you should tell him that he is doing it wrong.

its

if (true == someBool) {

}

if he ever forget one = he is in big trouble in his writing style.

ContentLicense: CC BY-SA 2.5

Title: Make a big deal out of == true?


答:
There are three differences between commercial experience and non-commercial, in terms of language skills (there are many more in terms of general development experience).

Commercial is generally full-time, and thus more valuable than a part-time non-commercial. That said, not all non-commercial is part-time.

Commercial tends to involve working in a team, which means you're learning from others and you're learning about clean code (code that other people can understand).

Non-commercial shows that you are self-driven. So do make sure you include it.

In your situation, I would probably say "7 years, 3 commercial, in C." I would be very surprised if that misled anyone.

Title: Resume dilemma for professional job

Body:
On my resume, I list myself as having "7 years of hands-on experience programming in C".

To clarify, I am a self-taught C programmer with some college courses thrown in the mix. I've worked on some small personal projects, and I consider myself to be more competent than a Computer Science grad with no actual real-world experience, though by no means am I anywhere near being an expert.

The issue is this... I keep getting calls and emails from recruiters that see my resume on job sites, inquiring about my interest in senior developer positions, contracts, etc., of which I feel that I am completely under-qualified for. My resume only has 3 years of work experience listed (which is all IT stuff), so when they ask about my prior experience in C, I have to clarify that it was personal work, not professional work.

I'd really like a job as a developer, but I don't want to get hired for something that I can't handle, nor do I want to misrepresent myself while trying to show off my strengths. I deliberately chose the phrasing "hands-on" to imply that it wasn't professional. How should I phrase my C experience on my resume to clarify it better?


答:
Your problem is not lack of knowldge but lack of industry experience. Ask the recruiter if they have a position open for a S/w Engineer or Junior/Apprentice Software Engineer. It is perfectly fine.

Explain that you dont have industry experinece but are passionate about programming in C and are confident that your programming skills are comparable to any Comp Sci graduate. Explain some of your important persona projects. Even better if you can show the number of downloads froma dev site or something. Dont say that you consider yourself more competent than a Comp Sci grad, even if that is true. The recruiter may be pleased but your would-be Team Leader will probably consider you arrogant :-), especially if they are CS grads.

The worst that can happen is that they will say "Sorry, but we have just one vacancy for a Senior SE". Sooner or later some recruiter will come around who is looking to fill multiple vacancies, maybe build a new team for a new project. And they will need junior level guys too. You will probably need to work on a lower salary than an established professional with equal experience. Use this job as an opportunity to learn and move up the ladder.

Dont worry about not being able to handle work. Even experienced developers sometimes break into a cold sweat in a difficult situation.

Title: Resume dilemma for professional job


问:
Programmers clipboard monitor under Windows
In the process of adapting a "put on clipboard"-solution to new behavior I have found that I need a good programmers clipboard monitor for Windows.

I do not need to have a history of items on the clipboard, but I need to see the details of what is currently placed there, including - this is important - the various flavors (RTF/HTML/plain text/etc) to be sure that all those I place there are correct.  Free is preferred, but cheap will do.

We are a Java shop, but I can install a Visual Studio Express edition if that makes things easier.

(EDIT: The development box is Windows 7 64-bit)

Any suggestions?

答:
The system's built-in clipboard viewer, available under "Accesories," shows a list of the clipboard formats that are on the clipboard in a menu. Or at least it did up until at least Windows XP; I'm running Ubuntu at the moment so can't look at the Windows 7 version :)

You can select the different formats off that menu, and it'll render them on-screen, so far as it can.

EDIT: It's gone from Win 7? I has a sad; I owned it for a while, long long ago. The app is a bog-standard Win32 C application with no odd dependencies, so if you copy CLIPBOOK.EXE from a Windows XP installation you can probably run it under Windows 7. It'll complain about a "Clipbook Service" on startup, but shouldn't die about it.


问:
Algorithmic problem: Picking Cards
The problem below appeared on the last Code Sprint 2 programming competition (it's over already). The base cases are clear, but developing an algorithm that solves all possible cases has been a challenge so far.

There are N cards on the table and each has a number between 0 and N
  on it. Let us denote the number on the Nth Ni. You want to pick up all
  the cards, but you can only pick a specific Nth card if you already
  picked Ni cards before. (As an example, if a card has a value of 3 on
  it, you can’t pick that card up unless you’ve already picked up 3
  cards previously) In how many ways can all the cards be picked up?

Input are the cards with their respective numbers, and the output
  should be the total number of ways possible to pick them up.

```<code>Sample Input:
0 0 0
Sample Output:
6

Sample Input:
0 0 0 0
Sample Output:
24

Sample Input:
0 0 1
Sample Output
4

Sample Input:
0 3 3
Sample Output:
0
</code>```

答:
As a starting point, for the case where all cards are zero:

Output = N!

For example:

Sample Input:
0 0 0

Sample Output:
3 x 2 x 1 = 6.

Clearly, any card with a number higher than 0 will reduce the number of possible ways of picking up the cards.

Any card with "N" on it will make it impossible to pick up the cards.

Edit:

Consider N=4 cards where:

A=0, B=0, C=1, D=2

C can't appear in column 1.
D can't appear in column 1 or 2.

A, B, C, D - Y

A, B, D, C - Y

A, C, B, D - Y

A, C, D, B - Y

A, D, B, C - N

A, D, C, B - N

B, A, C, D - Y

B, A, D, C - Y

B, C, A, D - Y

B, C, D, A - Y

B, D, A, C - N

B, D, C, A - N

C, A, B, D - N

C, A, D, B - N

C, B, A, D - N

C, B, D, A - N

C, D, A, B - N

C, D, B, A - N

D, A, B, C - N

D, A, C, B - N

D, B, A, C - N

D, B, C, A - N

D, C, A, B - N

D, C, B, A - N

Title: Algorithmic problem: Picking Cards


答:
The ClipBook Viewer is a Windows utility, that exist since the initial version of Windows and can be used to display the current contents of the "clipboard" and the type of clipboard contents (rtf, image etc.). Additionally, you can use it to manage the clipboard contents.

Unfortunately, the ClipBook Viewer is not included in Windows 7, so you should use another utility for this purpose.

Title: Programmers clipboard monitor under Windows

Body:
In the process of adapting a "put on clipboard"-solution to new behavior I have found that I need a good programmers clipboard monitor for Windows.

I do not need to have a history of items on the clipboard, but I need to see the details of what is currently placed there, including - this is important - the various flavors (RTF/HTML/plain text/etc) to be sure that all those I place there are correct.  Free is preferred, but cheap will do.

We are a Java shop, but I can install a Visual Studio Express edition if that makes things easier.

(EDIT: The development box is Windows 7 64-bit)

Any suggestions?


答:
Here's a quick implementation in java. The idea is to find how many cards can be picked each step by counting the number of cards with a number below this step and subtracting the number of cards already picked. Of course a lot of work is unnecessarily repeated, but this should give a good idea of how to approach this problem.

```<code>public class PickCards {
public static int countLessOrEqualThanMax(int[] cards, int max) {
    int count = 0;
    for (int number : cards) {
        if(number <= max) count++;
    }
    return count;
}

public static void main(String[] args) {
    int[] cards = {0, 1, 2, 4, 3};
    int numberOfWays = 1;
    for(int i = 0; i < cards.length; i++) {
        int ways = Math.max(0, countLessOrEqualThanMax(cards, i) - i);
        numberOfWays *= ways;
    }
    System.out.println(numberOfWays);
}
</code>```

}

Title: Algorithmic problem: Picking Cards

Body:
The problem below appeared on the last Code Sprint 2 programming competition (it's over already). The base cases are clear, but developing an algorithm that solves all possible cases has been a challenge so far.

There are N cards on the table and each has a number between 0 and N
  on it. Let us denote the number on the Nth Ni. You want to pick up all
  the cards, but you can only pick a specific Nth card if you already
  picked Ni cards before. (As an example, if a card has a value of 3 on
  it, you can’t pick that card up unless you’ve already picked up 3
  cards previously) In how many ways can all the cards be picked up?

Input are the cards with their respective numbers, and the output
  should be the total number of ways possible to pick them up.

```<code>Sample Input:
0 0 0
Sample Output:
6

Sample Input:
0 0 0 0
Sample Output:
24

Sample Input:
0 0 1
Sample Output
4

Sample Input:
0 3 3
Sample Output:
0
</code>```

Body:
Here's a quick implementation in java. The idea is to find how many cards can be picked each step by counting the number of cards with a number below this step and subtracting the number of cards already picked. Of course a lot of work is unnecessarily repeated, but this should give a good idea of how to approach this problem.

public class PickCards {
public static int countLessOrEqualThanMax(int[] cards, int max) {
    int count = 0;
    for (int number : cards) {
        if(number <= max) count++;
    }
    return count;
}

public static void main(String[] args) {
    int[] cards = {0, 1, 2, 4, 3};
    int numberOfWays = 1;
    for(int i = 0; i < cards.length; i++) {
        int ways = Math.max(0, countLessOrEqualThanMax(cards, i) - i);
        numberOfWays *= ways;
    }
    System.out.println(numberOfWays);
}

}


答:
In general, you should always use the full technology name, and put the acronyms in parenthesis, such as Entity Framework (EF), User Experience Design (UX Design), etc., to CV and resumes, because it's much easier to read and search it.

However, there are some technologies or terms that everybody use their acronyms and not their full names such as: SQL, RAM, CPU etc. In this case, writing something like "fixing Random Access Memory chips" is something that will not provide anything except confusion.

Title: Should I use acronyms when listing technical jargon on my résumé?

Body:
I'm wondering if I should use acronyms or initialisms when I list technical qualifications or mention specific technologies on my résumé or CV.

For example:

Entity Framework vs. EF vs. EF (Entity Framework)

Graphical User Interface vs. GUI vs. GUI (Graphical User Interface)

Is there a reason to prefer one version over another? Is it better to be as clear as possible, companies view not using the correct acronym a sign of lack of knowledge about the subject?


问:
What should I do to scale out a high-traffic website?
What best practices should be undertaken for a website that needs to "scale out" to handle capacity?  This is especially relevant now that people are considering the cloud, but may be missing out on the fundamentals.

I'm interested in hearing about anything you consider a best practice from development-level tasks, to infrastructure, to management.

答:
Design for Concurrency

That is, as you're coding, plan around having multiple threads going.  Plan the shared state (often just the db).  Plan for multiple processes. Plan for physical distribution.

This allows you to distribute your system across multiple machines, and across multiple processes with load balancing.  It allows you to have redundant processes running in case of failure, and in case you need to modify the system in-place, you don't have to kill all service to do so.


答:
The algorithm in pseudocode isn't efficient, but it will find ALL cases</p>

```<code>   //Create an array that stores card number,
   //position, and a flag that denotes it is picked or not,
   //initialize with not picked:
   (1, 10 , false) , ( 2, 9, false) .....

   // try to pick each item in array,
   // and spawn a new sub-process tree for each possible move
   trypick(ARRAY)
   // try all cards one by one
   for i = 1 until N
       if ARRAY[i].ispicked
           // just skip it if its already picked
           do nothing
       else
           // if its pickable hurray, but we are not
           // generating a sub-process tree if it is not a valid case
           if ARRAY[i].number <= ARRAY[].Count(ispicked)
               // pick it
               ARRAY[i].ispicked = true
               // spawn a new array tree for each possible
               // move for the subtree generated
               trypick(ARRAY)
   if ARRAY[].Count(ispicked) = N
       // we have picked all cards, lets ad plus one to our total
       totalways++
</code>```

Title: Algorithmic problem: Picking Cards

Body:
The algorithm in pseudocode isn't efficient, but it will find ALL cases

   //Create an array that stores card number,
   //position, and a flag that denotes it is picked or not,
   //initialize with not picked:
   (1, 10 , false) , ( 2, 9, false) .....

   // try to pick each item in array,
   // and spawn a new sub-process tree for each possible move
   trypick(ARRAY)
   // try all cards one by one
   for i = 1 until N
       if ARRAY[i].ispicked
           // just skip it if its already picked
           do nothing
       else
           // if its pickable hurray, but we are not
           // generating a sub-process tree if it is not a valid case
           if ARRAY[i].number <= ARRAY[].Count(ispicked)
               // pick it
               ARRAY[i].ispicked = true
               // spawn a new array tree for each possible
               // move for the subtree generated
               trypick(ARRAY)
   if ARRAY[].Count(ispicked) = N
       // we have picked all cards, lets ad plus one to our total
       totalways++


问:
Were the first assemblers written in machine code?
I am reading the book The Elements of Computing Systems: Building a Modern Computer from First Principles, which contains projects encompassing the build of a computer from boolean gates all the way to high level applications (in that order).  The current project I'm working on is writing an assembler using a high level language of my choice, to translate from Hack assembly code to Hack machine code (Hack is the name of the hardware platform built in the previous chapters).  Although the hardware has all been built in a simulator, I have tried to pretend that I am really constructing each level using only the tools available to me at that point in the real process.

That said, it got me thinking.  Using a high level language to write my assembler is certainly convenient, but for the very first assembler ever written (i.e. in history), wouldn't it need to be written in machine code, since that's all that existed at the time?

And a correlated question... how about today?  If a brand new CPU architecture comes out, with a brand new instruction set, and a brand new assembly syntax, how would the assembler be constructed?  I'm assuming you could still use an existing high level language to generate binaries for the assembler program, since if you know the syntax of both the assembly and machine languages for your new platform, then the task of writing the assembler is really just a text analysis task and is not inherently related to that platform (i.e. needing to be written in that platform's machine language)... which is the very reason I am able to "cheat" while writing my Hack assembler in 2012, and use some preexisting high level language to help me out.

答:
You don't need an assembler to hand assemble assembly language code into machine code. Just as you don't need an editor to write assembly language code.

A historical perspective

The first assemblers were probably written in assembly language and then hand assembled into machine code. Even if the processor had no official 'assembly language' then programmers probably did most of the job of programming using some kind of pseudo code before translating that code into machine instructions.

Even in the earliest days of computing, programmers wrote programs in a kind of symbolic notation and translated them into machine code before feeding it into their computer. In Augusta Ada King's case, she would have needed to translate them into punched cards for Babbage's Analytical Engine, but alas it was never built.

Personal experience

The first computer I owned was a Sinclair ZX81 (Timex 1000 in the US). The back of the manual had all of the information you needed to translate Z80 assembly language into machine code (even inclusing all of the weird index mode opcodes the Z80 had).

I would write out a program (on paper) in assembly language and dry-run through the code. When I was happy that my program was bug-free, I would look up each instruction in the back of the manual, translate it into machine code and write the machine code down on the paper too. Finally I would type all of the machine code instructions into my ZX81 before saving it to tape and trying to run it.

If it didn't work, I would double check my hand assembly and if any translation was wrong I would patch the bytes loaded from tape before re-saving it and trying again to run the program.

From experience, I can tell you that it is much easier to debug your code if it is written in assembly language than in machine code - hence the popularity of disassemblers. Even if you don't have an assembler, hand assembling is less error prone than trying to write machine code directly, though I guess a Real Programmer like Mel might disagree. *8')

ContentLicense: CC BY-SA 4.0


答:
In my experience, about 15 years as programmer/developer - the resume is overstated in its importance.  A clear summary of your experience and what you like to do is important, but the resumes sole purpose is to get you an interview where you can communicate what you have done, can do, etc.  I have experienced developers who have overstated their experience on a resume and it was clear during the interview process.

I would highlight the personal programming experience from the professional because it does show initiative and passion.

Title: Resume dilemma for professional job


答:
Your Resume should always (if possible) be tailored to the person who will be reading it. If you write a resume for a job hunting site where you want it to be found in keyword searches and picked up by HR people ticking off items in a list with no understanding of their meaning, by all means list everything in short and long form.

But if you're submitting a resume for a specific job profile, leave out irrelevant details (like "knowledge of HTML, CSS and XML" when the job description asked for experience working with JSF and you have that) and instead give a little information about how you get experience in the key technologies for that job. Huge lists of technologies are not really good for convincing people that you are a skilled professional.


答:
The "number" of years actually means very little because it is totally dependent on the intensity of the experience. There are some shops where the experience gained by one 1 year work cannot be matched by any number years of work in lesser environments. I think the best thing to do is to recognize number of years as a "soft" number.

For hiring managers this means getting past the number and assessing the qualities of the candidate for the work rather than fretting about silly arbitrary thresholds of for example 3 vs 5 years of experience, etc.

For candidates, this means recognizing that the "years of experience" is almost never a hard cut-off (regardless of what the "requirements" say). Instead, if you believe you can do the job, then it is a matter of convincing the hiring manager about what you can do.

Title: Resume dilemma for professional job


问:
Make or Buy: Web Based Accounting App Advice needed…
My company has a client (in the US) that currently offers small businesses web-based payroll software. They want to offer small businesses a web-based accounting package that integrates well with their current web-based offerings. The company does have a CPA on staff which is a bonus. To this point they have said it needs to be a double-entry accounting system, GL, subledger, sales invoicing, cash receipts processing, payables entry and payment processing.

So my question is …

Should we try and write this ourselves from scratch with the on-staff CPA, try the open source path and see if we can adjust it to what we need or is there a different option that I’m not thinking of?

Any advice in any direction would be greatly appreciated.

答:
First off, I would be very wary of attempting to write an accounts package from scratch for general use. I can't comment specifically on the US being based in the UK but my experience suggests that accounting is a minefield - its surprisingly complicated (it ought not to be, but it is), has a dense and obscure jargon and the breadth of "minimum capability" is substantial even before you get to your local regulatory requirements.

To be clear, Accountants have the equivalent of hacks to make things balance and your system will have to cope seamlessly...

If it were me I'd probably find one or more existing online accounts systems to partner with and focus on creating a top notch payroll system that integrates really nicely with as many (online) accounts systems as is feasible. Of course it is also the case (in the UK at least) that online accounting is, in many respects, the next big thing... but I'm not sure I'd want to try and get into the game from a standing start now.


答:
Before considering if taking on an in-house project is a viable option you need to consider the following items:

How quickly is the product needed?  Do we have the resources available to take on such a product and still meet existing obligations?

How much money are they willing to spend for the software?  When taking on an internal project, this runs parallel with time, as generally the more time an internal project takes, the more it costs the company in use of company resources to pursue the endeavor.

Do you have the necessary domain knowledge available in house to assist in formulating software requirements and needs?  Do you have a CPA who can devote the necessary sit down time with you and your team to help the project be a true success?  Without this you are just guessing at best.

Is the project you are taking on corellated with the line of business your company is currently engaged in?  Do they have a software product line that this could be beneficial to or add on to?  Does accounting software even remotely relate to what your company does?  If not then you have to ask yourself not only are you qualified to do this, SHOULD you be spending time on this or focusing on projects that help move forward the company mission.

Title: Make or Buy: Web Based Accounting App Advice needed…

Body:
My company has a client (in the US) that currently offers small businesses web-based payroll software. They want to offer small businesses a web-based accounting package that integrates well with their current web-based offerings. The company does have a CPA on staff which is a bonus. To this point they have said it needs to be a double-entry accounting system, GL, subledger, sales invoicing, cash receipts processing, payables entry and payment processing.

So my question is …

Should we try and write this ourselves from scratch with the on-staff CPA, try the open source path and see if we can adjust it to what we need or is there a different option that I’m not thinking of?

Any advice in any direction would be greatly appreciated.


问:
What are your initial three steps when you are first presented with a software problem?
I am curious about the very early steps that a programmer's mind takes when it first encounters a problem that it is supposed to solve. How do you start reasoning about it ? What are the first questions you ask yourself ??.

Ok, let me make it more concrete for those of you who think the question is too vague or entirely situation dependent. Pick any of the following   requirements and think out loud about your very first hunches/impressions/tendencies about how to solve it.

1) build a simple word processor with about as much functionality as MS Word Pad

 2) design a single person card game (e.g. Solitaire)

 3) build a scientific calculator

 4) Any  problem of your choosing with similar scale/complexity as the above three

答:
My first instinctive response is to  enter solutions mode. My brain starts looking for solutions, small and large immediately. This happens faster than it takes to read the problem statement.

But pretty soon, I catch myself going down that (bad) path, and consciously force myself into pro mode and I take a step back.

Once in pro mode, I write a test.

OwnerDisplayName: mumtaz

LastEditorDisplayName: mumtaz


答:
I've been using FreeClipBoardViewer without issues.

It allows you to view the different formats stored on the clipboard, and export them. It also allows importing a previous export so you can transfer clipboards between computers and restore an earlier clipboard in order to do testing or debugging.


问:
Does Quebec require all output, including internal logs, to be in French?
I've once heard a Microsoft architect say that, in Quebec, program output must be in French, including the custom log output that would be used by service technicians in other countries who don't speak French or are Quebecois.

Apparently, it's in Bill 101 Article 5. If you read the document correctly (thanks Matthieu), Article 5 says

5. Consumers of goods and services have a right to be informed and served in French.
  1977, c. 5, s. 5.

Is what the Microsoft technician saying correct?

Does this affect all output from a program, or just the output intended for a French-speaking audience (e.g., the logs in this case wouldn't apply)?

Is it only intended for government agencies (including contract work done for them), or does it affect private use and sale, as well?

答:
It depends on the company.

Canada does have two official languages, English and Canadian French (it is different). I have done an internship working for the Government of Canada, and I can tell you that everything was in both English and French. The site I was working on required the text to be the exact same in both languages which caused more than a few issues when something couldn't be said well in French, the English had to be changed so that it could be said in French.

Other companies, choose if they want to. I work for project based company right now, and some of our clients pay for the translation, and others don't. We set up all our applications so that the option of translation is easy to add, but it is up to the client to decide if they want to pay for the translation.

Unless you are building an application for Quebec (the French speaking province), or for the government, I think it's up to you how you do your custom log files.


答:
I built a computer in 1975.  It was very advanced over its contemporary the Altair, because it had a 'monitor rom' which let me enter programs by typing in machine code in hex and viewing this code on a video monitor, where as with the Altair each machine instruction had to be entered a bit at time using a row of switches.

So yes, in the early days of computers and then again in the early days of personal computers people did write applications in machine code.

Title: Were the first assemblers written in machine code?

Body:
I am reading the book The Elements of Computing Systems: Building a Modern Computer from First Principles, which contains projects encompassing the build of a computer from boolean gates all the way to high level applications (in that order).  The current project I'm working on is writing an assembler using a high level language of my choice, to translate from Hack assembly code to Hack machine code (Hack is the name of the hardware platform built in the previous chapters).  Although the hardware has all been built in a simulator, I have tried to pretend that I am really constructing each level using only the tools available to me at that point in the real process.

That said, it got me thinking.  Using a high level language to write my assembler is certainly convenient, but for the very first assembler ever written (i.e. in history), wouldn't it need to be written in machine code, since that's all that existed at the time?

And a correlated question... how about today?  If a brand new CPU architecture comes out, with a brand new instruction set, and a brand new assembly syntax, how would the assembler be constructed?  I'm assuming you could still use an existing high level language to generate binaries for the assembler program, since if you know the syntax of both the assembly and machine languages for your new platform, then the task of writing the assembler is really just a text analysis task and is not inherently related to that platform (i.e. needing to be written in that platform's machine language)... which is the very reason I am able to "cheat" while writing my Hack assembler in 2012, and use some preexisting high level language to help me out.


答:
Yes,
This is a kind of programmers mind set. All the time they considers "if condition" has no existence with out an expression with symbols =,<,>... I've seen situations  people really get struggle as like "function return"

if(RowsAffected > 0)
{
    return true;
}
else
{
    return false;
}

Programmers need to watch their code from the real time angle.. :)

Title: Make a big deal out of == true?

Body:
There is a colleague of mine who constantly writes:

```<code>if (someBool == true)
</code>```

It drives me up the wall!  Should I make a big deal of it or just drop it?

OwnerDisplayName: Krishna Prasad A


问:
Is it good practice to catch a checked exception and throw a RuntimeException?
I read some code of a colleague and found that he often catches various exceptions and then always throws a 'RuntimeException' instead. I always thought this is very bad practice. Am I wrong?</p>

答:
It can be GOOD. Please read this onjava.com article:

Most of the time, client code cannot do anything about SQLExceptions.
  Do not hesitate to convert them into unchecked exceptions. Consider
  the following piece of code:

```<code>public void dataAccessCode(){
  try{
      ..some code that throws SQLException
  }catch(SQLException ex){
      ex.printStacktrace();
  }
}
</code>```

This catch block just suppresses the exception and does nothing. The justification is that there is nothing my client could do
  about an SQLException. How about dealing with it in the following
  manner?

```<code>public void dataAccessCode(){
   try{
       ..some code that throws SQLException
   }catch(SQLException ex){
       throw new RuntimeException(ex);
   }
}
</code>```

This converts SQLException to RuntimeException. If SQLException occurs, the catch clause throws a new RuntimeException.
  The execution thread is suspended and the exception gets reported.
  However, I am not corrupting my business object layer with unnecessary
  exception handling, especially since it cannot do anything about an
  SQLException. If my catch needs the root exception cause, I can make
  use of the getCause() method available in all exception classes as of
  JDK1.4.

Throwing checked exceptions and not being able to recover from it is not helping.

Some people even think that checked exceptions should not be used at all. See
http://www.ibm.com/developerworks/java/library/j-jtp05254/index.html

Recently, several well-regarded experts, including Bruce Eckel and Rod
  Johnson, have publicly stated that while they initially agreed
  completely with the orthodox position on checked exceptions, they've
  concluded that exclusive use of checked exceptions is not as good an
  idea as it appeared at first, and that checked exceptions have become
  a significant source of problems for many large projects. Eckel takes
  a more extreme view, suggesting that all exceptions should be
  unchecked; Johnson's view is more conservative, but still suggests
  that the orthodox preference for checked exceptions is excessive.
  (It's worth noting that the architects of C#, who almost certainly had
  plenty of experience using Java technology, chose to omit checked
  exceptions from the language design, making all exceptions unchecked
  exceptions. They did, however, leave room for an implementation of
  checked exceptions at a later time.)

Also from the same link:

The decision to use unchecked exceptions is a complicated one, and
  it's clear that there's no obvious answer. The Sun advice is to use
  them for nothing, the C# approach (which Eckel and others agree with)
  is to use them for everything. Others say, "there's a middle ground."

Body:
It can be GOOD. Please read this onjava.com article:

Most of the time, client code cannot do anything about SQLExceptions.
  Do not hesitate to convert them into unchecked exceptions. Consider
  the following piece of code:

public void dataAccessCode(){
  try{
      ..some code that throws SQLException
  }catch(SQLException ex){
      ex.printStacktrace();
  }
}

This catch block just suppresses the exception and does nothing. The justification is that there is nothing my client could do
  about an SQLException. How about dealing with it in the following
  manner?

public void dataAccessCode(){
   try{
       ..some code that throws SQLException
   }catch(SQLException ex){
       throw new RuntimeException(ex);
   }
}

This converts SQLException to RuntimeException. If SQLException occurs, the catch clause throws a new RuntimeException.
  The execution thread is suspended and the exception gets reported.
  However, I am not corrupting my business object layer with unnecessary
  exception handling, especially since it cannot do anything about an
  SQLException. If my catch needs the root exception cause, I can make
  use of the getCause() method available in all exception classes as of
  JDK1.4.

Throwing checked exceptions and not being able to recover from it is not helping.

Some people even think that checked exceptions should not be used at all. See
http://www.ibm.com/developerworks/java/library/j-jtp05254/index.html

Recently, several well-regarded experts, including Bruce Eckel and Rod
  Johnson, have publicly stated that while they initially agreed
  completely with the orthodox position on checked exceptions, they've
  concluded that exclusive use of checked exceptions is not as good an
  idea as it appeared at first, and that checked exceptions have become
  a significant source of problems for many large projects. Eckel takes
  a more extreme view, suggesting that all exceptions should be
  unchecked; Johnson's view is more conservative, but still suggests
  that the orthodox preference for checked exceptions is excessive.
  (It's worth noting that the architects of C#, who almost certainly had
  plenty of experience using Java technology, chose to omit checked
  exceptions from the language design, making all exceptions unchecked
  exceptions. They did, however, leave room for an implementation of
  checked exceptions at a later time.)

Also from the same link:

The decision to use unchecked exceptions is a complicated one, and
  it's clear that there's no obvious answer. The Sun advice is to use
  them for nothing, the C# approach (which Eckel and others agree with)
  is to use them for everything. Others say, "there's a middle ground."


答:
"Experience" is a very vague and ill-defined concept and HR departments attempt to oversimplify it. They want a simple heuristic that they can use to judge and categorize people in an attempt to make their jobs easier. Consider that there is a huge variance in a person's ability to process and learn information. So, for people with different learning abilities, the number of years of experience is a particularly worthless heuristic. Just keep this in mind when writing your resume and during interviews.

A more precise measure would be to administer some sort of exhaustive skill test to applicants, but this is rarely done. I suppose the interview is meant to accomplish some of this, but even it has it's negatives. For one, some talented people simply don't test well and they get nervous or simply can't handle on the spot type situations very well. That doesn't mean they won't make good developers. Even tight timelines occur on a timescale of hours, not minutes (the length of a typical interview).

Just remember the point of all this is to convey information. That means you need to account for how other people are going to interpret what you say. Particularly with such vague concepts, I think the essence of what is communicated is the most important thing. If you keep getting offers for jobs you are uncomfortable with, just drop the number of years of experience.

Consider too, you may just suffer from a lack of confidence.

Title: Resume dilemma for professional job


答:
Agencies and departments of the Government of Canada should deliver software programs in both official languages for internal applications.  External applications must be bilingual to the users.
I have never seen any program requirement to deliver log messages that can only be seen by developers or IT staff in both languages.  As always, it can be done, but it costs more money.

Provincial governments can choose to deliver public web services in English and French. Ontario, Quebec and I believe, New Brunswick, choose to do so.  What they do for internal applications and logs I don't know.

Title: Does Quebec require all output, including internal logs, to be in French?

Body:
I've once heard a Microsoft architect say that, in Quebec, program output must be in French, including the custom log output that would be used by service technicians in other countries who don't speak French or are Quebecois.

Apparently, it's in Bill 101 Article 5. If you read the document correctly (thanks Matthieu), Article 5 says

5. Consumers of goods and services have a right to be informed and served in French.
  1977, c. 5, s. 5.

Is what the Microsoft technician saying correct?

Does this affect all output from a program, or just the output intended for a French-speaking audience (e.g., the logs in this case wouldn't apply)?

Is it only intended for government agencies (including contract work done for them), or does it affect private use and sale, as well?


问:
Should one use pseudocode before actual coding?
Pseudocode helps us understand tasks in a language-agnostic manner. Is it best practice or suggested approach to have pseudocode creation as part of the development lifecycle? For instance:

Identify and split the coding tasks

Write pseudocode

Get it approved [by PL or TL]

Start Coding based on Pseudocode

Is this a suggested approach? Is it practiced in the industry?

答: Great work.  You started a good discussion. As of me, I used to write pseudo codes when I was learning programming to understand the various loops and algorithms. This was more then one and half decades ago. That days, even programming languages were not much powerful... and event driven programming was future. Now with 4GLs and 5GLs, we think in the language itself rather then in plain English. When we think of a problem, we think in terms of objects and operations. And until it is a complex algo, writing pseudo codes (or P-S-E-U-DO-Codes, just kidding) does not make any sense. Better, represent the solution in  a graphic way.</p>

OwnerDisplayName: devcoder


答:
If you start to write your own accounting application, the accountant on staff better be able to commmit 110% of her time to this application.

Unless your clients tend to be new companies who are still looking for accounting software, you're better off integrating with what is currently on the market. Maybe there is a market for companies that don't want to use QuickBooks? These decisions get driven by their CPA. Most accountants don't want to learn a new software app.

Start integrating with the top accounting packages their customers are already using or make it easier for them to integrate with their app. The existing customer base would answer this question if you'd just ask them.


答:
I am not a lawyer, only a developer.

In my opinion, a logfile is not intended to be served to consumers. It is intended to be used by developers for debugging purposes.

As a consequence, french is not mandatory.

If you want to get out of all that, generate log files in binary form, so that only developers with appropriate tools can analyze them.


问:
What is "Scalable Integrated Systems"?
I've come across a job posting that asks for experience with "Scalable Integrated Systems", but honestly that sounds like "generic buzzword," and I'm trying to figure out what the actual work behind "Scalable Integrated Systems" is. What does a "Scalable Integrated System" look like?

Is it making distributed computing software? Is it writing APIs between services in a way they "scale", and if so, scale in what way?

I don't understand what a Scalable Integrated System is.

The company seems competent and I have competent programmer friends working there who say they are a great place to work in. If it was SpammyCoOnCraigslist@yahoo.com, I wouldn't bother asking.

答:
It's only complicated if you're looking for a definitive answer. First, they want an experienced programmer. Single-user, desktop apps with small amounts of data is not enough. Signs of "Scalable Integrated Systems" would be:

Large and probably complicated data sets

Lots of concurrent users

Being part of a development team

Probably runs on multiple servers and devices like app servers, web services, client apps either internally or connecting to outside providers.

Several departments in a company would use it or some other multi-user group scenario.

This is not an all encompassing list nor are all the parts required. It's not like once an app goes from 100 users to 101 it crosses some great divide.

The sad part is you may have the skills to be more capable at this then someone with experience.

Title: What is "Scalable Integrated Systems"?


问:
Functional Programming: Are Tuples a viable replacement for Types?
A while ago I decided to learn Haskell to help with learning more "pure functional" ideas that I could apply to F#.  Right off the bat it seems as if there's no real types in Haskell like the ones that F# has. I'm fine with that so I wanted to find a way to remove myself from the hybrid OO/Functional design I've used in F# and really try to go classless and truly develop a function centric design.  The first thing that came to mind when using Haskell was to just pass tuples around as they can hold information in key value pairs much like dynamic languages but don't have the constructor syntax like F# types.

For example in F#:

```<code>type DatabaseWorkValueItem(firstItem, secondItem, thirdItem) =
  member public x.FirstItem = firstItem
  member public x.SecondItem = secondItem
  member public x.ThirdItem = thirdItem
</code>```

And this would be in my new proposed design:

```<code>module DatabaseWorkValueItem =

  let firstItem (item, _, _) = item
  let secondItem (_,item, _) = item
  let thirdItem (_,_, item) = item

  --Replace constructor with method
  let CreateValueItem (parameter:String, value:Object, sqlType:SqlDbType) =
    (parameter, value, sqlType)

  --Replace properties with more methods
  let GetDataType (item :(String *Object * SqlDbType)) =
    thirdItem item

  let GetParameter (item :(String *Object * SqlDbType)) =
    firstItem item

  let GetValue (item :(String *Object * SqlDbType)) =
    secondItem item
</code>```

They both get the same idea.  One creates a class like Type with properties set on construction and the other uses all functions to create and read a tuple.

Question is: Am I crazy to bother with this?  Although I realize F# has the convenience of jumping between two paradigms, I can't help but feel that it's a comfort blanket to

答:
I don't know what makes you think that Haskell doesn't have real types or that using different types is somehow against the concept of functional programming. Passing around tuples instead of a more meaningful types is a terrible idea in F# as well as in Haskell as it greatly diminishes the type safety that statically typed languages like Haskell and F# offer.

Static type safety is a very important concept in statically typed functional programming languages (even more so than in statically typed OO-languages, I'd say) and code using only tuples would definitely not be idiomatic in any such language.

For example consider an application that represents the structure of a University. This application may have types to represent students and classes (among other things of course). Let's say a student has a name and an age and a class has a name and a number of attendees. Both of these could be represented as (String, Int) tuples. However if you do that any function that accepts a student as its argument will also accept a class instead without causing a compile-error because you represent both using the same type. If you define separate types for students and classes that does not happen.


问:
How to spread awareness for generic programming among team members?
I am staying in an environment, where people believe:

Java generics are the feature exclusively used for library writing
and not for the real coding.

C++ is an OO programming language; template is an optional and
avoidable feature

Though, these people rely highly on the libraries written using generic programming (e.g. STL, Java containers). If I write a code using templates or generics, the code reviewer is most likely to reject it and will comment to write it in a "proper / understandable / elegant" way.

Such mentality is applicable from normal programmer to senior most manager. There is no way out, because 90% of the time, these people have their lobbying.

What is the best way (not being cut throat) of explaining them, the practical approach of writing code which constitutes OO and generic programming both at the same time ?

答:
I'd go easy on this.  I moved from Java 1.4 to 1.6 a couple years back, and generics has been a real jolt.  It's simple and very helpful if you are trying to juggle a few Collections, Maps and other structures.  However, writing classes that take generic data as parameters, manipulate them, and pass them to other classes quickly becomes monumentally confusing.  I get great satisfaction from making it all work, but wonder if the added time and effort spent was worth it.  I also fear a good number of Java programmers may never really get the hang of it.

A few more random thoughts from my generic journey so far:

ClassCastExceptions occur at run time, but they usually appear on the first few runs and are easy to fix.

Every article I've read on generics states that sometimes they just don't work and you need to use @SuppressWarnings(value="unchecked") occasionally.  How do you know if you are beyond the limits of generics, or if you're just being stupid and need to think harder?

It can be hard to apply @SuppressWarnings(value="unchecked") to just one line.

I added some fancy generics to one of my classes.  I've known several programmers who could have enhanced the class before I genericked it who could never have touched it and gotten a clean compile afterwards.

Generics has cleaned up my code and warned me of trouble too many times for me to reject it, but I also see increased development time, extra time spent on training, and Java programmers forced off to work in C#, C, and Visual Basic...or Java 1.4.  I'd focus on writing code your coworkers can understand.  If you can slip in some understandable generics, great.  I see Java generics as an opportunity/problem that has not yet been figured out.


答:
My understanding of an "integrated system" is that it's a group of components that are able to function independently more or less, but that provide additional value when grouped into a system.

Consider as an example the equipment available to military units.  A hidden infantryman can see a target with their eyes, take control of a UAV to lase the target, and transmit those coordinates to an attack helicopter's targeting system, who can fire a missile at it without having to peek up over the hill they've been hiding behind, with a high level picture being shown to a commanding officer back at base via satellite.  They can act independently, and there are other ways to get the job done, but working as an integrated system they are the most effective.

For a search engine, the components would be crawlers, databases, backups, and web servers.  You can send a crawler off to do its job, and it can act independently, but you need system integration to make the whole thing work as a whole.

The more disparate types or sheer volume of components your system can support, the more scalable it is.

Title: What is "Scalable Integrated Systems"?

Body:
I've come across a job posting that asks for experience with "Scalable Integrated Systems", but honestly that sounds like "generic buzzword," and I'm trying to figure out what the actual work behind "Scalable Integrated Systems" is. What does a "Scalable Integrated System" look like?

Is it making distributed computing software? Is it writing APIs between services in a way they "scale", and if so, scale in what way?

I don't understand what a Scalable Integrated System is.

The company seems competent and I have competent programmer friends working there who say they are a great place to work in. If it was SpammyCoOnCraigslist@yahoo.com, I wouldn't bother asking.


问:
Should a code review be different for front-end web developers?
Web developers code in a minimum of four languages (HTML, CSS, JavaScript, and a server-side language), must produce a working result in several different browser implementations, and may work on the top of a custom software stack that they don't control.

How should a code review take these things into account?

Should a code review include all parts of a front-end project (HTML and CSS as
well), or just focus on the logic?

How should a code review handle workarounds for browser- or stack-specific problems?

答:
User Interface review should be part of code review for web applications. The reviewers check list should include -
a) Consistency of web presentation across your web application (use same style buttons through out your application)
b) How is the user experience on the your web application (pop up or inline edit is better? or can we reduce number of clicks user has to make?)

In larger firms I have worked with, there are teams specialized for user interface review (UI experts or creative services). However, the developer/reviewer still has the primary responsibility of CSS/HTML/JS. The specialized UI teams are there just to give suggestions and sign off the application look and feel.

I am not sure if I understand your third question correctly. If the question is related to target web browser - If you know your end users very well (say an intranet environment), you know for which bowers you should test you application. But if your application is available on public Internet , then extensive testing is the way to go. I find this link useful - http://www.zdnetasia.com/testing-web-applications-with-multiple-browsers-62036598.htm


问:
Separating a "wad of stuff" utility project into individual components with "optional" dependencies
Over the years of using C#/.NET for a bunch of in-house projects, we've had one library grow organically into one huge wad of stuff. It's called "Util", and I'm sure many of you have seen one of these beasts in your careers.

Many parts of this library are very much standalone, and could be split up into separate projects (which we'd like to open-source). But there is one major problem that needs to be solved before these can be released as separate libraries. Basically, there are lots and lots of cases of what I might call "optional dependencies" between these libraries.

To explain this better, consider some of the modules that are good candidates to become stand-alone libraries. CommandLineParser is for parsing command lines. XmlClassify is for serializing classes to XML. PostBuildCheck performs checks on the compiled assembly and reports a compilation error if they fail. ConsoleColoredString is a library for colored string literals. Lingo is for translating user interfaces.

Each of those libraries can be used completely stand-alone, but if they are used together then there are useful extra features to be had. For example, both CommandLineParser and XmlClassify expose post-build checking functionality, which requires PostBuildCheck. Similarly, the CommandLineParser allows option documentation to be provided using the colored string literals, requiring ConsoleColoredString, and it supports translatable documentation via Lingo.

So the key distinction is that these are optional features. One can use a command line parser with plain, uncolored strings, without translating the documentation or performing any post-build checks. Or one could make the documentation translatable but still uncolored. Or both colored and translatable. Etc.

Looking through this "Util" library, I see that almost all potentially separable libraries have such optional features that tie them to other libraries. If I were to actually require those libraries as dependencies then this wad of stuff isn't really untangled at all: you'd still basically require all the libraries if you want to use just one.

Are there any established approaches to managing such optional dependencies in .NET?

答:
Perhaps the book "Large-scale C++ software design" by John Lakos is useful (of course C# and C++ or not the same, but you can distil useful techniques from the book).

Basically, re-factor and move the functionality that uses two or more libraries into a separate component that depends on these libraries.
If needed, use techniques like opaque types etc.


问:
Should I use acronyms when listing technical jargon on my résumé?
I'm wondering if I should use acronyms or initialisms when I list technical qualifications or mention specific technologies on my résumé or CV.

For example:

Entity Framework vs. EF vs. EF (Entity Framework)

Graphical User Interface vs. GUI vs. GUI (Graphical User Interface)

Is there a reason to prefer one version over another? Is it better to be as clear as possible, companies view not using the correct acronym a sign of lack of knowledge about the subject?

答:
I keep two copies of my resume.  One with the 'flashy' non technical skill sheet geared towards HR personnel.  I make sure the Resume is tailored to the job I am applying for.  For this, I would spell out the acronyms.  The second resume is chock full of acronyms and technical terms that are more suited for a technical hiring person.  In all the cases throughout my career, I have found that the initial resume that gets me through the initial screening process becomes useless at interview time.  This is where I hand the interviewer the technical copy, usually along with a statement of "I took the liberty of elaborating on some of the finer points of my resume, and here is a copy."

Although I do not know what has gone on behind closed doors, I have had extraordinary luck with landing jobs.  Even in cases where I was overlooked for a job, I was called back and asked to interview for 3 or 4 different positions, because they were impressed with my all around approach.


答:
Refactor Slowly.

Expect this to take some time to complete, and may occur over several iterations before you can completely remove your Utils assembly.

Overall Approach:

First take some time and think of how you want these utility assemblies to look when you're done.  Don't worry too much about your existing code, think of the end goal.  For example, you may wish to have:

MyCompany.Utilities.Core (Containing algorithms, logging, etc.)

MyCompany.Utilities.UI (Drawing code, etc.)

MyCompany.Utilities.UI.WinForms (System.Windows.Forms-related code, custom controls, etc.)

MyCompany.Utilities.UI.WPF (WPF-related code, MVVM base classes).

MyCompany.Utilities.Serialization (Serialization code).

Create empty projects for each of these projects, and create appropriate project references (UI references Core, UI.WinForms references UI), etc.

Move any of the low-hanging fruit (classes or methods that don't suffer from the dependency issues) from your Utils assembly to the new target assemblies.

Get a copy of NDepend and Martin Fowler's Refactoring to start analyzing your Utils assembly to start work on the tougher ones.  Two techniques that will be helpful:

In many cases you will need to Invert Control through the means of interfaces, delegates, or events.

In the case of your "optional" dependencies, see below.

Handling Optional Interfaces

Either an assembly references another assembly, or it doesn't.  The only other way to use functionality in a non-linked assembly is through an interface loaded through reflection from a common class.  The downside to this is that your core assembly will need to contain interfaces for all of the shared features, but the upside is that you can deploy your utilities as needed without the "wad" of DLL files depending on each deployment scenario.  Here's how I would handle this case, using the colored string as an example:

First, define the common interfaces in your core assembly:

For example, the IStringColorer interface would look like:

```<code> namespace MyCompany.Utilities.Core.OptionalInterfaces
 {
     public interface IStringColorer
     {
         string Decorate(string s);
     }
 }
</code>```

Then, implement the interface in the assembly with the feature.  For example, the StringColorer class would look like:

```<code>using MyCompany.Utilities.Core.OptionalInterfaces;
namespace MyCompany.Utilities.Console
{
    class StringColorer : IStringColorer
    {
        #region IStringColorer Members

        public string Decorate(string s)
        {
            return "*" + s + "*";   //TODO: implement coloring
        }

        #endregion
    }
}
</code>```

Create a PluginFinder (or maybe InterfaceFinder is a better name in this case) class that can find interfaces from DLL files in the current folder.  Here is a simplistic example.  Per @EdWoodcock's advice (and I agree), when your projects grows I would suggest using one of the available Dependency Injection frameworks (Common Serivce Locator with Unity and Spring.NET come to mind) for a more robust implementation with more advanced "find me that feature" capabilities, otherwise known as the Service Locator Pattern.  You can modify it to suit your needs.

```<code>using System;
using System.Linq;
using System.IO;
using System.Reflection;

namespace UtilitiesCore
{
    public static class PluginFinder
    {
        private static bool _loadedAssemblies;

        public static T FindInterface<T>() where T : class
        {
            if (!_loadedAssemblies)
                LoadAssemblies();

            //TODO: improve the performance vastly by caching RuntimeTypeHandles

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (Type type in assembly.GetTypes())
                {
                    if (type.IsClass && typeof(T).IsAssignableFrom(type))
                        return Activator.CreateInstance(type) as T;
                }
            }

            return null;
        }

        private static void LoadAssemblies()
        {
            foreach (FileInfo file in new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles())
            {
                if (file.Extension != ".DLL")
                    continue;

                if (!AppDomain.CurrentDomain.GetAssemblies().Any(a => a.Location == file.FullName))
                {
                    try
                    {
                        //TODO: perhaps filter by certain known names
                        Assembly.LoadFrom(file.FullName);
                    }
                    catch { }
                }
            }
        }
    }
}
</code>```

Lastly, use these interfaces in your other assemblies by calling the FindInterface method.  Here is an example of CommandLineParser:

```<code>static class CommandLineParser
{
    public static string ParseCommandLine(string commandLine)
    {
        string parsedCommandLine = ParseInternal(commandLine);

        IStringColorer colorer = PluginFinder.FindInterface<IStringColorer>();

        if(colorer != null)
            parsedCommandLine = colorer.Decorate(parsedCommandLine);

        return parsedCommandLine;
    }

    private static string ParseInternal(string commandLine)
    {
        //TODO: implement parsing as desired
        return commandLine;
    }
</code>```

}

MOST IMPORTANTLY:  Test, test, test between each change.

Title: Separating a "wad of stuff" utility project into individual components with "optional" dependencies

Body:
Over the years of using C#/.NET for a bunch of in-house projects, we've had one library grow organically into one huge wad of stuff. It's called "Util", and I'm sure many of you have seen one of these beasts in your careers.

Many parts of this library are very much standalone, and could be split up into separate projects (which we'd like to open-source). But there is one major problem that needs to be solved before these can be released as separate libraries. Basically, there are lots and lots of cases of what I might call "optional dependencies" between these libraries.

To explain this better, consider some of the modules that are good candidates to become stand-alone libraries. CommandLineParser is for parsing command lines. XmlClassify is for serializing classes to XML. PostBuildCheck performs checks on the compiled assembly and reports a compilation error if they fail. ConsoleColoredString is a library for colored string literals. Lingo is for translating user interfaces.

Each of those libraries can be used completely stand-alone, but if they are used together then there are useful extra features to be had. For example, both CommandLineParser and XmlClassify expose post-build checking functionality, which requires PostBuildCheck. Similarly, the CommandLineParser allows option documentation to be provided using the colored string literals, requiring ConsoleColoredString, and it supports translatable documentation via Lingo.

So the key distinction is that these are optional features. One can use a command line parser with plain, uncolored strings, without translating the documentation or performing any post-build checks. Or one could make the documentation translatable but still uncolored. Or both colored and translatable. Etc.

Looking through this "Util" library, I see that almost all potentially separable libraries have such optional features that tie them to other libraries. If I were to actually require those libraries as dependencies then this wad of stuff isn't really untangled at all: you'd still basically require all the libraries if you want to use just one.

Are there any established approaches to managing such optional dependencies in .NET?

Body:
Refactor Slowly.

Expect this to take some time to complete, and may occur over several iterations before you can completely remove your Utils assembly.

Overall Approach:

First take some time and think of how you want these utility assemblies to look when you're done.  Don't worry too much about your existing code, think of the end goal.  For example, you may wish to have:

MyCompany.Utilities.Core (Containing algorithms, logging, etc.)

MyCompany.Utilities.UI (Drawing code, etc.)

MyCompany.Utilities.UI.WinForms (System.Windows.Forms-related code, custom controls, etc.)

MyCompany.Utilities.UI.WPF (WPF-related code, MVVM base classes).

MyCompany.Utilities.Serialization (Serialization code).

Create empty projects for each of these projects, and create appropriate project references (UI references Core, UI.WinForms references UI), etc.

Move any of the low-hanging fruit (classes or methods that don't suffer from the dependency issues) from your Utils assembly to the new target assemblies.

Get a copy of NDepend and Martin Fowler's Refactoring to start analyzing your Utils assembly to start work on the tougher ones.  Two techniques that will be helpful:

In many cases you will need to Invert Control through the means of interfaces, delegates, or events.

In the case of your "optional" dependencies, see below.

Handling Optional Interfaces

Either an assembly references another assembly, or it doesn't.  The only other way to use functionality in a non-linked assembly is through an interface loaded through reflection from a common class.  The downside to this is that your core assembly will need to contain interfaces for all of the shared features, but the upside is that you can deploy your utilities as needed without the "wad" of DLL files depending on each deployment scenario.  Here's how I would handle this case, using the colored string as an example:

First, define the common interfaces in your core assembly:

For example, the IStringColorer interface would look like:

 namespace MyCompany.Utilities.Core.OptionalInterfaces
 {
     public interface IStringColorer
     {
         string Decorate(string s);
     }
 }

Then, implement the interface in the assembly with the feature.  For example, the StringColorer class would look like:

using MyCompany.Utilities.Core.OptionalInterfaces;
namespace MyCompany.Utilities.Console
{
    class StringColorer : IStringColorer
    {
        #region IStringColorer Members

        public string Decorate(string s)
        {
            return "*" + s + "*";   //TODO: implement coloring
        }

        #endregion
    }
}

Create a PluginFinder (or maybe InterfaceFinder is a better name in this case) class that can find interfaces from DLL files in the current folder.  Here is a simplistic example.  Per @EdWoodcock's advice (and I agree), when your projects grows I would suggest using one of the available Dependency Injection frameworks (Common Serivce Locator with Unity and Spring.NET come to mind) for a more robust implementation with more advanced "find me that feature" capabilities, otherwise known as the Service Locator Pattern.  You can modify it to suit your needs.

using System;
using System.Linq;
using System.IO;
using System.Reflection;

namespace UtilitiesCore
{
    public static class PluginFinder
    {
        private static bool _loadedAssemblies;

        public static T FindInterface<T>() where T : class
        {
            if (!_loadedAssemblies)
                LoadAssemblies();

            //TODO: improve the performance vastly by caching RuntimeTypeHandles

            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                foreach (Type type in assembly.GetTypes())
                {
                    if (type.IsClass && typeof(T).IsAssignableFrom(type))
                        return Activator.CreateInstance(type) as T;
                }
            }

            return null;
        }

        private static void LoadAssemblies()
        {
            foreach (FileInfo file in new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles())
            {
                if (file.Extension != ".DLL")
                    continue;

                if (!AppDomain.CurrentDomain.GetAssemblies().Any(a => a.Location == file.FullName))
                {
                    try
                    {
                        //TODO: perhaps filter by certain known names
                        Assembly.LoadFrom(file.FullName);
                    }
                    catch { }
                }
            }
        }
    }
}

Lastly, use these interfaces in your other assemblies by calling the FindInterface method.  Here is an example of CommandLineParser:

static class CommandLineParser
{
    public static string ParseCommandLine(string commandLine)
    {
        string parsedCommandLine = ParseInternal(commandLine);

        IStringColorer colorer = PluginFinder.FindInterface<IStringColorer>();

        if(colorer != null)
            parsedCommandLine = colorer.Decorate(parsedCommandLine);

        return parsedCommandLine;
    }

    private static string ParseInternal(string commandLine)
    {
        //TODO: implement parsing as desired
        return commandLine;
    }

}

MOST IMPORTANTLY:  Test, test, test between each change.


答: For standalone applications.  When you know your application cannot handle the exception you could, instead of throwing the checked RuntimeException, throw Error, let the application crash, hope for bug-reports, and fix your application.  (See the answer of mrmuggles for a more in depth discussion of the pro's and con's of checked versus unchecked.)</p>

Title: Is it good practice to catch a checked exception and throw a RuntimeException?

Body: I read some code of a colleague and found that he often catches various exceptions and then always throws a 'RuntimeException' instead. I always thought this is very bad practice. Am I wrong?</p>


问:
How to Document the Security/Encryption Code of an Application
I am working on an application that I developed a security layer for. It uses the hardware ID of the hard drive, MAC address and another hardware serial key, to lock the software a particular piece of hardware.

I came across sites online, that said I should use fairly weird names for the procedures/functions/variables in the the security layer. For instance

```<code>function XtDmat: Boolean;
var
  x3mat: string;
  hhiTms: Interger;
begin
  Result := False;
  x3mat := GWindosColr;  //this returns the HD ID
  hhiTms := GalilDriverID; //this gets a controller ID
  if (t5gFx=x3mat) and (hhiTms=f4teXX) then Result := True; //match IDs with those saved in the registry
end;
</code>```

And for the messages dialog box:

```<code>procedure Tfrm_MainWindow.mxProtectorExpiration( Sender: TObject );
begin
  lbl_Remaining.Caption := GetClassPath('xsedfers34;;''kd'); // encrypted value  decryted and shown       '0 days remained'
  lbl_Message.Caption := GetClassPath('qwe23vftTxxx ii gtr');   //decryt and show       'This license has expired'
  btn_Go.Enabled := False;
end;
</code>```

I did this because I used Delphi DEDE to decompile my code and found even the registry key 'HCKU\software\myapplication' to be in plain sight.

Now, however, it has become difficult to

explain to my fellow team mates, why I did this (meaning the names),

document as the names do not make sense,

debug which gives me headaches.

Can anyone suggest a good way to document this type of code in this type of situation.
So the code becomes easier to, but is still diffcult to decompile. Alternatively, could one suggest a obfuscator for Delphi.

答:
Code comments aren't available to any decompiler I'm aware of.  Those are dropped on the floor either by your preprocessor or your lexer.  The parser never sees comments, let alone the compiler.  If you want to document bizarre code constructs, the comments are the place to do it.  That way you will see them in a debugger, but not in decompiled code, and they travel with the code.

That being said, my recommendation is to just use names that make sense.  People who want to defeat such measures mostly fall into two groups:  those who have no idea where to start, and those for whom obfuscated names are only a minor obstacle.  People in the latter group can crack most software protection in an hour or two.  Obfuscation like you're talking about is going to slow them down by maybe another hour.  After all, decompiled software is already obtuse.

I tell you this to encourage you to ask yourself if all this extra ongoing effort for your team is worth slowing down a cracker one time by an hour or two.


答:
IANAL, but given the exact quotation, this is my interpretation:

The right to be informed and served in French doesn't mean that your logs must be in French. The intent of your logs is not to inform and serve your customer, but you (the service provider).

For example if I go into a restaurant in Quebec, the law states that I have a right to be served in French. This doesn't mean I can demand the chef's diary (which is pretty much the equivalent to your log) to be written in French.

What I can demand of you - as the Microsoft architect stated - is the program output to be French. From a customer's perspective, your logs are not output, much like the chef's diary in a restaurant it not its "output".

The program output is what it generates in order to provide the user of the software with the service it is intended for. The log is not part of that service.


答:
In Quebec, language law (bill 101) is enforced by the Quebec Board of the French Language. They have information on their website regarding many questions that are generally asked about the bill 101 and its consequences on business. They can be contacted for more details, and they are the authority in this matters.

I think those are the main points that can have an impact on a business in Quebec :

Bill 101, article 5 (Consumer part of the law) states :

Consumers of goods and services have a right to be informed and served
  in French.

Not translating something in your product that can be read by a consumer in Quebec opens the door for legal consequences. Most of the time, the board will let you correct the situation before going to court.

Bill 101, article 4 (Worker part of the law) states :

Workers have a right to carry on their activities in French.

This means that a worker working in Quebec with your sofware has a right to ask his employer to provide him a translated version (or even an alternative sofware) in french. If you are not employing anyone in Quebec, you are not concerned directly by this law. But your clients may be. A Quebec government agency will always ask you a french version for its workers. Business partners of quebec government agencies may as well be bound by the same requirements (a la GPL).

Yet again, the board will always give you some time to adapt your processes, especially if you are working in R&D, or have mainly english speaking clients / partners (french link - summary : there are recuring debates about the language used in R&D companies in Quebec like Bombardier Aerospace. Some of them have long running exemptions because of their activities and/or clients.).


问:
Is there such a thing as feature bloat?
I have come across the expression software/feature bloat, but is this a real thing or should we rather be talking about things like performance problems, memory and disk footprint, user experience and on-demand installation? What am I missing here?</p>

答:
In my experience, it is because feature bloat is a root cause of problems rather than a direct problem that it useful to think of it separately.

In addition to the potential problems for the end user listed in the original question, feature bloat can have significant maintenance cost. When adding a new feature it's important to not only consider the cost of developing that feature, but maintaining it over the lifetime of the product. The oft-quoted rule of thumb is that time spent on a feature is 20% development and 80% maintenance, but in the real world it varies widely depending on feature complexity and degree of interaction with other features.

Title: Is there such a thing as feature bloat?


答:
I think software bloat and feature bloat are two differentt things.

A particular feature could be implemented with less code, so it's not the feature but the software that is the root of the cause. Developers need to be constantly reminded to not add features that weren't requested.

It's tempting to jump all over the number of user requests. Sure they can ask too much relative to the development resources available, but programmers often add features of their own. Developers tend to bring a bazooka to a mosquito hunt.

Title: Is there such a thing as feature bloat?

Body: I have come across the expression software/feature bloat, but is this a real thing or should we rather be talking about things like performance problems, memory and disk footprint, user experience and on-demand installation? What am I missing here?</p>


答:
The reason you have the three problems described is that you have broken the fundamental rules for writing maintainable code. The code you have written is therefore largely unmaintainable, and rather than attempting to document yourself out of the problem (a task doomed to fail), the code should be repaired.

I came across sites online, that said I should use fairly weird names for the procedures/functions/variables in the the security layer

I hope you don't believe everything you read on the internet. Have a read of work by Bruce Schneier, particularly "Secrets and Lies" before doing anything more that makes any claims regarding security. If your security model relies on obscurity, it's fatally flawed, and if it does not need obscurity to work, then why make it impossible to maintain.  If you really must have obscurity in the final, shipped code, use a pre-processor to modify the maintainable source and build the obscure program.

Title: How to Document the Security/Encryption Code of an Application

Body:
I am working on an application that I developed a security layer for. It uses the hardware ID of the hard drive, MAC address and another hardware serial key, to lock the software a particular piece of hardware.

I came across sites online, that said I should use fairly weird names for the procedures/functions/variables in the the security layer. For instance

```<code>function XtDmat: Boolean;
var
  x3mat: string;
  hhiTms: Interger;
begin
  Result := False;
  x3mat := GWindosColr;  //this returns the HD ID
  hhiTms := GalilDriverID; //this gets a controller ID
  if (t5gFx=x3mat) and (hhiTms=f4teXX) then Result := True; //match IDs with those saved in the registry
end;
</code>```

And for the messages dialog box:

```<code>procedure Tfrm_MainWindow.mxProtectorExpiration( Sender: TObject );
begin
  lbl_Remaining.Caption := GetClassPath('xsedfers34;;''kd'); // encrypted value  decryted and shown       '0 days remained'
  lbl_Message.Caption := GetClassPath('qwe23vftTxxx ii gtr');   //decryt and show       'This license has expired'
  btn_Go.Enabled := False;
end;
</code>```

I did this because I used Delphi DEDE to decompile my code and found even the registry key 'HCKU\software\myapplication' to be in plain sight.

Now, however, it has become difficult to

explain to my fellow team mates, why I did this (meaning the names),

document as the names do not make sense,

debug which gives me headaches.

Can anyone suggest a good way to document this type of code in this type of situation.
So the code becomes easier to, but is still diffcult to decompile. Alternatively, could one suggest a obfuscator for Delphi.


问:
Apps for facilitating live code demos?
I really enjoy watching live code demos, especially when time is focused on what the code is doing instead of what the presenter is typing.  Many seem to be using apps to manage their clipboard to paste code into the IDE.  What apps are out there for skillfully managing your clipboard to seamlessly do a code demo?

UPDATE:

I found this app that Apple engineers use called DemoMonkey.  It's actually an OS X app demo for, ironically enough, the clipboard and system services.  The link includes the source so creating a PC equivalent would be easy, is there really nothing out there?

答:
It depends :

if you're only looking for a better clipboard utility, you may try Ditto which is free and open source (and has a portable version, which is handy when you bring a USB key with your favorite tools with you everywhere :-)

otherwise for webapp demos, it's useful to clean your favorites bar in the browser (even temporarily) and keep the shortcuts of what you intend to present there, that makes it easy to access from any tab; also, an online editor like the one of Github or Cloud9 combined with saved snipplets (you can save snipplets with gists or Snipplr for example) can keep your code snipplets just a click away.

for desktop app demos, shortcuts on the desktop and/or important files to demonstrate (e.g. to demo the import capibility of an app) are pretty handy

Beyond that, Launchy can be very handy to keep your shortcuts always accessible (whether it's for web or desktop apps) without having to break the flow of your demonstration by switching to the desktop.

Edit: Depending on the type of code you're presenting, services like JSFiddle or Dabblet can also be useful because they serve as snipplets repository, online editor and execute your code.

Title: Apps for facilitating live code demos?


问:
Web Development: is always Typing necessary or can type on demand work?
I realize this idea might seem really foreign but I started thinking about this a bit back.

Far as web sites go, at least in my experience, there is far more time spent retyping things to a String than the other way around.  For instance:

Say you have a user model:

```<code>user
  int UserId
</code>```

And I wanted to log the user in:

```<code>View  -> string to int -> controller -> int to dbInt -> database -> dbint to int -> controller -> int to string -> View
</code>```

At no point in that whole exchange did I need an int.  The one typing I did need was with the database, but that's just kind of expected.

Now if I wanted to show a list of users based on a group id, the same thing happens except that UserId conversion happens for how many there are on the list and in the end it will just be represented as a string in the UI.

Now I understand that a string might be larger memory wise than some types (bool for example) but is this more costly than all the typing that happens?

Could it be more productive to only type when needed (Validating a number, date, ect) and just leave them as strings for the most part?

答: There is no reason that you can't store every thing as string (db and presentation layers), particularly if that makes sense for your application. The only reason to resort to specific types is to enforce data integrity (eg date types, like you suggested in your post) or maybe because performance is required (eg using ints as id fields in database tables to join on as they should be faster). Performance should not be an issue unless you have a very high concurrency or slow/low powered hardware.</p>


答:
Memory usage is way down the list of the benefits of data typing.

Take dates for example.  If you are accepting a date in a form field, you likely want to be at least somewhat permissive about accepting the data in whatever format the user wants to enter it (i.e. 7/1/77 or 7-1-1977 or 7-77 if you're designing for an American audience might all be acceptable ways to represent July 1, 1977).  If you don't convert that to a DATE data type, however, then every piece of code that touches the string has to know what format it's in.  They all have to know how to manipulate that particular string representation  if, for example, you need to sort by the date or convert it to a preferred display format.  You could choose some sort of canonical string representation and convert the input string to the canonical representation and then code everything else to assume that the data is in the canonical representation before manipulation.  Of course, then every application might choose a different canonical representation so various libraries may work differently on different projects.  You are much better off simply converting the string to a date early in the process because then everything can simply operate on a date-- you can sort on the date, you can convert the date to a different string representation, you can extract components of the date, etc. in a simple, straightforward, and clear fashion.

Of course, you could design the user interface to prevent users from typing in free-form dates by requiring that, for example, they always use a date picker or they use separate fields for each date component (i.e. picking "July" from a drop-down list).  That mitigates some of the issues from the prior paragraph but it ties decisions made in the view layer about how best to collect data to decisions in other layers about how to present the data in the future.  And you're still stuck writing code that converts the various components to various other formats in order to sort, writing functions that do things like determine whether a date is a holiday or how to add 30 days to a particular date without using any date libraries.

Title: Web Development: is always Typing necessary or can type on demand work?

Body:
I realize this idea might seem really foreign but I started thinking about this a bit back.

Far as web sites go, at least in my experience, there is far more time spent retyping things to a String than the other way around.  For instance:

Say you have a user model:

```<code>user
  int UserId
</code>```

And I wanted to log the user in:

```<code>View  -> string to int -> controller -> int to dbInt -> database -> dbint to int -> controller -> int to string -> View
</code>```

At no point in that whole exchange did I need an int.  The one typing I did need was with the database, but that's just kind of expected.

Now if I wanted to show a list of users based on a group id, the same thing happens except that UserId conversion happens for how many there are on the list and in the end it will just be represented as a string in the UI.

Now I understand that a string might be larger memory wise than some types (bool for example) but is this more costly than all the typing that happens?

Could it be more productive to only type when needed (Validating a number, date, ect) and just leave them as strings for the most part?


答:
Depends on the language used, and your familiarity with it.

Many modern languages such as Python or Java are already so close to pseudocode that writing some ad hoc pseudocode first is wasteful, IMHO. Better just do it right away using the tracer bullet approach.

It's a different deal if you're making some low-level, close to metal things, or aren't yet comfortable with the language you're using. Then pseudocode can definitely be useful.

Title: Should one use pseudocode before actual coding?

Body:
Pseudocode helps us understand tasks in a language-agnostic manner. Is it best practice or suggested approach to have pseudocode creation as part of the development lifecycle? For instance:

Identify and split the coding tasks

Write pseudocode

Get it approved [by PL or TL]

Start Coding based on Pseudocode

Is this a suggested approach? Is it practiced in the industry?


问:
Understanding the Open Game License
I'm thinking about using the basic mechanics behind the D20 system royalty-free, however, I'm unsure if the OGL allows that. Any thoughts appreciated. And if I can't use the D20 system royalty-free, then any suggestions on other well tested systems appreciated as well.</p>

答:
From what I understand this means the software itself does not need to be open, but the methods/data it uses that are OGL need to be available and must be the same data the program uses.

That explains that interactive games may be made using the OGL, but the d20 System is very different.

More information can be found in the Software FAQ for the d20 system.

Title: Understanding the Open Game License