Tag Info

New answers tagged

1

The main drawback is a loss of clarity. For instance: x.foo(); x.bar(); x.baz(); Since none of those statements return a value (or if they do, it's been ignored), they can only be useful if they produce side effects. Contrast that to: x.foo() .bar() .baz(); First, it's not clear that bar and baz operate on objects of the same type as x, unless you ...


0

Consider all the stylistic elements of programming languages (as opposed to hand-coding machine language), and it weakens the "semantics not convenience" argument. A whole lot of what we do as engineers is providing convenience around semantics.


3

Yes, there are drawbacks Code that is easy to read is good, but also beware of what the code communicates as well. When an object's methods always return the object, it communicates a couple of things: I require advanced configuration that isn't necessarily obvious in which order things should be set or configured Each subsequent method call builds on the ...


1

I've done some similar things (migrating a VB3 app to VB4, for example) with some perl scripts. The scripts would take the original file and produce two new files: one the output file (with the corrections) and the other a list of the changes/substitutions performed, as well as messages indicating that something unusual was seen and wasn't changed. I found ...


9

As @MainMa has well pointed out, the technical problem might can be solved with a certain effort, but not easily without the risk of introducing some hidden bugs into your codebase (and the risk is high if the codebase is large, and you would probably not have asked such a question for a small codebase). See this in contrast with the fact that this coding ...


2

Given your example, specifically the part where single quotes are not replaced, I don't think any off-the-shelf solution will do the job for you. I imagine that writing a custom tool which uses a JavaScript tokenizer would be too complicated as well. On the other hand, you may replace automatically single quotes by double quotes. With regular expressions, ...


5

Naming things can be tricky - A good rule of thumb is that if you are having trouble naming a class/function clearly then you should read it as a red-flag that you haven't thought about the architecture or design enough yet and should probably stop coding until you have. For naming stick to the name of the object/concept being modelled and exclude the ...


3

50 applications in 6 weeks sounds enormously ambitious. You need to tell your new CTO that this is only a lightweight review; there's no way you're going to detect bugs or security flaws in this time. I'm mostly familiar with code review for security, and the rule of thumb I use is 10 KLOC per day - and even that is ambitious, and can only be achieved by ...


3

Software or system security hugely depends on the type of system being designed, the data it stores and the regulatory/contractual environment it is used in. Most organizations often cannot articulate the level of security required in the systems they produce, either. Personally, I think about security on three levels. First is the highest level: the ...


2

Check out the Owasp secure coding guidelines: https://www.owasp.org/images/0/08/OWASP_SCP_Quick_Reference_Guide_v2.pdf and then check out the PCI-DSS standard. While PCI are guidelines for credit card processing, they can be used as a guide for having secure processes and code: https://www.pcisecuritystandards.org/documents/PCI_DSS_v3.pdf


7

It revolves around the principle of Unobtrusive JavaScript. The modern approach dictates that there should be a separation of functionality from presentation. I hate to cite Wikipedia, but give Wikipedia's article on Unobtrusive JavaScript a read. On a personal note there are three things about Unobtrusive JavaScript I quite like: Separation of ...



Top 50 recent answers are included