This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
When we create a jsp in eclipse, should ascii or binary mode be used? I know the two modes are related to data transfer between local and cvs but there is no difference and impact in my project by switing them. Can anyone say something about the modes? Usually which one should be used for jsp?
JSPs are text files so ascii mode would be best (though the ascii-vs-binary question brings to mind FTP and not version control where usually the issue is binary vs text, but then I don't use CVS and different products use different terminology for the same thing)
When you check-in files into any version control systems for textual source codes you can use the default text or ascii mode, however, when check-in word doc, xls, image or class files you may need to use the binary mode.
The crucial differences are: A) What is the code page and B) what are the end-of-line characters.
The code page is almost always going to be ASCII unless you're working with IBM mainframes (EBCDIC).
The end-of-line characters may be CR (Macintosh), CR/LF (DOS/Windows) or LF (Unix, most others). LF is also referred to as NL (Newline).
When you indicate text mode - and this applies to both CVS and FTP - the server will translate to the appropriate code page and end-of-line sequence for yout target machine. When you indicate binary (a/k/a image) mode, the bytes will pass unmodified.
Binary mode is always safe, but because not all tools are smart, text mode is preferable when dealing with things that are 100% text. If you download a text file with in Unix mode end-of-line characters, Windows Notepad won't work right, although Wordpad and most IDE's will accommodate.
On the other hand, if you create a Unix shell script or C/C++ source file on a Windows machine and upload it in binary mode and it uses the end-of-line continuation (backslash) to semantically glue 2 lines together as though they were a single long line, binary mode will propagate the CR/LF. And most Unix tools won't like that, resulting in compile errors and scripts that won't execute.
Customer surveys are for companies who didn't pay proper attention to begin with.