|
sunaurus posted:Yeah, it's not a shortcut to text search, but it does err on the side of showing false positives instead of hiding them, and there can be A LOT of false positives in a larger app. It's definitely my normal experience when I work with Python for anything other than scripting and prototyping (where it excels). The impression you gave in your first post on the subject was that it isn't easy to navigate a python project. sunaurus posted:At least it's actually easy to navigate in the code in C#/Java projects. My point wasn't that you can't write code that is hard to analyze (I specifically said as much), my point was that it's not terribly common to have pycharm to give you inaccurate results to the point where there's some sort of difficulty in navigating/exploring/wrapping-your-head-around a project. It's not uncommon for me to explore large python projects and I've never seen that dialog you shared a screenshot of. I'm not saying you made it up or whatever, I'm saying that the implication you made that you can't expect to be able to "find usages" is incorrect. Thermopyle fucked around with this message at 18:16 on Jul 11, 2019 |
# ? Jul 11, 2019 18:13 |
|
|
# ? Jun 8, 2024 06:30 |
|
sunaurus posted:To be clear, I'm not saying that Python is bad or even that you should write ambiguous method names or whatever - that wasn't my argument at all. I'm saying that it's much easier to navigate an ambiguously written codebase written in Java/C# than it is to navigate one written in Python (using the tooling I know about). Volte put it best above: Volte posted:It should be able to do a pretty good job if you put type info on your function parameters, return values, and class members. You can probably leave most local variables un-annotated, as long as they get assigned to something that can be analyzed. I find it a good excuse to put type info on stuff.
|
# ? Jul 11, 2019 18:18 |
|
Janitor Prime posted:Seriously this is one of the best features of Java, navigating a new project is so much easier in Java compared to other langs.
|
# ? Jul 11, 2019 18:44 |
|
ratbert90 posted:Not on our team. Must be nice, I guess. It doesn't agree with my experience of how Other Developers work. quote:Your entire argument is "Well, it won't always work, so why do it at all?" More that it usually doesn't work for this kind of thing (stuff that doesn't per se break the code when it's allowed to rot) and as I said in an earlier post I'm skeptical about how much it value it adds when it's an internal method. (Publicly exposed library methods are a different story.) Methods should document themselves via their names and parameters; I'm not saying that additional clarification is never needed but it should be the exception rather than the rule. If the classes and methods in a codebase aren't almost always self-explanatory, then that is the problem that should be fixed - not the presence or absence of documentation.
|
# ? Jul 11, 2019 18:46 |
|
if you want your ide's static analyses to work, try using a language that isn't an arbitrary dynamic ball of mud
|
# ? Jul 11, 2019 19:03 |
|
“Just don’t allow the comments to rot” is the programmer’s “just build the whole plane out of the black box material”
|
# ? Jul 12, 2019 06:43 |
|
JavaScript code:
|
# ? Jul 12, 2019 09:16 |
|
qntm posted:horror Hey, at least it has a function header
|
# ? Jul 12, 2019 11:08 |
|
the horror is it assuming base 10 by default right? haha! that's so not the javascript way
|
# ? Jul 12, 2019 12:56 |
|
The function shouldn't require a radix at all; integers are integers regardless. Providing any radix other than 10 will cause bugs I'm pretty sure, since they're calling parseInt and allowing the value to implicitly convert to a string, which will use base 10. So for example parseInt(10, 8) will parse "10" as octal, giving 8, which will not be equal to 10, and the function will falsely report the value as not being an integer. Also I'm pretty sure that the whole thing can be replaced with "Math.trunc(value) === value"
|
# ? Jul 12, 2019 15:19 |
|
HappyHippo posted:The function shouldn't require a radix at all; integers are integers regardless. Why, it's almost as though Javascript is poo poo, and shouldn't be used!
|
# ? Jul 12, 2019 16:07 |
|
Does trunc work differently than floor?
|
# ? Jul 12, 2019 16:09 |
|
Munkeymon posted:Does trunc work differently than floor? For positive integers, no. For negative integers, yes. trunc just removes decimals from a number. floor rounds down to the nearest integer.
|
# ? Jul 12, 2019 16:33 |
|
Hammerite posted:Why, it's almost as though Javascript is poo poo, and shouldn't be used! I mean, yeah JavaScript is poo poo, but that's no excuse to pile more poo poo on top of it
|
# ? Jul 12, 2019 16:39 |
|
Whats' wrong with Number.isInteger()?
|
# ? Jul 12, 2019 18:26 |
Thermopyle posted:Whats' wrong with Number.isInteger()? I didn't write it.
|
|
# ? Jul 12, 2019 18:39 |
|
Convert it to a string, then check for the existence of a decimal and trailing non zero numbers ezpz
|
# ? Jul 12, 2019 18:45 |
|
Volmarias posted:Convert it to a string, then check for the existence of a decimal and trailing non zero numbers ezpz I've legit seen "divide by 2, convert to string, check if the second last character is '.'" as a way to tell if a number is even
|
# ? Jul 12, 2019 19:09 |
|
Thermopyle posted:Whats' wrong with Number.isInteger()? Won't work on strings.
|
# ? Jul 12, 2019 19:10 |
|
necrotic posted:Won't work on strings. Coding horror: int(Number).isInteger()
|
# ? Jul 12, 2019 19:12 |
|
Qwertycoatl posted:I've legit seen "divide by 2, convert to string, check if the second last character is '.'" as a way to tell if a number is even There's a certain kind of programmer for whom strings are a hammer and every problem is a nail
|
# ? Jul 12, 2019 19:23 |
|
necrotic posted:Won't work on strings. I asked whats wrong with it!
|
# ? Jul 12, 2019 21:20 |
|
HappyHippo posted:There's a certain kind of programmer for whom strings are a hammer and every problem is a
|
# ? Jul 12, 2019 21:23 |
|
HappyHippo posted:There's a certain kind of programmer for whom strings are a hammer and every problem is a nail Ah, the people who use a stringly typed language.
|
# ? Jul 12, 2019 22:09 |
|
Well if you think about it, a string can represent any other type...
|
# ? Jul 12, 2019 22:49 |
|
in hell, strings are the only datatype programmers can use types are strings keywords are strings comments are strings arrays? no. metastrings. strings of strings. string.length also returns a string. it's all strings baby
|
# ? Jul 13, 2019 00:18 |
|
pointers? it's strings, son the fundamental memory unit of the computational machine. the string!
|
# ? Jul 13, 2019 00:18 |
|
if you’re not convinced just read up on string theory
|
# ? Jul 13, 2019 00:26 |
|
Soricidus posted:if you’re not convinced just read up on string theory I'm convinced and a bit confused. Which version of string theory should I pick: the 11 dimension one or the 26-dimensional one? Or just stick with the classical 10?
|
# ? Jul 13, 2019 00:30 |
Spatial posted:pointers? it's strings, son And not like reading four bytes from the string to get your 32 bit pointer value. It's ascii char values for the hex value of the address. Of course prepended with 0x to make it human readable.
|
|
# ? Jul 13, 2019 00:51 |
Spatial posted:in hell, strings are the only datatype programmers can use Apparently hell is TCL.
|
|
# ? Jul 13, 2019 01:32 |
|
VikingofRock posted:Apparently hell is TCL. It is
|
# ? Jul 13, 2019 01:40 |
|
Spatial posted:in hell, strings are the only datatype programmers can use I see you've written bash scripts before
|
# ? Jul 13, 2019 01:49 |
|
Can I declare esr to be a coding horror all by himself?Eric S. Raymond posted:Epstein recruited girls as young as 14. Yes, really icky and I think it is quite right he was prosecuted for statutory rape. But women that age who are not only nubile but psychologically adult do exist, even if they’re very very rare – in 60 years I think I’ve met exactly one. We really need a "but ephebophilia!" smily.
|
# ? Jul 13, 2019 02:50 |
|
Arsenic Lupin posted:We really need a "but ephebophilia!" smily. No. No, we don't.
|
# ? Jul 13, 2019 02:59 |
|
Arsenic Lupin posted:Can I declare esr to be a coding horror all by himself? Alternately,
|
# ? Jul 13, 2019 03:00 |
|
https://twitter.com/skirani/status/1149302828420067328?s=21
|
# ? Jul 13, 2019 05:28 |
|
I kept waiting for the punchline and it never hit
|
# ? Jul 13, 2019 05:55 |
|
Dr Monkeysee posted:I kept waiting for the punchline and it never hit It's right there, above the first tweet.
|
# ? Jul 13, 2019 06:09 |
|
|
# ? Jun 8, 2024 06:30 |
|
Spatial posted:pointers? it's strings, son WeeChat scripting documentation posted:3.1. Pointers
|
# ? Jul 13, 2019 11:39 |