Thursday, April 2, 2015

meaning - Is this modification necessary, to add something between these two parts "You did something stupid" and "you tried to"?


There seems to be some errors in this post. I am trying to fix some.


Here is the original,



It may be a pain to see compile errors, but trust me, getting error here is good for you. You did something stupid you tried to compare string with int and decide which one is equal. This does not make any sense to the computer most of the time (nor does it make sense to human), so you should never be able to run program like this. Computer says “No!” and you have to cope with that.




First of all, rewrite this expression


"You did something stupid you tried to compare string with int and decide which one is equal"


to


"You did something stupid you tried to compare string with int and check if the two are equal"


Secondly, there is a piece of code preceding this paragraph, so, it is reasonable to use past tense, "You did something stupid", actually there are 2 stupid things the author guide reader to do to understand the importance of type checking, which are



  1. tried to compare string with int

  2. tried to check if the two are equal




it seems that something is missing between "You did something stupid" and "you tried to", such as You did something stupid that you tried to.


Is this modification necessary?



Answer



The source you cited is full of grammatical errors. The sentence you are referring to is faulty too. From reading your question and skimming the source you posted, I presume the following is implied:



You did something stupid: you tried to compare string ("12") with integer (12) to see if they were equal.



Here, I used a colon (to make a dramatic impact, to emphasize the "stupid" mistake). You could use a semicolon too (that would be less dramatic). You could also use words:




The stupid thing you did is that you tried to compare string ("12") with integer (12) to see if they were equal.



Or



You did something stupid, which is that you tried to compare string ("12") with integer (12) to see if they were equal.



In formal writing, I would say "something" (i.e., additional words or punctuation) is definitely required to fill the void between "you did something stupid" and "you tried to..." But the source seemed quite informal to me. Even if it is in an informal setting, you will naturally pause after "you did something stupid" while speaking, which indicates that a punctuation is appropriate (not saying its mandatory).


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...