|
Soricidus posted:Nobody who is familiar with both C++ and Java would claim that they are the same language. I will charitably assume you know one of them, and are being misled by the superficial syntactic similarities. Just write macros for java syntax, then write your c++ in java
|
# ? May 3, 2015 17:09 |
|
|
# ? Jun 8, 2024 06:48 |
|
Firstkind posted:I understand about 20% of the poo poo in this thread. I am googling poo poo like mad and researching all this garbage I don't know. But I have to say this one out loud. Designing your own language is called 'job security'. Also like most people have said already, a lot of languages seem to melt together when you've got a few under your belt. I'm not saying you need to be totally proficient, just enough to go "hey this is like that thing in that other language".
|
# ? May 3, 2015 23:34 |
|
Firstkind posted:You can't be real. You made that all up didn't you. I refuse to believe that this makes sense to someone. Yeah, computer programming is a vast discipline. Nobody is really expected to be an expert horizontally (i.e., nobody is expected to be fluent in all languages), and even vertical expertise is long-acquired. That's exactly why junior positions exist. The thing is, when you work with someone who clearly has more (better?) experience, it's often good to listen to them and follow their advice.
|
# ? May 4, 2015 01:03 |
|
I feel like this is like getting angry at musicians for having too many genres of music.
|
# ? May 4, 2015 02:13 |
|
Pavlov posted:I feel like this is like getting angry at musicians for having too many genres of music. "There are eighty eight keys on this thing?!?!?!?"
|
# ? May 4, 2015 02:21 |
|
ExcessBLarg! posted:The thing is, when you work with someone who clearly has more (better?) experience, it's often good to listen to them and follow their advice. If and when I find this guy I will hook on to them like a parasite and blame all my life's failures on them from that point forward. With that being said, anyone in the state of Massachusetts hiring for a junior position that will pay enough to live off bread and water and happen to have a nice shining bald head in which for me to latch my starfish like appendages on?
|
# ? May 4, 2015 04:11 |
|
Firstkind posted:stuff don't tell anyone but the actual hard part is not the languages but all the libraries, builds, idioms and other poo poo "Learn LANGUAGE_NAME_HERE" books don't teach you.
|
# ? May 4, 2015 10:26 |
|
uncleTomOfFinland posted:don't tell anyone but the actual hard part is not the languages but all the libraries, builds, idioms and other poo poo "Learn LANGUAGE_NAME_HERE" books don't teach you. There are some very good programming books out there these days. That said, most of your time would likely be spent trying to make sense of other use people's code and your specific problem domain.
|
# ? May 4, 2015 12:37 |
|
uncleTomOfFinland posted:don't tell anyone but the actual hard part is not the languages but all the libraries, builds, idioms and other poo poo "Learn LANGUAGE_NAME_HERE" books don't teach you. True programming is learning how to deal with code that stores all important program state in a global ArrayList<HashMap<String, Object>>.
|
# ? May 4, 2015 14:09 |
|
Pavlov posted:True programming is learning how to deal with code that stores all important program state in a global ArrayList<HashMap<String, Object>>. Related to this: discovered my own coding horror in writing a template-based binary search tree which essentially does the same thing as stl::map and spending significant time getting it to work.
|
# ? May 4, 2015 14:32 |
|
Pavlov posted:True programming is learning how to deal with code that stores all important program state in a global untyped Vector.
|
# ? May 4, 2015 14:39 |
|
uncleTomOfFinland posted:don't tell anyone but the actual hard part is not the languages but all the libraries, builds, idioms and other poo poo "Learn LANGUAGE_NAME_HERE" books don't teach you. This, syntax is relatively easy but design patterns, testing and all the other stuff is a lot more work.
|
# ? May 4, 2015 15:12 |
|
Wardende posted:You can write procedural or functional code in all of those languages. Yes. You can also do logical programming using C++ template metaprograms, but that doesn't mean it's a good language for doing that.
|
# ? May 4, 2015 18:25 |
|
Pavlov posted:True programming is learning how to deal with code that stores all important program state in a global ArrayList<HashMap<String, Object>>. Is this some sort of Java pattern or something cause I see Java programmers do this often and it drives me nuts.
|
# ? May 4, 2015 19:00 |
|
tyrelhill posted:Is this some sort of Java pattern or something cause I see Java programmers do this often and it drives me nuts. I've only encountered this recently, but I was talking about it with some guys, and the best guess we came up with was that it might be people with a background in databases trying to use a data-model they're familiar with. It makes a little sense because the way you access it kind of thing looks a little like a badly mangled SQL query.
|
# ? May 4, 2015 19:14 |
|
tyrelhill posted:Is this some sort of Java pattern or something cause I see Java programmers do this often and it drives me nuts. It's probably more a pattern of Java programmers. EDIT: Munkeymon posted:I never knew I needed a collective noun for Java programmers but thanks for coming up with one! Glad to help. Space Kablooey fucked around with this message at 19:36 on May 4, 2015 |
# ? May 4, 2015 19:14 |
|
tyrelhill posted:Is this some sort of Java pattern or something cause I see Java programmers do this often and it drives me nuts. I don't know if it's taught for Java but it's probably going to be the first idea that pops into a neophyte programmer's head when they need to have certain bits of information available everywhere. We all had that phase, right? "I got it! This is a totally justifiable exception to the never use globals rule!"
|
# ? May 4, 2015 19:14 |
|
HardDisk posted:a pattern of Java programmers I never knew I needed a collective noun for Java programmers but thanks for coming up with one!
|
# ? May 4, 2015 19:18 |
|
Just for fun, decided to write a primitive brute forcer to see how quickly my laptop could crack alphanumeric passwords of a given length (the answer is under 5 seconds for a 5-character password, with the obvious exponential increase to 3 minutes for 6 characters and a ridiculous length of time for anything longer -- but it should remind us all to use more than 7 characters in our passwords, since a determined attacker isn't going to balk at waiting an hour for admin access). It doesn't actually do anything offensive, just generates all possible alphanumeric strings.code:
Cons: everything else. It's me, I'm the coding horror. Purple Prince fucked around with this message at 20:31 on May 4, 2015 |
# ? May 4, 2015 20:15 |
Purple Prince posted:
This one took me longer than I'd care to admit to grok but I think it's very clever If you wanted to sacrifice speed for more "fun" , all you gotta do is condense those increments! I probably got something wrong here but I gave it a shot: code:
|
|
# ? May 4, 2015 21:07 |
|
|
# ? May 5, 2015 05:45 |
Ruzihm posted:This one took me longer than I'd care to admit to grok but I think it's very clever Honestly I'm still stumped by it. I can't figure out why password[curPos] would ever reach 255 (other than having been that already), and I can't figure out what meaning 62 has.
|
|
# ? May 5, 2015 06:51 |
|
It kind of reminds me of some too-clever example code in libfreenect:code:
Linear Zoetrope fucked around with this message at 08:21 on May 5, 2015 |
# ? May 5, 2015 08:14 |
|
VikingofRock posted:Honestly I'm still stumped by it. I can't figure out why password[curPos] would ever reach 255 (other than having been that already), and I can't figure out what meaning 62 has. The string is declared with its final position (think of it as a null terminator) at 255 elsewhere (I think this is unnecessary in retrospect; it should be possible to generate a string meeting that requirement based on length alone), and 62 is the number of alphanumeric characters (26+26+10). EDIT: I think this is the shortest you can make the code. code:
Purple Prince fucked around with this message at 11:12 on May 5, 2015 |
# ? May 5, 2015 09:47 |
|
hmmm
|
# ? May 5, 2015 15:30 |
|
I've always hated that browsers default the confirm buttons to OK and Cancel. And there's no good way that I know of in JS to do a blocking dialog where you can specify your own button text.
|
# ? May 5, 2015 16:02 |
That's just sad. That's a lesson to avoid any use of the word "cancel" to avoid ambiguity. Also, keep away from negative questions so you don't get your users into double-negative territory! Something along the lines of "This will empty your cart completely. Continue?" would be great.
|
|
# ? May 5, 2015 16:02 |
|
Ruzihm posted:That's just sad. [Cancel] is fine, but [OK] is always a terrible button. It should always be active, like [Delete] or [Remove] or [Clear], so I don't even have to read the message text at all.
|
# ? May 5, 2015 16:22 |
|
I was working on the back end of a website where users could make posts and whatever, and the post form included a box where they could include a youtube link that would then be embedded with the post. The product team wanted to add the ability for a user to upload a video from the post form, which would then be embedded; this was my job. This was a startup, I'd been working there for about four months at this point, and Senior rear end in a top hat had been there from the beginning (three or four years). He dictated how I had to implement this, which was that users would be uploading videos to the company's youtube account. I pointed out that users would upload copyrighted pornography and get our account deleted, and he said that we'd delete any offending videos before youtube could flag them (which is horseshit). I found a post on the youtube api blog saying that this would be a terrible idea because users would upload copyrighted pornography to our account (and also we'd probably run into quota issues); instead, we should use youtube direct (lite), which is just an iframe that lets users upload videos to their account after which we could optionally add the video to a playlist on our account (but if the video was copyrighted pornography then the user would be dinged, not us), which would also be much faster because the user would upload the video directly to youtube instead of uploading it to our server where we'd then upload it to youtube. But Senior rear end in a top hat knew better than the youtube api team, and the one person who was senior to him who could overrule him didn't want to get involved, so I could either do it the wrong way or quit - I didn't think this was anything that was stupid enough that we'd get sued over it (as opposed to, say, storing credit cards in plaintext), so I opted for the former. At this point I was debating whether to sabotage the functionality after it was released to production by uploading a bunch of copyrighted pornography and getting our account deleted - I'd rather that the functionality break sooner (when we'd lose a day's worth of uploaded videos, most of which users would still have on their hard drives) rather than later (when we'd lose a month's worth of uploaded videos). Fortunately it never came to that, because Senior rear end in a top hat couldn't figure out how to set up our OAuth tokens and didn't trust anybody else to do it, and so the project quietly died.
|
# ? May 5, 2015 16:25 |
|
Bognar posted:I've always hated that browsers default the confirm buttons to OK and Cancel. And there's no good way that I know of in JS to do a blocking dialog where you can specify your own button text. That's it. This one sort of dialogue blocks execution, whereas every other kind of dialogue box works through callbacks.
|
# ? May 5, 2015 16:30 |
lord funk posted:[Cancel] is fine, but [OK] is always a terrible button. It should always be active, like [Delete] or [Remove] or [Clear], so I don't even have to read the message text at all. You know, I 100% agree. But the phrasing of the question is important so that if you do read the message you don't get confused. Cancel is actually fine if you adhere to the "avoid double negatives" rule.
|
|
# ? May 5, 2015 16:38 |
|
Ruzihm posted:That's just sad. Would you like to cancel the cancellation of the original cancellation?
|
# ? May 5, 2015 18:35 |
QuarkJets posted:Would you like to cancel the cancellation of the original cancellation?
|
|
# ? May 5, 2015 18:44 |
|
lord funk posted:[Cancel] is fine, but [OK] is always a terrible button. It should always be active, like [Delete] or [Remove] or [Clear], so I don't even have to read the message text at all.
|
# ? May 5, 2015 18:52 |
|
There was an old Mac program called Hyperupic that converted images to sound. It was a really cool tool, but the author decided to be wacky and give all the alert buttons names like [Rock It!] and [Get Outta Here] and [Dang]. What was amazing is that you would work measurably slower in the app because you kept getting tripped up by the alert names.
|
# ? May 5, 2015 19:11 |
|
lord funk posted:There was an old Mac program called Hyperupic that converted images to sound. It was a really cool tool, but the author decided to be wacky and give all the alert buttons names like [Rock It!] and [Get Outta Here] and [Dang]. This is one of my minor UI irritations right now. Words like "OK", "Cancel", "Yes" and "No" are generally fairly neutral, but if you start getting creative then it does start tripping people up, as you mentioned, but it's also effectively putting words in the user's mouth, words that the user doesn't necessarily want there. Google seems to have made a global habit out of putting "Got it" instead of "OK" on all of their acknowledgement buttons, which irks me because "Got it" simply is not me. Worse, occasionally I see UIs where the acknowledgement button says "Thanks!", which is a great way to make people angry if they aren't particularly grateful for whatever it is the software just did, or if they're already angry at or frustrated with the software for any reason. I think UI designers think that this kind of thing equates to user-friendly software, but what it actually is is making the user be friendly to the software. Bearing in mind how much most of us hate almost all software, this is a bad road to start down. This said, I am okay with that one JavaScript dialogue box only having two hard-coded options, "OK" and "Cancel", because I believe that if you can't phrase your prompt in such a way that these two options are totally unambiguous, then you need to rephrase your prompt.
|
# ? May 5, 2015 20:37 |
|
qntm posted:This said, I am okay with that one JavaScript dialogue box only having two hard-coded options, "OK" and "Cancel", because I believe that if you can't phrase your prompt in such a way that these two options are totally unambiguous, then you need to rephrase your prompt. But why not "Yes" and "No"? It seems like the obvious choice when the question for confirmation is almost always "Are you sure..."
|
# ? May 5, 2015 20:49 |
|
Bognar posted:But why not "Yes" and "No"? The problem with "Yes" an "No" is that questions can, and are worded such that it's unclear which of "Yes" or "No" is the less-dangerous operation.
|
# ? May 5, 2015 20:56 |
|
I never thought I'd hear an earnest argument against verb buttons but here we are.
|
# ? May 5, 2015 20:59 |
|
|
# ? Jun 8, 2024 06:48 |
|
carry on then posted:I never thought I'd hear an earnest argument against verb buttons but here we are. It belongs in this thread because it really is a coding horror to see three paragraphs of dialog alert text with [YES] [NO] at the bottom of it, and every developer should know that. 1000x this: ExcessBLarg! posted:"Cancel" is at least recognized as "don't proceed with any changes" and is (usually) a safe answer to any question about a potentially-dangerous operation.
|
# ? May 5, 2015 21:41 |