|
chumpchous posted:the reason regex are so popular in perl is because regex syntax is actually much better than perl syntax
|
# ? May 21, 2013 15:32 |
|
|
# ? May 16, 2024 18:29 |
|
i feel like regex only exist out of a mistaken attempt to impress girls 'yeah that's a pretty scary lookin regex, just gonna leave it up on my screen here, that'll impress her'
|
# ? May 21, 2013 15:32 |
|
chumpchous posted:i feel like regex only exist out of a mistaken attempt to impress girls how would a girl see your screen?
|
# ? May 21, 2013 15:32 |
|
clearly you open up a shell for some reason or another "just gotta check some computer stuff" while you're installing her printer
|
# ? May 21, 2013 15:36 |
|
java question time. my understanding is that, taking advantage of the fact that java strings are immutable, identical strings are stored at the same location in memory. e.g.:code:
wouldn't that imply, then, that the == / != operators would work for comparing strings? I'd assumed that ==/!= were just comparing the values of the internal pointers (and wiki agrees with me here), so...?
|
# ? May 21, 2013 15:57 |
|
iirc they do work but its been a while since I did java. And I think maybe you were supposed to use .equals anyway for safety or something
|
# ? May 21, 2013 16:32 |
|
Seems reasonable
|
# ? May 21, 2013 16:33 |
|
I think its dumb that == compares identy (memory reference) by default. In python, it uses either a default implementation (I think comparing the __dict__ of the objects) or calls the __eq__ method. If you want object identity, you use the word "is" istead of "==".
|
# ? May 21, 2013 16:34 |
|
Ronald Raiden posted:I think its dumb that == compares identy (memory reference) by default. Ronald Raiden posted:Java has that too only it does it backwards. The less common usecase, identity comparison, is the operator '==', while the more useful one is the object method object.equals. Also java generics suck. Ronald Raiden posted:It depends on the language. Most modern high level languages have sane object equality comparison, which would allow 2 different objects with thesame value tobe equal. Generally, in languages that allow that, the notion of identity comparison, which is what you are referring to, is different. (for instance, 'is' in python) code:
|
# ? May 21, 2013 18:03 |
|
also here's a fun bug I found in my code this morningcode:
tbqh, I'm kind of really startled that it compiled at all.
|
# ? May 21, 2013 18:07 |
|
java interns constant strings. it also interns strings that you tell it to. using == to compare strings by value only works properly when both sides of the comparison are interned strings. don't do it
|
# ? May 21, 2013 18:15 |
|
Ronald Raiden posted:I think its dumb that == compares identy (memory reference) by default. Yeah but you have to remember that Java doesn't do operator overloading (except in the case of + for String concatenation and the interning that Nomnom mentioned) Janitor Prime fucked around with this message at 18:23 on May 21, 2013 |
# ? May 21, 2013 18:21 |
|
the + thing is kinda dumb but w/e. == is okayish and at least makes sense if you consider references as values separate from objects. then == is "compare the values of these variables". then problem is string interning, you can call an instance method to put an object in the perm gen and dedupe instances and poo poo. also the compiler will do this for you. it's terrible poo poo from 1995 when computers had 8 MB RAM and it's in the language forever
|
# ? May 21, 2013 18:45 |
|
tbh overall i think the + concatenates strings feature is a good thing. if thats the biggest criticism someone has about java then you know that they don't know much about java, or theyre obsessed with trivial poo poo
|
# ? May 21, 2013 18:47 |
|
chumpchous posted:i feel like regex only exist out of a mistaken attempt to impress girls this is the reason why everything exists
|
# ? May 21, 2013 19:55 |
|
PleasingFungus posted:java question time. my understanding is that, taking advantage of the fact that java strings are immutable, identical strings are stored at the same location in memory. e.g.: they work for comparing memory addresses, so if all your strings have unique locations in memory, yes you can use it to check equality. the assumption that every string you create has only one possible address is not a pleasant one. if you need to check string equality, use equals. if you need to check object identity, use ==. if you're needing to check object identity on strings, you will be better off using an enum to represent your constants, not strings.
|
# ? May 21, 2013 20:24 |
|
tef posted:they work for comparing memory addresses, so if all your strings have unique locations in memory, yes you can use it to check equality. the assumption that every string you create has only one possible address is not a pleasant one. Holy poo poo you nailed that one on the head I didn't think of it that way, but in hindsight it's obvious that checking object identity on strings implies that they are using them as enums.
|
# ? May 21, 2013 20:30 |
|
enums also make great singletons
|
# ? May 21, 2013 20:33 |
|
PleasingFungus posted:java question time. my understanding is that, taking advantage of the fact that java strings are immutable, identical strings are stored at the same location in memory. e.g.: for string litteralls this will work, but not string objects Java code:
|
# ? May 21, 2013 20:50 |
|
but yes, use enums instead.
|
# ? May 21, 2013 20:51 |
|
hi i am still a terrible programmer just thought id keep you updated
|
# ? May 23, 2013 05:16 |
|
to clarify, I haven't actually worked with java in over a year, & don't intend to do so any time soon. I just ran into the notion of string interning a few months ago, and started wondering how it interacted with ==. I hadn't realized that only constant & manually specified strings were interned; now that I know that, everything has fallen into place. it was a matter of idle curiosity and I am very satisfied with all answers, except tef because his answer assumed I knew more than I actually did (& was therefore useless w/o the other answers). actually - that's pretty flattering, so on second thought I'm happy with that answer too. terrible programmer update: ran into a bug in my personal project, failed to fix it or even find the root cause of it over several attempts/hours. eventually gave up & slapped on a lovely patch that appears to have "fixed" the problem. putting the over/under on 2 weeks until it shows up again in some horrible metastasized form. uugh.
|
# ? May 23, 2013 05:54 |
|
we will always be a terrible programmer, no need to keep reminding us
|
# ? May 23, 2013 05:54 |
|
Bloody posted:hi i am still a terrible programmer does your php program 'run out of numbers' because you used a lovely random number function
|
# ? May 23, 2013 06:04 |
prefect posted:in my (limited) experience, the perl community is pretty sensible oh right, this is a computer jokes thread. cool
|
|
# ? May 23, 2013 08:11 |
|
OBAMA BIN LinkedIn posted:oh right, this is a computer jokes thread. cool i apologize for being a worthless human being
|
# ? May 23, 2013 11:50 |
|
it's ok we all know you're a programmer
|
# ? May 23, 2013 12:08 |
so how long will it be before people realise that programming is a lifelong gravy train and wages then fall to account for increased supply of programmer? will this ever happen?
|
|
# ? May 23, 2013 12:13 |
|
OBAMA BIN LinkedIn posted:so how long will it be before people realise that programming is a lifelong gravy train and wages then fall to account for increased supply of programmer? will this ever happen? as long as computer nerds continue being truly awful people it should be good i'm doing my part. what terrible things have you done today (other than posting)?
|
# ? May 23, 2013 13:06 |
|
OBAMA BIN LinkedIn posted:so how long will it be before people realise that programming is a lifelong gravy train and wages then fall to account for increased supply of programmer? will this ever happen? ceos are way ahead of this. when zuck supports immigration reform it's because he wants to deflate wages. the golden age of easy work for fat stacks is dying this decade
|
# ? May 23, 2013 13:17 |
|
super easy way to deflate wages, without immigration: allow people to work remotely, let them live in bumfuck nowhere and pay them competitive prices according to where they live. near-shoring supremacy.
|
# ? May 23, 2013 14:38 |
|
Farmer Crack-rear end posted:does your php program 'run out of numbers' because you used a lovely random number function i wish my problems could be such frivolities my thesis is written in c++ poorly
|
# ? May 23, 2013 14:54 |
|
MononcQc posted:super easy way to deflate wages, without immigration: allow people to work remotely, let them live in bumfuck nowhere and pay them competitive prices according to where they live. near-shoring supremacy. i won't lie, i'm thinking of moving out of metro miami basically so i get a raise without more money
|
# ? May 23, 2013 15:33 |
|
do it and then get another job where u have to move back to the city w/ higher pay based on the cost of living differential.
|
# ? May 23, 2013 15:35 |
|
Cocoa Crispies posted:i won't lie, i'm thinking of moving out of metro miami basically so i get a raise without more money Still at the same job btw? I'll be in SF for a few days for work in June (10-15) if you're around during that time.
|
# ? May 23, 2013 16:01 |
people who offshore work/hire nothing but contractors out of country are scum
|
|
# ? May 23, 2013 16:17 |
|
i only hire offshore contractors for work that really sux and isn't going to be fun or creative. suck it 3rd world.
|
# ? May 23, 2013 16:26 |
|
MononcQc posted:Still at the same job btw? I'll be in SF for a few days for work in June (10-15) if you're around during that time. Same job, far side of the country though.
|
# ? May 23, 2013 16:29 |
|
AWWNAW fucked around with this message at 23:52 on Aug 20, 2013 |
# ? May 23, 2013 19:41 |
|
|
# ? May 16, 2024 18:29 |
|
do you accept applications from terrible developers willing to relocate
|
# ? May 23, 2013 19:54 |