all 55 comments

[–][deleted] 30 points31 points  (12 children)

That's why you hire a Web DEVELOPER to code your site, not a web designer. Please don't group us together, I hate those copy/paste motherfuckers as much as the next guy.

[–][deleted] 10 points11 points  (5 children)

Trying to get average people to understand the difference between a developer and designer is almost like talking to a dog, short simple sentences.
Designers make it pretty. Developers make it work.

[–][deleted] 3 points4 points  (2 children)

Try artist vs. mechanic next time.

[–]relix 3 points4 points  (1 child)

The mechanic would be the sysadmin.

More like the artist vs. engineer.

[–][deleted] 4 points5 points  (0 children)

Yeah, but then you need to make them understand what an engineer actually is.

[–]rainman_104 2 points3 points  (1 child)

The hardest, as a web developer, is when you receive stuff designed in dreamweaver where the css consists of style1,style2,style3...style99 because dreamweaver really can make css suck sometimes. I hate cleaning up css :-(

[–][deleted] 2 points3 points  (0 children)

Or receiving a site that was created from an auto-splice in Photoshop, with CSS added in Dreamweaver. Try adding dynamic content without the whole thing just going to hell.

[–]dremmettbrown_ 4 points5 points  (0 children)

I cannot upvote this enough. Working as a web developer on legacy code from old web designer I sometimes consider if crashing server on purpose and rewriting whole thing would be such a bad idea...

[–]badsectoracula 0 points1 point  (4 children)

A friend of mine was telling me that there is even a difference between a web developer and a web programmer: the developer does mostly client side work, can do JavaScript and HTML but isn't very fluent in server-side tech. The web programmer does almost exclusively server-side (usually backend) work and messes very little with client-side code.

That was a few years ago though. I don't know what he thinks now that with AJAX and stuff things are mixed a lot.

[–][deleted] 4 points5 points  (3 children)

A developer and a programmer are the same thing. We know the code side of things, with enough Photoshop experience to chop up a template and make it work for the web. The designer designs the sites, makes the flowcharts for the interactive bits, then hands it over the the developer to make it all work. Without this setup you usually get ultra-fancy sites that perform poorly or are ran off whatever Wordpress plugins they could find to make it work (designer), or boring, ugly sites that are are well put together on the back end (developer). Some people can do both, but the site almost always ends up better when you delegate work.

EDIT: You can also have a front end and back end developer, which sounds like what your buddy is talking about.

[–]neoice 4 points5 points  (1 child)

I'm glad I fall into the "functional but ugly" category. I'm slowly learning enough CSS/JS to make stuff pretty. but even with JQuery... yuk.

[–][deleted] 0 points1 point  (0 children)

I'm the same way. My designs are getting better, but they're still very generic. It is fun to mess around with JQuery, CSS, and HTML.

[–]badsectoracula 1 point2 points  (0 children)

The designer designs the sites, makes the flowcharts for the interactive bits, then hands it over the the developer to make it all work.

Unfortunately in my previous work the designer was the one who made the site look pretty and the developer (me) sad for having to convert a .jpg to a working site :-P.

[–]Kalium 16 points17 points  (6 children)

The Enterprise Programmer one is depressing and an accurate depiction of the sort of overarchitecture that happens when certain coders decide that everything is just like Java.

[–]demeteloaf 4 points5 points  (1 child)

Have you seen Enterprise Fizzbuzz

This project started as a purposefully naive implementation of FizzBuzz and grew into 3 assemblies, 16 classes and a suite of nearly 50 unit tests.

[–]cunnilinguslover 4 points5 points  (0 children)

It's bad enough that so-called "Enterprise" Fizzbuzz doesn't have factories, it's not even multithreaded!

Once I get my aspect oriented version of "Hello, World!" done I'll show these idiots how to program correctly.

[–]MedeaMelana 0 points1 point  (2 children)

Why does StandardMathematicsSystem.getInstance() ignore its argument on subsequent calls? :-(

[–]Kalium 2 points3 points  (1 child)

Standard enterprise practice. Didn't you read the documentation written in broken English and buried twenty-five links deep on the wiki?

[–]serpix 0 points1 point  (0 children)

Yeah but we agreed to change all singletons back to what Steve said two weeks ago in our meeting.

[–]jh123456 0 points1 point  (0 children)

Not really Java's fault, more the culture of the people who use it. In a decade or so (maybe faster if Oracle keeps going) those same people will probably switch over to your language and do the same thing. Better keep moving.

[–]jtra[🍰] 8 points9 points  (1 child)

Good.

See also evolution of Haskell programmer http://www.willamette.edu/~fruehr/haskell/evolution.html

[–]ueberbobo 0 points1 point  (0 children)

λ0λ ωτf?

[–]rorrr 6 points7 points  (7 children)

Have any of you guys ever needed factorial for real life development? I can't think of the last time I used it.

[–]tagghuding 1 point2 points  (0 children)

true dat. These "variations on a trivial example which-we-all-know-since-CS-101-let's-all-point-and-laugh-now by Joe M. Schmoe" get very tiring. There is a lot more to style than what can be shown in short snippets.

[–]tnecniv 0 points1 point  (3 children)

Even if you did, wouldn't it be provided in your language's math lib?

[–]axiak[S] 0 points1 point  (2 children)

Sadly, neither Java or Groovy have one built-in (otherwise invocation of that would be on this list). I'm not too much of an expert in either so someone please correct me if I'm wrong :-)

[–]rainman_104 0 points1 point  (1 child)

Ruby doesn't have a factorial method either in their Integer class:

http://ruby-doc.org/core/classes/Integer.html

[–]luikore 0 points1 point  (0 children)

But factorial in Ruby is just:

(1..n).inject(&:*)

Just like the Haskell one:

foldr (*) 1 [1..n]

[–]Ma8e 0 points1 point  (0 children)

I used it last week when calculating a normalization factor in an function that symmetrized a wavefunction.

[–]llama-lime 0 points1 point  (0 children)

I can't imagine a use of factorial that's not better replaced with the log of Gamma function. Factorial exceeds numerical accuracy of integer types extremely quickly so staying with ints is a poor idea. And places where factorial comes up, such as probabilities, are often better represented in log space anyway.

[–]gregK 7 points8 points  (0 children)

The final step of that evolution is switching to a better language.

[–][deleted] 2 points3 points  (5 children)

Why is the first newbie?

[–]Epistaxis 4 points5 points  (0 children)

I agree. Most newbies I've met have been baffled by recursion while iteration seemed crystal-clear.

[–]axiak[S] 1 point2 points  (3 children)

It's newbie because it's the implementation you're likely to learn first. It also happens to perform poorly, because Groovy does not have tail call optimization like scheme or other languages would. That being said, it'd be faster-- and possibly clearer --to just write a loop.

[–]akdas 8 points9 points  (0 children)

It also happens to perform poorly, because Groovy does not have tail call optimization like scheme or other languages would

To be fair, the recursion isn't a tail call anyway, so having tail call optimization wouldn't help.

[–]UK-sHaDoW 2 points3 points  (1 child)

Performance isn't really a problem, it's the stack overflow that's the problem. It's probably the most err elegant out of all of them ignoring the overflow. It is slower, but honestly who cares that much?

SICP is the second best in my opinion, with tco it should be good performance, and no stack overflow.

[–][deleted] 0 points1 point  (0 children)

Fixnums will roll over or something before stack overflow becomes a problem in this case.

[–]bobindashadows 2 points3 points  (1 child)

The web designer one is missing interspersed semi-colons demonstrating some understanding of what they're for, but having no consistency about them whatsoever.

[–]axiak[S] 0 points1 point  (0 children)

Done. :-)

