Skip to main content
Topic: Long lines... again! :P (Read 3416 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Long lines... again! :P

Yes, it's not the first time... lol

https://gist.github.com/emanuele45/8966233
This list contains, for each file in ElkArte, the longest line it has, along with the number of chars.

Long lines are not good in my book: they are badTM: most of them are the result of numerous concatenations and repeated and nested ternary operations, etc.

Well, if some one has nothing to do and wants to try to break up some of them, it's an easy task (mostly) that will bring you around the whole code. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Long lines... again! :P

Reply #1

What length did you use for to long?   I'm surprised there are only that many left :P

Re: Long lines... again! :P

Reply #2

There is no cut-off, this is just the longest of each file. :P
Bugs creator.
Features destroyer.
Template killer.

Re: Long lines... again! :P

Reply #3

The one in DataValidator can be nixed as soon as you bump the version to >= 5.2. Just use Filter.

Re: Long lines... again! :P

Reply #4

Where is the fun in that when you can have a completely undecipherable regex like that :P  Excellent point really, and then we can also remove the duplicate one in QueryString !

Re: Long lines... again! :P

Reply #5

You can also replace all of those validations with Zend Validator or Symfony's or anyone's really. They're more likely to stay on top of bugs.

Re: Long lines... again! :P

Reply #6

Oh, filter... I never used that one. I know I considered it. And then I wondered if it was better than a regex. I suppose so.

Re: Long lines... again! :P

Reply #7

It uses regular expressions but they are compiled in C so they are likely faster.

Re: Long lines... again! :P

Reply #8

Do we want to kill the IPv6 validation for filters?
Bugs creator.
Features destroyer.
Template killer.

Re: Long lines... again! :P

Reply #9

Forgot about this ... heck yes we do!