g | x | w | all
Bytes Lang Time Link
059Raku Perl 6 rakudo250416T184122Zxrs
047JavaScript Node.js250410T130707ZFhuvi
005Vyxal 3250410T100807ZThemooni
075AWK250409T203118Zxrs
031Seriously160103T205600Zquintopi
00505AB1E160504T164044Zuser5340
00505AB1E161121T165936ZMagic Oc
025Perl 5170907T142434ZXcali
005Vyxal210427T204045ZAaroneou
032K ngn/k201027T183321Zcoltim
008Jelly210427T183237Zcaird co
098C210427T045835Zuser1033
nan201027T142839ZJane
022Husk201027T094847ZRazetime
114Wolfram Language Mathematica190301T054300ZKai
065PowerShell190301T050116Zmazzy
110Common Lisp170908T101411ZRenzo
061R160104T091841Zplannapu
009Pyth160103T194803ZFryAmThe
011Jelly170507T042922Zfireflam
057JavaScript170506T020533Zthatoneu
116Lua170506T071921ZWaffle
089Mathematica 89 Bytes170506T034830ZKelly Lo
088REXX170505T152959Zidrougge
234C#161121T232508ZPete Ard
332Racket161121T175217Zrnso
069PHP161121T155933ZTitus
073PHP161121T154017ZTitus
096JavaScript ES6161121T152654ZAxel Mat
125PostgreSQL160504T172640Zlad2025
092Factor160330T221521Zcat
159Python 3160211T002922ZArgenis
105Oracle SQL 11.2160210T210445ZJeto
035Unix shell + tr + printf160104T091800Zuser4853
039Perl 6160107T052944ZHotkeys
136Java160205T073257ZSean
028Perl 6160205T061925ZBrad Gil
066Brachylog160104T094629ZFatalize
104Haskell160105T011406Zfluffy e
067JavaScript ES6160103T195004ZETHprodu
064C160104T111006Zedc65
059C160104T213801ZRuud Hel
050C function160105T222234ZDigital
022Japt160103T194435ZETHprodu
040Ruby160103T194051Zdaniero
061Python160104T212954Zxnor
141Python 3160104T183605Zwflynny
104Python 2160104T204420Zmbomb007
166Python 3160103T204601Zcat
061MATLAB160104T120948ZStewie G
033CJam160104T105815Zusername
129C160104T085614ZDanwakee
021MATL160104T005742ZLuis Men
021CJam160103T193700ZGamrCorp
1226π”Όπ•Šπ•„π•šπ•Ÿ 2160103T220031ZMama Fun
008Pyth160103T215123Zlirtosia
015Jolf160103T204942ZConor O&
013Retina160103T193131ZAdnan
017CJam160103T201407ZMartin E
047Julia160103T194747ZAlex A.

Raku (Perl 6) (rakudo), 59 bytes, 51 chars

{.trans(('A'…'Z')=>('Z'…'A'),('a'…'z')=>('z'…'a'))}

Attempt This Online!

JavaScript (Node.js), 47 55 bytes

-8 bytes after finding mathematical tricks in other solutions

Using ASCII values to identify and transform letters only

s=>Buffer(s).map(c=>(d=c|32)>96&d<123?4+c^31:c)

Try it online!


c|32 puts letters in lowercase. Then we check if it's in the bounds a-z (in ASCII) to determine if it's a letter. And if it is, we calculate it's "inverted alphabet value" with the operation 4+[...]^31 that works the same on uppercase and lowercase letters.

Node.js' Buffer helps with converting string to ASCII values both ways.

Vyxal 3, 5 bytes

kBkly

Vyxal It Online!

kBklyΒ­β‘β€‹β€Žβ€Žβͺ⁑βͺ⁠βͺ⁑βͺβ€β β€Žβͺ⁑βͺ⁠βͺ⁒βͺβ€β€β€‹β‘β β‘β€Œβ’β€‹β€Žβ€Žβͺ⁑βͺ⁠βͺ⁣βͺβ€β β€Žβͺ⁑βͺ⁠βͺ⁀βͺβ€β€β€‹β‘β β‘β€Œβ£β€‹β€Žβ€Žβͺ⁑βͺ⁠βͺ⁒⁑βͺβ€β€β€‹β‘β β‘β€ŒΒ­
kB     # β€Žβ‘literal "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  kl   # β€Žβ’literal "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba"
    y  # β€Žβ£transliterate input from #1 to #2
