Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Stringent
Dec 22, 2004


image text goes here

tef posted:

shameless self promotion, but i've put another mechanically recovered post up

about spolsky

http://programmingisterrible.com/post/39726288528/hungarian-notation-security-by-anecdote

atwood, you're next.

quote:

Letting the runtime, instead of the programmer handle security was quite the missed opportunity his pet language Wasabi (An in-house coffeescript of vbscript).

tef fix this its hurting my brain

Adbot
ADBOT LOVES YOU

Morkai
May 2, 2004

aaag babbys
i had to dig back into some code i wrote in 2010, shoehorned changes into in 2011, and will be scrapping for a rewrite in 2013. every loving thing i did to get the changes done in 2011 was clever... i'm ashamed.

JawnV6
Jul 4, 2004

So hot ...

Stringent posted:

tef fix this its hurting my brain

poor stack management imho

double sulk
Jul 2, 2010

http://c.learncodethehardway.org/book/krcritique.html

lol zed

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

he's right, k&r isn't viable in a post "smashing the stack for fun and profit" world

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
a friend of mine has a "STRCAT" license plate because "when people use it i get paid"

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome
lol

quote:

Where K&RC runs into problems is when the functions or code snippets are taken out of the book and used in other programs.

wtf, this book sucks, it isn't even a cookbook, what the hell

Toady
Jan 12, 2009

Cocoa Crispies posted:

a friend of mine has a "STRCAT" license plate because "when people use it i get paid"

nice thing to drive around with that nobody understands

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Toady posted:

nice thing to drive around with that nobody understands

nobody understands "PSV 82M" either

Toady
Jan 12, 2009

right that's a license plate number

Opinion Haver
Apr 9, 2007

e: nvm

FamDav
Mar 29, 2008

sulk please go learn a thing tia

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
zed shaw is cool and has done lots of great things for the community

unfortunately, he's remarkably easy to troll




Gavinvin
Jan 3, 2013

Ambition is not a dirty word. Piss on compromise. Go for the throat.
I personally got taught how to program in python in our first year at university, and I thought it was great. Once we learnt the basics we spent most of the rest of our 4 year course doing Java, but also learnt C and Haskell too.

Now that I have graduated and I work for a small software house, I pretty much have to use whatever language I get told to use, or the legacy / brown field system are improving already uses, and I can easily be working in 3 or more languages a day, and its all because I started programming in python. It made understanding how to actually program easy, not just how to do something using the particular quirks or environment of one single language.

I guess I must have gone to a hipster university.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Gavinvin posted:

I personally got taught how to program in python in our first year at university, and I thought it was great. Once we learnt the basics we spent most of the rest of our 4 year course doing Java, but also learnt C and Haskell too.

Now that I have graduated and I work for a small software house, I pretty much have to use whatever language I get told to use, or the legacy / brown field system are improving already uses, and I can easily be working in 3 or more languages a day, and its all because I started programming in python. It made understanding how to actually program easy, not just how to do something using the particular quirks or environment of one single language.

I guess I must have gone to a hipster university.

no that's pretty much the way it shoudl be, a modern object-oriented language with functional parts like python or ruby is a great gateway to programming because you can get tangible progress faster

bondage and discipline languages designed to keep the mentally challenged from breaking things like java and c# where hello world takes five lines and a hello world web app requires like 80 lines of code and 90 xmls are obviously worse

languages that don't have the concept of a "string" like c are also terrible ideas

Gavinvin
Jan 3, 2013

Ambition is not a dirty word. Piss on compromise. Go for the throat.

Cocoa Crispies posted:

no that's pretty much the way it shoudl be, a modern object-oriented language with functional parts like python or ruby is a great gateway to programming because you can get tangible progress faster

bondage and discipline languages designed to keep the mentally challenged from breaking things like java and c# where hello world takes five lines and a hello world web app requires like 80 lines of code and 90 xmls are obviously worse

languages that don't have the concept of a "string" like c are also terrible ideas

Java's pretty easy to break.
code:
String a = "test";
String b = "test";

if(a == b){
    return true;
}
return false;
Can't tell you how many times I have seen students, and now fellow co-workers, fall for this bug, and spend hours wondering why a == b is never returning true.

Morkai
May 2, 2004

aaag babbys
the first language i learned in school was FORTRAN.

welp.

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

Morkai posted:

the first language i learned in school was FORTRAN.

welp.

our maths department still teaches that to students whose only prior experience is maple and maybe some mathematica and those weird stats languages. i think the coordinator's a sadist.

i only found this out when i was talking to someone doing it and they were like "oh you're a computer scientist are you? what languages do you learn? Fortran" and they seemed upset when i assumed they were taking the piss

X-BUM-RAIDER-X
May 7, 2008

Gavinvin posted:

Java's pretty easy to break.
code:
String a = "test";
String b = "test";

if(a == b){
    return true;
}
return false;
Can't tell you how many times I have seen students, and now fellow co-workers, fall for this bug, and spend hours wondering why a == b is never returning true.

lovely programmers basically

hey idiots, learn your operators

gonadic io
Feb 16, 2011

>>=
Why on earth do all these lovely programmers keep expecting == to test for equality?!

gonadic io fucked around with this message at 03:24 on Jan 6, 2013

X-BUM-RAIDER-X
May 7, 2008
it is, just not the equality you're thinking of

X-BUM-RAIDER-X
May 7, 2008
why the gently caress would you expect any operator to do a certain thing that corresponds to your conceptual model? learn the goddamn language idiots, this is Java, a language which illogically overloads + for string and for nothing else

