Top tag
Next privilege 200 Rep.
See reduced ads
~904 people reached

  • 0 posts edited
  • 0 helpful flags
  • 20 votes cast
comment Why should passwords be encrypted if they are being stored in a secure database?
Encryption and hashing are different things. Hash passwords, don't encrypt them. You never need to know them. You only need the user to be able to use the password to prove who he/she is. Hashing (with salt) allows this. Encryption, esp. symmetric encryption is wrong as it allows passwords to be recovered.
comment Why aren't user-defined operators more common?
@KonradRudolph SK-logic The elephant in the room is that to be able to do this "efficiently" you cannot use the "dragon book" approach to parsing. You will need so use a parsing approach that integrates some form of semantic analysis (declaring new operators), parsing (reading high level tokens) and tokenization. Dragon book style parsing has a strong separation between the approaches which makes it impossible to do this. Dragon book parsing however also makes for pretty bad error messages as humans don't write code in "stages". And nowadays we have enough memory.
comment types of encoding in xml
UTF-8 works with "strange" characters (like UTF-16), most other encodings don't work with arbitrary "strange" characters. The only difference between UTF-8 and UTF-16 is the multiple of bits used. There are some characters that can be expressed in two bytes by UTF-16 and 3 by UTF-8.
comment Code reuse: Reusing complex method vs. cherry-picking parts
If they are that dissimilar, probably you would indeed have to rewrite the entire parser part. Depending on the output format, you could reuse an in memory representation of your output (if it isn't worth it you wouldn't)
comment Is premature optimization really the root of all evil?
This is certainly correct. I guess that premature optimization is when code is made more complex / hard to understand for unclear benefits, in a way that has only local impact (design has global impact).
comment Is premature optimization really the root of all evil?
The code introduces further complexity, and will likely not be universally used. Backing it (and similar things) out keeps the code clean.