πŸ’Ž

Created with the help of Luminespire.

<script type="vyxal3">
kBkly
</script>
<script>
    args=[["abcdefghijklmnopqrstuvwxyz"],["Programming Puzzles & Code Golf"],["Hello, World!"]]
</script>
<script src="https://themoonisacheese.github.io/snippeterpreter/snippet.js" type="module"/>

AWK, 75 bytes

@load "ordchr"
{for(;i++<NF;s=s chr(o>96?219-o:o>64?155-o:o))o=ord($i)}$0=s

Attempt This Online!

Seriously, 31 bytes

ΓΊΓΊΓ»+β•—ΓΊRΓΊΓ»R+╝,`;β•œΓ­uWDβ•›E(X0WX`MΞ΅j

Hex Dump:

a3a3962bbba352a396522bbc2c603bbda1755744be452858305758604dee6a

Try It Online

Expl:

ΓΊΓΊΓ»+β•—                             Put UPPERCASElowercase in reg0
     ΓΊRΓΊΓ»R+╝                      Put ESACREPPUesacrewol in reg1
            ,                     Fetch input.
             `             `MΞ΅j   Map over the characters in string as list, joining result
              ;β•œΓ­u                Find 1-index of character in UPPERCASElowercase
                  W     0WX       If it is positive (present): 
                   D              Convert back to 0-index
                    β•›E            Look it up in ESACREPPUesacrewol
                      (X          Delete the original character.
                                  (Else just leave the original character unchanged.)

I just realized the spec say no additional whitespace, but there is no way to suppress trailing newlines in Seriously output, so there is no Seriously solution.

05AB1E, 5 bytes

ΕΎnΕΎo‑

Uses CP-1252 character set.

Try it online!

Explanation:

ΕΎn    - Push [A-Za-z]
  ΕΎo  - Push [Z-Az-a]
    ‑ - Transliterate.

05AB1E, 5 bytes

ΕΎiΕΎk‑

Try it online!

       # Push input.
 ΕΎi    # Push [a-zA-Z]
   ΕΎk  # Push [z-aZ-A]
     ‑ # Transliterate a#(b -> c)

Perl 5, 28 25 bytes

24 bytes of code + 1 for -p

s/\pL/chr(4+ord$&^31)/ge

Try it online!

Vyxal, 5 bytes

kBklΔΏ

Try it Online!

Explanation:

kB     # Constant 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
  kl   # Constant 'ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba'
    ΔΏ  # Transliterate a(b -> c)
       # Implicit output

K (ngn/k), 32 bytes

{x^'![t,_t;(|t),|_t:`c$65+!26]x}

Try it online!

Builds a dictionary mapping the letters to their "reverses", filling any non-letter character with what was in the input.

k4, 24 bytes

{x^![|,/|l;,/l:.Q`a`A]x}

Similar to the above, but benefits from using the built-in lists of characters; .Q.A for uppercase letters, and .Q.a for the lower case ones.

Jelly, 8 bytes

Γ˜αΊ Ε’sU,Ɗy

Try it online!

How it works

Γ˜αΊ Ε’sU,Ɗy - Main link. Takes S on the left
ØẠ       - Yield "ABC...XYZabc...xyz"
      Ɗ  - Last three links as a monad f("ABC...XYZabc...xyz"):
  Ε’s     -   Swapcase
    U    -   Reverse
     ,   -   Pair
       y - Translate S by this mapping

C, 112 98 bytes

i;main(){char x[99];gets(x);for(;x[i];i++)if(isalpha(x[i]))x[i]=(x[i]>90?219:155)-x[i];puts(x);}

I know that gets() is deprecated and unsafe, but scanf() doesn't accept whitespace and I need to include stdio.h if I want to fgets (since stdin is defined in stdio.h). I assume this program wouldn't work if the user tried to enter a string more than 99 characters.

EDIT: Changing printf("%s",x) to puts(x) saves 7 bytes and changing i<strlen(x) to x[i] saves another 7 bytes.

Python3

This is my first post on Code Golf; but I think I understood your question successfully;

This python3 code replaces abc -> xyz (as you specified above)

def ASUB(m,A,B):o = m.maketrans(A,B);r = m.translate(o);return(r);
ASUB(m="Programming Puzzles & Code Golf",
     A="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
     B="zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA")
#'Svool, Dliow!'
#'Kiltiznnrmt Kfaaovh & Xlwv Tlou'

the output of the both messages (Hello, World! and the other one) is in # comments

EDIT: Thanks for clarifying caird coinheringaahing!

Improved:

def A(m):o=m.maketrans("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA");return m.translate(o);

Husk, 22 bytes

σ…'A'Z…'Z'Aσ…'a'z…'z'a

Try it online!

Wolfram Language (Mathematica), 114 bytes

(a=Alphabet[];b=Capitalize/@a;r:=Reverse;u=AssociationThread[a~Join~b->r@a~Join~r@b];StringJoin[Characters@#/.u])&

Try it online!

PowerShell, 65 bytes

-join($args|% t*y|%{[char]($_,(($_-bxor31)-4))[$_-match'[a-z]']})

Try it online!

Common Lisp, 110 bytes

(lambda(s)(map-into s(lambda(x)(if(alpha-char-p x)(code-char(-(if(upper-case-p x)155 219)(char-code x)))x))s))

Try it online!

Very straightforward solution.

R, 69 61 bytes

Thanks to @Giuseppe for shaving off some extra bytes:

function(s)cat(chartr("a-zA-Z",intToUtf8(c(122:97,90:65)),s))

Previous version:

function(s)cat(chartr("a-zA-Z",rawToChar(as.raw(c(122:97,90:65))),s))

This is an anonymous function. Usage:

> f=function(s)cat(chartr("a-zA-Z",rawToChar(as.raw(c(122:97,90:65))),s))
> f("Hello, World!")
Svool, Dliow!
> f("Programming Puzzles & Code Golf")
Kiltiznnrmt Kfaaovh & Xlwv Tlou
> f("This is
+ a multiline
+ example.")
Gsrh rh
z nfogrormv
vcznkov.

Pyth, 10 9

uXGr;H)2z

Thanks to Jakube for saving a byte with the new feature of ;!

Test Suite

A quick explanation: reduce starting with the input over the numbers 0 and 1. The operation to be performed is translate the lower case alphabet with either r...0 or r...1 which are the lower and upper functions from python, respectively, applied to it, and then reversed.

Jelly, 11 bytes

ØAΒ΅,UΒ΅;Ε’sΓ°y

Try it online!

JavaScript, 57 bytes

s=>{var k;for(var a=s.length-1;a>0;a--){k+=s[a]}return k}

Lua, 116 bytes

t={}for i=65,90 do a=('').char(i)b=a.char(155-i)t[a],t[a:lower()]=b,b:lower()end print((io.read"*all"):gsub("%a",t))`

Mathematica 89 Bytes

StringReplace[#,Thread[#~Join~#3@#->#2@#~Join~#2@#3@#]&[Alphabet[],Reverse,ToUpperCase]]&

48 Bytes of this is just long function names

REXX, 88 bytes

b=xrange(a,z)
a=lower(b)
do forever
  parse pull n
  say translate(n,reverse(b||a),a||b)
end

C#, 234 Bytes

Golfed:

string A(string s){string a="abcdefghijklmnopqrstuvwxyz",z=string.Concat(a.Reverse()),o="";s.ToList().ForEach(c=>o+=!z.Contains(char.ToLower(c))?c:char.IsLower(c)?z[a.IndexOf(c)]:char.ToUpper(z[a.IndexOf(char.ToLower(c))]));return o;}

Ungolfed:

public string A(string s)
{
  string a = "abcdefghijklmnopqrstuvwxyz",
    z = string.Concat(a.Reverse()), o = "";
  s.ToList().ForEach(c => o += !z.Contains(char.ToLower(c)) ? c :
  char.IsLower(c) ? z[a.IndexOf(c)] :
  char.ToUpper(z[a.IndexOf(char.ToLower(c))]));
  return o;
}

Testing:

Console.WriteLine(new Atbash().A("Programming Puzzles & Code Golf"));
Kiltiznnrmt Kfaaovh & Xlwv Tlou

Console.WriteLine(new Atbash().A("Hello, World!"));
Svool, Dliow!

Racket 332 bytes

(let p((l(map char->integer(string->list s)))(ol'())(g(Ξ»(n a b)(and(> n a)(< n b))))(t first)(c cons))
(cond[(empty? l)(list->string(map integer->char(reverse ol)))][(and(not(g(t l)96 123))(not(g(t l)64 91)))(p(rest l)(c(t l)ol)g t c)]
[(>(t l)95)(p(rest l)(c(- 122(-(t l)97))ol)g t c)][else(p(rest l)(c(- 90(-(t l)65))ol)g t c)]))

Ungolfed:

(define(f s)
  (let p ((l (map char->integer (string->list s)))
             (ol '())
             (g (Ξ» (n a b) (and (> n a) (< n b))))
             (t first)
             (c cons))
    (cond
      [(empty? l)
       (list->string (map integer->char (reverse ol)))]
      [(and(not (g (t l) 96 123)) (not(g(t l) 64 91)))
       (p (rest l) (c (t l) ol) g t c)]
      [(> (t l) 95)
       (p (rest l) (c (- 122 (- (t l) 97)) ol) g t c)]
      [else
       (p (rest l) (c (- 90 (- (t l) 65)) ol) g t c)]
      )))

Testing:

(f "abcdefghijklmnopqrstuvwxyz")
(f "Programming Puzzles & Code Golf")
(f "Hello, World!")

Output:

"zyxwvutsrqponmlkjihgfedcba"
"Kiltiznnrmt Kfaaovh & Xlwv Tlou"
"Svool, Dliow!"

PHP, 69 bytes

while(""<$c=$argv[1][$i++])echo ctype_alpha($c)?chr(ord($c)+4^31):$c;

mapping stolen from ETHproductions

PHP, 73 bytes

<?=strtr($argv[1],($b=strtolower($a=join(range(A,Z)))).$a,strrev($a.$b));

do this need any comments?

JavaScript ES6, 96 bytes

var R=i=>i.replace(/[A-z]/g,s=>String.fromCharCode(155-s.charCodeAt(0)+(/[a-z]/.test(s)?64:0)))

Not as good as the other JavaScript answer, but I thought I'd try myself.

PostgreSQL, 118 125 bytes

SELECT s,TRANSLATE(s,t||UPPER(t),REVERSE(t)||REVERSE(UPPER(t)))
FROM(SELECT text'Programming Puzzles & Code Golf's,text'abcdefghijklmnopqrstuvwxyz't)r

SqlFiddleDemo

Output:

╔══════════════════════════════════╦═════════════════════════════════╗
β•‘                s                 β•‘            translate            β•‘
╠══════════════════════════════════╬═════════════════════════════════╣
β•‘ Programming Puzzles & Code Golf  β•‘ Kiltiznnrmt Kfaaovh & Xlwv Tlou β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Input: SELECT text'...'s


EDIT:

Input as table:

SELECT s,TRANSLATE(s,t||UPPER(t),REVERSE(t)||REVERSE(UPPER(t)))
FROM i,(SELECT text'abcdefghijklmnopqrstuvwxyz't)r
GROUP BY s,t

SqlFiddleDemo

Output:

╔══════════════════════════════════╦═════════════════════════════════╗
β•‘                s                 β•‘            translate            β•‘
╠══════════════════════════════════╬═════════════════════════════════╣
β•‘ Hello, World!                    β•‘ Svool, Dliow!                   β•‘
β•‘ Programming Puzzles & Code Golf  β•‘ Kiltiznnrmt Kfaaovh & Xlwv Tlou β•‘
β•‘ abcdefghijklmnopqrstuvwxyz       β•‘ zyxwvutsrqponmlkjihgfedcba      β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Factor, 92 bytes

[ [ 65 90 [a,b] dup >lower 2dup [ reverse ] bi@ append -rot append zip >hashtable at ] map ]

An anonymous function. Making it case insensitive is... expensive.

Python 3, 164 159 bytes

def f(t,a="abcdefghijklmnopqrstuvwxyz",b=""):
 for c in t:u=64<ord(c)<91;c=c.lower();c=a[::-1][a.index(c)] if c in a else c;b+=c.upper() if u else c
 return b

Oracle SQL 11.2, 105 bytes

SELECT TRANSLATE(:1,a||UPPER(a),REVERSE(UPPER(a)||a))FROM(SELECT'abcdefghijklmnopqrstuvwxyz'a FROM DUAL);

Unix shell + tr + printf, 35 bytes

tr A-Za-z `printf %s {Z..A} {z..a}`

Here you are, a canonical answer in tr. I thought how could a question to transliterate the alphabet go without a canonical answer to transliterate the alphabet?

tr by itself does not even do a "Hello, World!" and as such isn't a programming language, so I marked the answer as noncompeting[1].

[1]: Edit: Actually, Unix shell is the language and tr is the standard library. Thanks to Downgoat and Digital Trauma for helping me spot this out.

Perl 6, 40 39 bytes

Since everyone else is doing anonymous functions:

my &f=*.trans(/\w/=>{chr $/.ord+4+^31})

(Thanks @b2gills for the tip)

Uses the same bit flipping voodoo as some of the other posts. I wasn't sure whether to include the variable/function declaration in the byte count, so I did just in case. Without it this solution is only 34 bytes.

Usage:

> f "zyxwvutsrqponmlkjihgfedcba"
abcdefghijklmnopqrstuvwxyz
> f "Kiltiznnrmt Kfaaovh & Xlwv Tlou"
Programming Puzzles & Code Golf
> f "Svool, Dliow!"
Hello, World!

Java, 136 bytes

void x(String i){for(char c:i.toCharArray()){if(Character.isLetter(c))c=c<91?(char)(90-(c-65)):(char)(122-(c-97));System.out.print(c);}}

Example usage:

class Test {
  static void x(String i){for(char c:i.toCharArray()){if(Character.isLetter(c))c=c<91?(char)(90-(c-65)):(char)(122-(c-97));System.out.print(c);}}
  public static void main(String[] args) {
    x("Programming Puzzles & Code Golf");
    // produces "Kiltiznnrmt Kfaaovh & Xlwv Tlou"
  }
}

Probably the worst commonly-used language in terms of byte size.

Perl 6, 28 bytes

{S:g/\w/{chr $/.ord+4+^31}/}

Usage:

# give it a lexical name
my &swap = { … }

say swap 'Programming Puzzles & Code Golf';
# Kiltiznnrmt Kfaaovh & Xlwv Tlou

say swap ('a'..'z').join
# zyxwvutsrqponmlkjihgfedcba

Brachylog, 66 bytes

_|hH(:64>:91<,77-H+78=X;H:96>:123<,109-H+110=X;HX),[X]:"~c"w,?b:0&

The lack of built-ins really hurts here, so we have to resort to good old ASCII codes computations.

The predicate brachylog_main expects a character codes string as input and no output, e.g. brachylog_main(`Hello, World!`,_).

Explanation

_                                                                  Β§ If the input is empty,
                                                                   Β§ return true
                                                                   Β§
 |                                                                 Β§ Else
                                                                   Β§
  hH(                                            ),[X]:"~c"w       Β§ Print variable X which
                                                                   Β§ depends on the head of
                                                                   Β§ the input as a char code
                                                                   Β§
                                                            ,?b:0& Β§ Recursive call on the
                                                                   Β§ tail of the input
                                                                   Β§
     :64>:91<,77-H+78=X                                            Β§ If H is capital, X =
                                                                   Β§ 77 - H + 78
                       ;                                           Β§ Else if H is non-cap, X=
                        H:96>:123<,109-H+110=X                     Β§ 109 - H + 110
                                              ;                    Β§ Else (not a letter)
                                               HX                  Β§ H = X    

Haskell, 119 104 bytes

Saved 15 bytes thanks to @nimi.

c=fromEnum;s=toEnum;f[]="";f(x:y)|64<c x&&c x<91=s(155-c x):f y|96<c x&&c x<123=s(219-c x):f y|0<1=x:f y

Usage:

f "abcdefghijklmnopqrstuvwxyz"
"zyxwvutsrqponmlkjihgfedcba"

f "Programming Puzzles & Code Golf"
"Kiltiznnrmt Kfaaovh & Xlwv Tlou"

f "Hello, World!"
"Svool, Dliow!"

Explanation

let c=fromEnum;s=toEnum;--wrap names for later use, fromEnum gets ascii code from char, toEnum gets char from ascii code
f[]=[];                 --feed empty list (of chars in this case), get empty list
f(x:y)                  --feed a list, separate the first element and...
|64<c x&&c x<91=        --if its an uppercase char (using ascii code range)...
s(c x*(-1)+155)         --  inverse its ascii code value, move it to the range of uppercase and get the new char
                        --  (like rotating half turn a ruler by the side and then sliding it to the space it previously occupied)
:f y                    --  feed the rest of the list and stick the new char in front of the result
|96<c x&&c x<123=       --if its a lowercase char (using ascii code range)...
s(c x*(-1)+219)         --  inverse its ascii code value, move it to the range of lowercase and get the new char
:f y                    --  feed the rest of the list and stick the new char in front of the result
|True=x:f y             --otherwise feed the rest of the list and stick the char in front of the result

I'm new to Haskell... to functional programming... and to the site, and i know there are (a lot of) better answers to this question, but bear with me.

JavaScript (ES6), 69 67 bytes

x=>x.replace(/[A-Z]/gi,c=>String.fromCharCode(c.charCodeAt()+4^31))

Uses the same strategy as my Japt answer:

x=>x.replace(/[A-Z]/gi,C=>   // Replace each letter C with
 String.fromCharCode(        //  the character with char code
  C.charCodeAt()+4^31))      //   the char code of C, plus 4, with the last 5 bits flipped.

Curse your incredibly long property names, JS...

C, 64

A void function that modify the string in place.

t(char*p){for(int c;c=*p;)*p++=c>64&c<91|c>96&c<123?(c^31)-4:c;}

Test: ideone

C, 59 bytes

Sorry for bringing up C again, but I was a bit disappointed to see only C functions here. I was under the impression OP was looking for a usable product.

main(c){while(~(c=getchar()))putchar(isalpha(c)?c+4^31:c);}

Compiled on Ubuntu 14.04 with a simple:

cc swalpha.c

The resulting executable reads any number of lines from stdin, and writes the result to stdout.

Thanks to so many of the other posters for the XOR trick.

C (function), 50

f(char*s){for(;*s;s++)*s=isalpha(*s)?*s+4^31:*s;}

This builds on all three previous C answers, so credit to @Ruud, @Danwakeem and @edc65.

This function modifies a char array in place.

My understanding is function entries are allowed unless explicitly banned in the question.

Try it online.

Japt, 23 22 bytes

Ur"[A-Za-z]"_c +4^31 d

Try it online!

How it works

Ur"[A-Za-z]"_  // Take the input and replace each letter with:
 c +4          //  Take its char code and add 4. This results in
               //  the string      "ABC...XYZabc...xyz"
               //  becoming        "EFG...\]^efg...|}~".
 ^31           //  XOR the result by 31. This flips its last five 5 bits.
               //  We now have     "ZYX...CBAzyx...cba".
 d             //  Convert back from a char code.
               // Implicit: output last expression

Ruby, 40 bytes

New solution: Stole that bit flipping magic from some of the other posts here:

->s{s.gsub(/[a-z]/i){($&.ord+4^31).chr}}

Ruby, 55 46 bytes

->s{s.tr'a-zA-Z',[*?A..?Z,*?a..?z].reverse*''}

9 bytes off thanks to @manatwork


test run:

->s{s.gsub(/[a-z]/i){($&.ord+4^31).chr}}["Kiltiznnrmt Kfaaovh & Xlwv Tlou"]
=> "Programming Puzzles & Code Golf"

Python, 61 bytes

lambda x:''.join([c,chr(ord(c)+4^31)][c.isalpha()]for c in x)

An anonymous function. On letters, does the reversing operation on the bit representation by adding 4, then flipping the last five bits, similar to ETHproductions' Javascript answer.

Python 3, 141 bytes

Similar to @cat, but uses a dict to map letters and uses a simpler comprehension for the print:

a=__import__('string').ascii_letters;l,u=a[:26],a[26:];m=dict(zip(a,l[::-1]+u[::-1]));print(''.join(m[c] if c in a else c for c in input()))

Ungolfed:

a = __import__('string').ascii_letters; # import alphabet
l, u = a[:26],a[26:];                   # separate lower/uppercase
m = dict(zip(a, l[::-1] + u[::-1]));    # create map a-z+A-Z -> z-a+Z-A
print(''.join(m[c] if c in a else c     # if input char in map, map it
                   for c in input()))   # otherwise leave it alone

Python 2, 104 bytes

Pretty simple using str.translate and string.maketrans.

from string import*
u=ascii_uppercase
l=u.lower()
f=lambda x:x.translate(maketrans(u+l,u[::-1]+l[::-1]))

Try it online

This last line would also work, since string is imported:

f=lambda x:translate(x,maketrans(u+l,u[::-1]+l[::-1]))

Python 3, 195 169 168 166 bytes

Thanks to @TrangOul for -2 bytes!

How didn't I see that I could have golfed that down before?

x=__import__('string').ascii_letters;y,z=x[26:],x[:26];a,b=y[::-1],z[::-1];print(''.join(b[z.index(i)]if i in b else a[y.index(i)]if i in a else i for i in input()))

(sorta) ungolfed:

x = __import__('string').ascii_letters;
y, z = x[26: ], x[: 26];
a, b = y[::-1], z[::-1];
print(''.join(b[z.index(i)]
    if i in b
    else a[y.index(i)]
    if i in a
    else i
    for i in input()
))

Try it on Ideone!

MATLAB, 61 bytes

@(x)[abs(-x+ismember(x,65:90)*155+ismember(x,97:122)*219),'']

I tried f=@ismember, and making the range a=65:90 a variable and do 32+a in the second ismember-call. All this shortened the code, but would result in a program and thus require both disp and input.

This gives:

ans('Hello, World!')
ans =
Svool, Dliow!

ans('Programming Puzzles & Code Golf')
ans =
Kiltiznnrmt Kfaaovh & Xlwv Tlou

CJam, 33 bytes

q['a{_)}25*]_eu+['z{_(}25*]_eu+er

Explanation:

q                   e# Read all input an put string to the stack
[                   e# Start array (char)
    'a              e# Put 'a' char to the stack
    {               e# Begin of code block
        _           e# Duplicate top element on the stack
        )           e# Increment the duplicate
    }               e# End of code block
    25*             e# Repeat code block 25 times
]                   e# End array
_                   e# Duplicate array
eu                  e# Uppercase the duplicate
+                   e# And join arrays
['z{_(}25*]_eu+     e# Repeat the same thing back from Z
er                  e# Replace A-z with z-A in the input

C, 150 129 Bytes

void rev(char*s){int i,t;for(i=0;i<strlen(s);i++){t=s[i]+25;t=t<116?180-t:244-t;isalpha(s[i])?printf("%c",t):printf("%c",s[i]);}}

This function just converts char to int and adds the appropriate offset to the int before printing. I know it's not the shortest but I didn't see a C implementation.

Example usage

#include<stdio.h>
#include<string.h>
#include<ctype.h>

void rev(char*s){int i,temp;for(i=0;i<strlen(s);i++){temp=s[i]+25;temp=temp<116?180-temp:244-temp;isalpha(s[i])?printf("%c",temp):printf("%c",s[i]);}}


int main(){
   char *s = "hello, there";
   rev(s);
   return 0;
}

UPDATE: shortened a variable name.

MATL, 21 28 bytes

Uses version 6.0.0, which is earlier than this challenge. The code runs in Octave.

jttk2Y2mXK)o31Z~4-cK(

Example

>> matl
 > jttk2Y2mXK)o31Z~4-cK(
 >
> Hello, World!
Svool, Dliow!

Explanation

j             % input string
t             % duplicate
tk            % duplicate and convert to lowercase
2Y2           % string 'abc...xyz'
m             % "ismember" function: produces logical index of letter positions
XK            % copy to clipboard K
)             % index into string to get its letters
o31Z~4-       % bitwise XOR with 31 and subtract 4
c             % convert to char
K             % paste logical index from clipboard K
(             % put back modified letters into original string

Old approach, 28 bytes

j1Y2!tkh"t@2#m@0v27b-)wXK)K(

CJam, 21 bytes

q'[,65>__el_@+W%@@+er

Not an optimal solution... yet... Try it online

Its hard to explain without grouping things, so here is a general explanation: gets input, pushes uppercase alphabet twice and lowercase twice, rotates things around, combines uppercase and lowercase strings, reverses one, and uses transliteration (similar to the Retina answer).

π”Όπ•Šπ•„π•šπ•Ÿ 2, 12 chars / 26 bytes (non-competitive)

Γ―Δͺ(ᢐ+αΆ›,ᢐᴙ+αΆ›α΄™

Try it here (Firefox only).

Added transliterate function after the challenge was posted.

Explanation

Γ―Δͺ(ᢐ+αΆ›,ᢐᴙ+αΆ›α΄™ // implicit: Γ―=input
Γ―Δͺ(           // transliterate Γ―...
   ᢐ+αΆ›,       // from uppercase+lowercase alphabet...
       ᢐᴙ+αΆ›α΄™  // ... to reversed uppercase+reversed lowercase alphabet
              // implicit output

Pyth, 8 bytes

XXzG)rG1

@xnor suggested this simpler approach on @FryAmTheEggman's Pyth answer, then I translated it to Pyth.

This uses the handy behavior of X (translate) when given only two arguments: it translates from the second argument to the reversed second argument. We do this first with the lowercase alphabet (G), and then with uppercased G.

Jolf, 15 bytes

~Ai+plpu+_pl_pu
~A              I don't know what to call this, besides "dictionary replace"
  i              the input
   +plpu         previous dictionary: lower + upper alphabet
        +_p1_pu  new dictionary: reversed lower + reversed upper

Test suite, or try it with your own input

Retina, 17 14 13 bytes

Code:

\T`w`_dZ-Az-a

Explanation:

\             # This suppresses the trailing linefeed
 T            # Switches to transliterate mode
  `w          # w is short for _0-9A-Za-z
    `_d       # d is short for 0-9
       Z-Az-a # Z-Az-a

This does some magic stuff and completes the task.

Try it here.

CJam, 17 bytes

I wanted to help GamrCorps golf his CJam solution, but the result ended up so different that I decided to make a separate answer.

q'[,_el^_W%32f^er

Try it online.

Explanation

q     e# Read all input.
'[,   e# Get a character range from the null byte up to and including "Z".
_el   e# Duplicate and convert to lowercase.
^     e# Symmetric set difference. Due to the lowercase operation only letters will not
      e# appear in both sets, and so we get a string with all uppercase letters followed
      e# by all lowercase letters, i.e "ABC...XYZabc...xyz".
_W%   e# Duplicate and reverse. Gives: "zyx...cbaZYX...CBA".
32f^  e# Take each character XOR 32 which swaps the case, so now we have:
      e#                               "ZYX...CBAzyx...cba"
er    e# Transliterate: substitute each character in the first string with the correspoding
      e# character in the second string.

Julia, 74 61 47 bytes

s->replace(s,r"[a-z]"i,t->Char(31$Int(t[1])-4))

This is a lambda function that accepts a string and returns a string. To call it, assign it to a variable.

We match each letter using a regular expression and replace each letter with the ASCII character corresponding to 31 XOR the ASCII code for the letter, minus 4.