X-BUM-RAIDER-X
May 7, 2008
my point being if you're not a terrible programmer then at the very least you should know exactly what the fundamental operators in your language do, and with a language like Java which occasionally overloads them, know all of the exceptions. stop loving complaining about being ignorant.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

OBAMA BIN LinkedIn posted:

my point being if you're not a terrible programmer then at the very least you should know exactly what the fundamental operators in your language do, and with a language like Java which occasionally overloads them, know all of the exceptions. stop loving complaining about being ignorant.

if you're not a battered wife you shouldn't work with java, it behaves in weird and unintuitive ways with basic poo poo like string equality

X-BUM-RAIDER-X
May 7, 2008
in all fairness people probably wouldn't think Java would automatically do string equality with == if it wasn't for the + overload. surely if it overloaded +, it overloaded == too right???

I still maintain though that if you knew what == did when given two objects, you probably wouldn't have this problem.

X-BUM-RAIDER-X fucked around with this message at 03:48 on Jan 6, 2013

tef
May 30, 2004

-> some l-system crap ->

Gavinvin posted:

I personally got taught how to program in python in our first year at university, and I thought it was great. Once we learnt the basics we spent most of the rest of our 4 year course doing Java, but also learnt C and Haskell too.

Now that I have graduated and I work for a small software house, I pretty much have to use whatever language I get told to use, or the legacy / brown field system are improving already uses, and I can easily be working in 3 or more languages a day, and its all because I started programming in python. It made understanding how to actually program easy, not just how to do something using the particular quirks or environment of one single language.

I guess I must have gone to a hipster university.

check your code privilege

tef
May 30, 2004

-> some l-system crap ->

OBAMA BIN LinkedIn posted:

I still maintain though that if you knew what == did when given two objects, you probably wouldn't have this problem.

i.e in languages where == means equality value rather than identity

X-BUM-RAIDER-X
May 7, 2008
Java is a pretty big loving fail imho

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

OBAMA BIN LinkedIn posted:

Java is a pretty big loving fail imho
modddddddds

salted hash browns
Mar 26, 2007
ykrop

OBAMA BIN LinkedIn posted:

Java is a pretty big loving fail imho

keep trollin' trollin' trollin' trollin' (what)

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
wait how many languages actually do string equality right?

Ruby code:
f = "asdf"
g = "asdf"
f.object_id == g.object_id #=> false
f == g #=> true
Python code:
f = "asdf"
g = "asdf"
id(f) == id(g) #=> True
g == g #=> True
Perl code:
$f = "asdf";
$g = "asdf";
# how do i do identity in perl
$f == $g; #=> 1
$f eq $g; #=> 1
JavaScript code:
f = "asdf";
g = "asdf";
// how do i do identity in js
f == g; //=> true

double sulk
Jul 2, 2010

C# is the best language you can start with in a CS program

also at least 1-2 courses in a CS curriculum should be dedicated solely to utilizing libraries/frameworks and reading/writing API documentation.

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

gucci void main posted:

C# is the best language you can start with in a CS program

also at least 1-2 courses in a CS curriculum should be dedicated solely to utilizing libraries/frameworks and reading/writing API documentation.

don't you mean a software engineering curriculum...

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

gucci void main posted:

C# is the best language you can start with in a CS program

c# is bad for the same reasons java is bad because it's the same language but they replaced some words, plus it's also only for a dying os and a pain in the rear end to install

javascript might be the best starting choice because you can build it up from html (and if you can't do html you can't do CS), and everyone already has a basic js environment installed

tef
May 30, 2004

-> some l-system crap ->

Cocoa Crispies posted:

wait how many languages actually do string equality right?

wait how many languages have strings as values rather than strings as object references.

quote:

Ruby code:
f = "asdf"
g = "asdf"
f.object_id == g.object_id #=> false
f == g #=> true

so ruby has no string cache, (unlike symbols).

quote:

Python code:
f = "asdf"
g = "asdf"
id(f) == id(g) #=> True
g == g #=> True

so python has a string cache, because immutable strings

Perl code:
$f = "asdf";
$g = "asdf";
# how do i do identity in perl
$f == $g; #=> 1
$f eq $g; #=> 1
cos in perl, strings are values, not references. you wanted to say

Perl code:
$a=\"foo"; 
$b=\"foo";

print ($a == $b?"T":"F")."\n"; # ref identity
print ($$a eq $$b?"T":"F")."\n"; # val equality

quote:

JavaScript code:
f = "asdf";
g = "asdf";
// how do i do identity in js
f == g; //=> true

identity in js is ===. strings are weird.

tef
May 30, 2004

-> some l-system crap ->

gucci void main posted:

C# is the best language you can start with in a CS program

thanks for standing in for shaggar.


quote:

also at least 1-2 courses in a CS curriculum should be dedicated solely to utilizing libraries/frameworks and reading/writing API documentation.

this is an idea so vague it can only end badly.

double sulk
Jul 2, 2010

:tipshat:

tef
May 30, 2004

-> some l-system crap ->
i would normally write a huge sperg effort post about which language to learn but i already have one of those waiting to be published.

tldr; walk before running. use the scripting languages your friend use

Catalyst-proof
May 11, 2011

better waste some time with you
Lisp code:
(let ((f "asdf") (g "asdf")) (cons (eq f g) (string= f g)))

(NIL . T)

Adbot
ADBOT LOVES YOU

Catalyst-proof
May 11, 2011

better waste some time with you
gently caress i love lisp

it's so beautiful

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply