Tuesday, March 17, 2020

How to Revise Your Paper for Clarity

How to Revise Your Paper for Clarity Writing and revising a paper is a time-consuming and messy process, and this is exactly why some people experience anxiety about writing long papers. It’s not a task that you can finish in a single sitting- that is, you can’t if you want to do a good job. Writing is a process that you do a little bit at a time. Once you come up with a good draft, it’s time to revise. Ask yourself the following questions as you go through the revision process. Does the Paper Fit the Assignment? Sometimes we can get so excited about something we find in our research that it sets us off in a new and different direction. It’s perfectly fine to veer off in a new direction, as long as the new course doesn’t lead us outside the bounds of the assignment. As you read over a draft of your paper, take a look at the directional words used in the original assignment. There is a difference between analyze, examine, and demonstrate, for example. Did you follow the directions? Does the Thesis Statement Still Fit the Paper? A good thesis statement is a vow to your readers. In one single sentence, you stake a claim and promise to prove your point with evidence. Very often, the evidence we gather doesn’t â€Å"prove† our original hypothesis, but it does lead to new discovery. Most writers have to re-work the original thesis statement so it accurately reflects the findings of our research. Is My Thesis Statement Specific and Focused Enough? â€Å"Narrow your focus!† You’re very likely to hear that many times as you progress through the gradesbut you shouldn’t get frustrated by hearing it time and again. All researchers have to work hard at zooming in on a narrow and specific thesis. It’s just part of the process. Most researchers revisit the thesis statement several times before they (and their readers) are satisfied. Are My Paragraphs Well-organized? You can think of your paragraphs as little mini-essays. Each one should tell its own little story, with a beginning (topic sentence), a middle (evidence), and an end (concluding statement and/or transition). Is My Paper Organized? While your individual paragraphs may be well-organized, they may not be well-positioned. Check to make sure that your paper flows from one logical point to another. Sometimes good revision starts with good old cut and paste. Does My Paper Flow? Once you make certain that your paragraphs are placed in a logical order, you will need to revisit your transition statements. Does one paragraph flow right into another? If you run into trouble with, you might want to review some transition words for inspiration. Did you Proofread for Confusing Words? There are several pairs of words that continue to vex the most accomplished writers. Examples of confusing words are except/accept, whose/who’s, and effect/affect. It’s easy and quick to proofread for confusing word errors, so don’t omit this step from your writing process. You can’t afford to lose points for something so avoidable!

Sunday, March 1, 2020

Method Overloading Default Parameters in Delphi

Method Overloading Default Parameters in Delphi Functions and procedures are an important part of the Delphi language. Starting with Delphi 4, Delphi allows us to work with functions and procedures that support default parameters (making the parameters optional), and permits two or more routines to have an identical name  but operate as completely different routines. Lets see how Overloading and default parameters can help you code better. Overloading Simply put, overloading is declaring more than one routine with the same name. Overloading allows us to have multiple routines that share the same name, but with a different number of parameters and types. As an example, lets consider the following two functions: {Overloaded routines must be declared with the overload directive} function SumAsStr(a, b :integer): string; overload; begin   Ã‚   Result : IntToStr(a b) ; end; function SumAsStr(a, b : extended; Digits:integer): string; overload; begin   Ã‚   Result : FloatToStrF(a b, ffFixed, 18, Digits) ; end; These declarations create two functions, both called SumAsStr, that take a different number of parameters and are of two different types. When we call an overloaded routine, the compiler must be able to tell which routine we want to call. For example, SumAsStr(6, 3) calls the first SumAsStr function, because its arguments are integer-valued. Note: Delphi will help you pick the right implementation with the help of code completion and code insight. On the other hand, consider if we try to call the SumAsStr function as follows: SomeString : SumAsStr(6.0,3.0) Well get an error that reads: there is no overloaded version of SumAsStr that can be called with these arguments. This means that we should also include the Digits parameter used to specify the number of digits after the decimal point. Note: There is only one rule when writing overloaded routines, and that is that an  overloaded routine must differ in at least one parameter type. The return type, instead, cannot be used to distinguish among two routines. Two Units - One Routine Lets say we have one routine in unit A, and unit B uses unit A, but declares a routine with the same name. The declaration in unit B does not need the overload directive - we should use unit As name to qualify calls to As version of the routine from unit B. Consider something like this: unit B; ... uses A; ... procedure RoutineName; begin    Result : A.RoutineName; end; An alternative to using overloaded routines is to use default parameters, which usually results in less code to write and maintain. Default/Optional Parameters In order to simplify some statements, we can give a default value for the parameter of a function or procedure, and we can call the routine with or without the parameter, making it optional. To provide a default value, end the parameter declaration with the equal () symbol followed by a constant expression. For example, given the declaration function SumAsStr (a,b : extended; Digits : integer 2) : string; the following function calls are equivalent. SumAsStr(6.0, 3.0) SumAsStr(6.0, 3.0, 2) Note:  Parameters with default values must occur at the end of the parameter list, and must be passed by value or as const. A reference (var) parameter cannot have a default value. When calling routines with more than one default parameter, we cannot skip parameters (like in VB): function SkipDefParams(var A:string; B:integer5, C:booleanFalse):boolean; ... //this call generates an error message CantBe : SkipDefParams(delphi, , True) ; Overloading With Default Parameters When using both function or procedure overloading and default parameters, dont introduce ambiguous routine declarations. Consider the following declarations: procedure DoIt(A:extended; B:integer 0) ; overload; procedure DoIt(A:extended) ; overload; The call to DoIt procedure like DoIt(5.0), does not compile. Because of the default parameter in the first procedure, this statement might call both procedures, because it is impossible to tell which procedure is meant to be called.