Are you proud of your code, Sup Forums?
Code quality
sometimes.
>memescript
MA WHAS FO DINNA?
SPAGHETTI SON SPAGHETTI!
He doesn't even use it to its full extent.
>var length = array.length;
OAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
Not exactly but it works atleast
If it works and you save a bunch of time then who gives a fuck. Unless it's a big project then you fuck every one over including future you.
>var length = array.length;
I do this to avoid calling the length function a gorillion times in a loop.
Never checked if there was actually any difference in performance.
Some of it. Maybe.
bait? bait
Please put your opening bracket on the same line as do.
t. K&R
>Are you proud of your code, Sup Forums?
Never.
No but I usually write quick and dirty because I have so many things to do
Always revise it later
Very
sed :: [String] -> String -> Memory (Message String)
sed _ ('s':x:xs) = do
let f :: (Bool, (Int, ((String, String), String)))
-> Char
-> (Bool, (Int, ((String, String), String)))
f (True, (n, ((a, b), c))) x'
| n == 1 && x' == x = (False, (n, ((a ++ [x'], b), c)))
| n == 1 = (False, (n, ((a ++ ['\\', x'], b), c)))
| n == 2 && x' == x = (False, (n, ((a, b ++ [x']), c)))
| n == 2 = (False, (n, ((a, b ++ ['\\', x']), c)))
| otherwise = (False, (n, ((a, b), c ++ ['\\', x'])))
f (False, (n, ((a, b), c))) x'
| n == 1 && x' == x = (False, (2, ((a, b), c)))
| n == 1 && x' == '\\' = (True, (n, ((a, b), c)))
| n == 1 = (False, (n, ((a ++ [x'], b), c)))
| n == 2 && x' == x = (False, (3, ((a, b), c)))
| n == 2 && x == '\\' = (True, (n, ((a, b), c)))
| n == 2 = (False, (n, ((a, b ++ [x']), c)))
| otherwise = (False, (n, ((a, b), c ++ [x'])))
(_, (_, ((match, replacement), string))) = foldl f (False, (1, (("", ""), ""))) xs
(ins, _:string') = break (== ' ') string
insensitive = ins /= "i"
regex = mkRegexWithOpts match False insensitive
liftIO $ print insensitive
e
It works and that is enough.
For some reason I never looked back to my older code and noticed that I improved anything or that it sucked in the first place. Probably because it was trivial, but still. I've only been doing this for the past year or so.
The only absolutely disgusting thing I did was when I wrote some small web scraper in python and didn't bother learning how to make a proper global, so I just passed one variable from function to function kek. I don't even know...
How can I see when I am improving the code anyway?
Ignore the quote from another thread. I'm a mobileposter.
I always make an effort to make my code as high quality as possible.
Re-factoring is one of my favourite things to do.
There is
8/10 job security theyll keep you around for decades to maintain that pile o shit.
it's true
if you can convince companies to use functional programming, you can keep your job
jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/
look at this
import scalaz._
import scalaz.std.list._
import scalaz.syntax.monad._
import scalaz.syntax.monoid._
import scalaz.syntax.traverse.{ToFunctorOps => _, _}
class Foo[F[+_] : Monad, A, B](val execute: Foo.Request[A] => F[B], val joins: Foo.Request[A] => B => List[Foo.Request[A]])(implicit J: Foo.Join[A, B]) {
def bar: Foo[({type l[+a]=WriterT[F, Log[A, B], a]})#l, A, B] = {
type TraceW[FF[+_], +AA] = WriterT[FF, Log[A, B], AA]
def execute(request: Request[A]): WriterT[F, Log[A, B], B] =
self.execute(request).liftM[TraceW] :++>> (repr => List(request -> request.response(repr, self.joins(request)(repr))))
----- REDACTED -------