|
Dren posted:Poor Pollyanna just wants to unleash poorly founded vitriol about Java is that so wrong? It was fine when I was a young whippersnapper, but now it's not and nobody else can have that fun.
|
# ? Dec 16, 2013 23:08 |
|
|
# ? Jun 7, 2024 05:29 |
|
shrughes posted:Things would just be so much better if we got rid of Java and made an intuitive visual programming language. I mean really we should just have a common business oriented language, then we don't need programmers at all anymore. We could call it COMBUORLA or something.
|
# ? Dec 16, 2013 23:16 |
|
ratbert90 posted:Ran across this in the kernel today (Freescale): Yup, that's my #1 complaint about private vendor kernel trees: absolute dogshit like that is in them that would rightly get blasted when they try to submit it mainline. That and never bothering to update. Have you tried to backport embedded infrastructure from 3.10 to 3.0.35? Ugh.
|
# ? Dec 16, 2013 23:27 |
|
We should just write everything in Agda, then there would be no bugs. Because it is impossible to write anything in Agda.
|
# ? Dec 16, 2013 23:50 |
|
I, too, did not base my "gently caress Java" statement on a hello world example. Java has plenty of important things to be concerned about without using "ease of writing hello world apps" as a metric
|
# ? Dec 17, 2013 00:12 |
|
Dren posted:Poor Pollyanna just wants to unleash poorly founded vitriol about Java is that so wrong? It's fine to hate on things, but we encourage nuanced hatred, over the "we just started using it and there is a lot of text" hated. For example, whining about python is fine, once you get past the "eww whitespace" stage. Especially when the hating is coming from someone looking for any excuse to avoid writing code, meanwhile pleading for help. Code: It's going to suck.
|
# ? Dec 17, 2013 00:18 |
|
tef posted:whining about python is fine, once you get past the "eww whitespace" stage. quote:Code: It's going to suck. This really needs to be at the beginning of every intro to programming ever. Every design you ever come up with is going to be perfect and elegant and beautiful. And then you're going to have to actually write it and it's going to be impossibly ugly.
|
# ? Dec 17, 2013 01:21 |
|
tef posted:It's fine to hate on things, but we encourage nuanced hatred, over the "we just started using it and there is a lot of text" hated. For example, whining about python is fine, once you get past the "eww whitespace" stage. I hate the way that haml nesting is done through whitespace. It doesn't bug me in any other language, but for some reason it drives me insane in haml. There, I said it.
|
# ? Dec 17, 2013 01:29 |
|
I once had to maintain a C# program that dynamically generated VBA macros and then called Excel to execute them. I no longer have the capacity to hate any Programming Languages after that, because I can no longer feel.
|
# ? Dec 17, 2013 01:36 |
|
Dessert Rose posted:However, once you are past this stage, if you're looking to troll python developers, "eww whitespace" is a fantastic way to do it. Can we hate on untyped languages? Because coding in python/php/js/<insert interpreted language here> just feels like coding in C89 and having every variable be a void *. The whitespace bugs me for a bit when I switch to python work, but it's not something that you actually feel after a while. The nagging "Am I sure this is actually what I think it is?" when anything can be anything gets me every time. How do you deal with it, especially when working on inherited code? When trolling about python, I usually point at the Global Interpreter Lock because that's a coding horror all on it's own. If it were just the GIL, it'd be something fixable. The problem is like the BKL on linux, a bunch of cruft was written without re-entrancy in mind that's protected behind the global lock and god only knows what will break if you get rid of it. Harik fucked around with this message at 02:29 on Dec 17, 2013 |
# ? Dec 17, 2013 02:26 |
|
python is strongly typed though.
|
# ? Dec 17, 2013 02:34 |
|
Posting Principle posted:python is strongly typed though. Maybe I'm using the wrong term, but Python code:
|
# ? Dec 17, 2013 03:23 |
|
I'm a huge fan of Nick Coghlan's Python 3 Q & A, especially the But, but, surely fixing the GIL is more important than fixing Unicode... section. EDIT: Harik posted:Maybe I'm using the wrong term Correct. You are talking about static vs. dynamic typing. Python is strongly and dynamically typed. I've always liked this diagram and hopefully have reproduced it well enough: code:
Lysidas fucked around with this message at 03:28 on Dec 17, 2013 |
# ? Dec 17, 2013 03:24 |
|
Lysidas posted:Correct. You are talking about static vs. dynamic typing. Python is strongly and dynamically typed. Whoops, you're right, that's what I meant. Since so many interpreted languages play fast-and-loose with types I mixed up dynamic typing with weak typing.
|
# ? Dec 17, 2013 04:06 |
|
It's basically a given that any conversation about strong/weak typing will involve people using completely different definitions for the terms.
|
# ? Dec 17, 2013 05:22 |
|
Yep, python has really strong typingcode:
code:
|
# ? Dec 17, 2013 06:45 |
|
Back on track, this is a masterpiecequote:> The core functions which follow neither rule include C-style
|
# ? Dec 17, 2013 06:45 |
|
PHP is a piece of performance art. That's the only explanation.
|
# ? Dec 17, 2013 07:00 |
|
tef posted:Yep, python has really strong typing I'm definitely con on string types counting as an iterable for most things, but given that, it still makes consistent code:
code:
Lurchington fucked around with this message at 07:28 on Dec 17, 2013 |
# ? Dec 17, 2013 07:24 |
|
tef posted:Yep, python has really strong typing code:
|
# ? Dec 17, 2013 08:18 |
|
tef posted:Yep, python has really strong typing Yeah, there's simply no way that True could be inheriting from int, seeing as how no language has ever allowed True and False to represent 1 and 0 QuarkJets fucked around with this message at 08:46 on Dec 17, 2013 |
# ? Dec 17, 2013 08:42 |
|
QuarkJets posted:Yeah, no other language allows True and False to be represented as the integers 1 and 0 edit: oh, you edited. whatever, I still think that's sort of silly even if it's one of those things that doesn't often impact real world coding
|
# ? Dec 17, 2013 08:51 |
|
het posted:Well he wasn't necessarily saying it was absurd on the whole, just that it didn't represent what you would call strong typing. Also, coercing 1/0 to true/false seems more reasonable than the converse to me. I think that having False and True be represented by integers has become so ingrained in so many languages that if it suddenly wasn't the case then people would just be making GBS threads on Python for that instead, even though it's largely irrelevant trivia at this point e: Although I guess in Java false and true aren't representable by integers, so there's that QuarkJets fucked around with this message at 09:25 on Dec 17, 2013 |
# ? Dec 17, 2013 09:22 |
|
QuarkJets posted:I think that the 0=False, 1=True thing has become so ingrained that if it suddenly wasn't the case then people would just be making GBS threads on Python for that instead, even though it's largely irrelevant trivia at this point I wouldn't call the physical state of a switch to be "on" and "off" signified by 1 and 0, much like the power that flows through them, and the relevance that has to stuff like logic/boolean gates, to be "largely irrelevant trivia", though Edit: Also coersion to 1 and 0 is super nice because I get really annoyed in languages like C# where I can't just write code:
code:
code:
Jewel fucked around with this message at 09:31 on Dec 17, 2013 |
# ? Dec 17, 2013 09:25 |
|
Jewel posted:I wouldn't call the physical state of a switch to be "on" and "off" signified by 1 and 0, much like the power that flows through them, and the relevance that has to stuff like logic/boolean gates, to be "largely irrelevant trivia", though What do the numbers 1 and 0 have to do with "on" and "off"?
|
# ? Dec 17, 2013 09:28 |
|
Nippashish posted:What do the numbers 1 and 0 have to do with "on" and "off"? 0 signifies nothing (no power in this case) and 1 signifies something being completely on (power in this case). As if 0 is 0% and 1 is 100%. Which is 0-1 ratios that we use a lot in programming regardless (lerp(a, b, percentFrom0To1)) When you think about circuitry as a bunch of logic gates 1 and 0 make a lot more sense. This thing only activates when it gets Something (Power) from here and Nothing from here. That mindset transfers pretty easily and natively to programming imo. Edit: vvv That's what I have to resort to, but it can feel cluttered and gross.
|
# ? Dec 17, 2013 09:33 |
|
Jewel posted:or in a more practical case, something like this: Just write code:
|
# ? Dec 17, 2013 09:34 |
|
Jewel posted:0 signifies nothing (no power in this case) and 1 signifies something (power in this case). You're saying the correlation is there because you're used to it. You could be talking about voltages, but then you need to learn about the static discipline, and VOL and VIH. The gist of it is that the world is full of noise and margin-of-error things that will gently caress up your signals if you're not careful, so you need to pick an arbitrary limit for what's logically zero and what's logically one that are well-suited for your environment and use case. It's quite rare that you ever see zero voltage across a wire, even if it's treated as a logical zero. Real-world physics is dope, yo.
|
# ? Dec 17, 2013 09:37 |
|
Suspicious Dish posted:You're saying the correlation is there because you're used to it. Well yeah but I didn't expect other people to know (or care) about nuances like that. We still say that "okay that's basically nothing so let's treat it as nothing" and 0 is "nothing" almost universally.
|
# ? Dec 17, 2013 09:43 |
|
Any language where you can't do:C++ code:
|
# ? Dec 17, 2013 14:19 |
|
code:
|
# ? Dec 17, 2013 16:54 |
|
At the same time, Haskell's not perfectly strongly-typed, either (bottom is a single value that inhabits all types, which technically allows coercion between any two types); you have to go with Agda if you want that.
|
# ? Dec 17, 2013 17:18 |
|
Hey thread, I got a lovely bachelor's in computer science and at work I develop internal tools where nobody else will ever look at my code until I leave the company so I never really get feedback other than "it does/n't work" How do I learn to be a better programmer and avoid doing dumb poo poo that crops up in this thread?
|
# ? Dec 17, 2013 19:21 |
|
Sockser posted:Hey thread, I got a lovely bachelor's in computer science and at work I develop internal tools where nobody else will ever look at my code until I leave the company so I never really get feedback other than "it does/n't work" Make something cool and put it on github? Then use that to get a neat job?
|
# ? Dec 17, 2013 19:26 |
|
Sockser posted:How do I learn to be a better programmer and avoid doing dumb poo poo that crops up in this thread? Program more and then when someone tells you something you did is dumb don't do it any more.
|
# ? Dec 17, 2013 19:27 |
|
Never make any mistakes. Easy.
|
# ? Dec 17, 2013 19:29 |
|
[edit] wrong thread New Yorp New Yorp fucked around with this message at 20:00 on Dec 17, 2013 |
# ? Dec 17, 2013 19:42 |
|
Jewel posted:I wouldn't call the physical state of a switch to be "on" and "off" signified by 1 and 0, much like the power that flows through them, and the relevance that has to stuff like logic/boolean gates, to be "largely irrelevant trivia", though This is all really terrible code, though, and more languages should discourage you from writing it! Most people don't expect bools to be multiplying anything, and it'll cause double-takes and misunderstandings of code. As Suspicious Dish said, just use the ternary. Don't try to write 'clever code'.
|
# ? Dec 17, 2013 19:51 |
|
EAT THE EGGS RICOLA posted:Make something cool and put it on github? Then use that to get a neat job? astr0man posted:Program more and then when someone tells you something you did is dumb don't do it any more. These, only do it in languages that aren't the ones you use at work.
|
# ? Dec 17, 2013 19:56 |
|
|
# ? Jun 7, 2024 05:29 |
|
PleasingFungus posted:This is all really terrible code, though, and more languages should discourage you from writing it! In the same vein, I've seen a bug that manifested with (a && b) * 100. Don't write clever code.
|
# ? Dec 17, 2013 20:02 |