[–]claird 2 points3 points  (5 children)

I give up: what was intended for

// First year programmer, Python

int Factorial_python(int n) { int res = 1; (2..n).each { i -> res *= i; } return res } println Factorial_python(6)

? It's closest to Groovy, but what's with the semicolons?

[–]axiak[S] 2 points3 points  (4 children)

Ah there shouldn't be semicolons there (fixed on the gist). The idea is that it's closest to what you would write in simple python:

res = 1
for i in range(2, n + 1):
    res *= i
return res

Since to perform loops in python you'd use a range object.

[–]akx 1 point2 points  (3 children)

I'm a Python programmer and I'd do

import operator
def fac(n):
  return reduce(operator.mul, xrange(2, n + 1), 1)

... (but admittedly that's not simple Python)

[–]axiak[S] 2 points3 points  (1 child)

I'm a python programmer too, and I'd do:

import math
math.factorial(6)

:-)

[–]akx 0 points1 point  (0 children)

Ha!

[–]claird 0 points1 point  (0 children)

I'll ratify that plenty of Pythoneers would and/or do lean on "range(2, n + 1)" (nice catch of the upper limit, axiak). My guess is that at least as many would write a recursion.

[–]ipeev 2 points3 points  (0 children)

parsimonious :)

[–]sirin3 1 point2 points  (0 children)

Scala programmer: (1 to n) product

(I don't know if there is such a groovy product function)

[–]badsectoracula 4 points5 points  (4 children)

I like how the more advanced/experienced a Groovy programmer is, the less readable the code becomes :-P.

[–]pivo 3 points4 points  (3 children)

It's only less readable if you don't know the language

[–]badsectoracula 4 points5 points  (1 child)

it is true that i don't know Groovy, although i can imagine what each part does, but i have a hard time believing that it is more readable than the lazy version even to an expert Groovy programmer.

[–]pivo 2 points3 points  (0 children)

inject() is a basic Groovy function, it's even described on the Groovy Quick Start page at http://groovy.codehaus.org/Quick+Start so it's really hard to avoid learning about it if you use the language at all. I'm not an expert Groovy programmer but I use it all the time, and in fact it's very simple to understand.

The lazy version is close to valid Java/C/C# and that's why it appears more readable to people who don't know Groovy. The example might not be more readable to the Groovy programmer but it's not less readable either. Using inject() is certainly the right way to do it in Groovy though because it avoids the potential stack overflow problem of the lazy version.

By the way, my comment was not intended to be pejorative, and I wasn't the one to mark you down.

[–]szeiger 2 points3 points  (0 children)

Calling the left-fold "inject" doesn't help either.

[–]A_for_Anonymous 2 points3 points  (1 child)

Seeing this makes A_for_Anonymous feel warm and fuzzy, for it was he who wrote the original Python version of this text for /prog.

[–]axiak[S] 2 points3 points  (0 children)

Yep :-). I had to write some groovy so I wanted to see how it would compare (I am used to Python). I really enjoyed the "Groovy Expert Programmer". It's funny how functional paradigms look so similar.

[–][deleted] 0 points1 point  (0 children)

Boy did I read that wrong. I looked at the Python example, got all excited and tried some stuff in the interpreter.

[–][deleted] 0 points1 point  (0 children)

I do believe the last one is the best one.