|
Putting 'final' on a method parameter is equivalent to putting it on a local variable inside the method - it doesn't actually mean anything at all to code that calls the method. Everything in Java is passed by value. If you reassign a parameter to be something else (which is the only thing that declaring it final prevents you from doing), that has zero effect on anything outside the method.
|
# ? Jul 24, 2015 00:20 |
|
|
# ? May 25, 2024 21:58 |
|
atom.io, because why shouldn't you load an entire webkit environment to edit text? there needs to be people who's job it is to hunt down web developers who manage to escape from the browser
|
# ? Jul 24, 2015 00:21 |
|
Sauer posted:atom.io, because why shouldn't you load an entire webkit environment to edit text? there needs to be people who's job it is to hunt down web developers who manage to escape from the browser w3school of assassins
|
# ? Jul 24, 2015 00:40 |
|
CPColin posted:In Java 8, you don't need the "final" modifier, if nothing in your method tries to change the value. "Effectively final" values can be used in inner classes and closures. oh neat i look forward to eventually being able to use java 8. i've nearly managed to persuade all my users to upgrade from java 6 so it might happen within the next decade.
|
# ? Jul 24, 2015 00:50 |
|
bobbilljim posted:w3school of assassins The Dart Brotherhood
|
# ? Jul 24, 2015 01:22 |
|
Soricidus posted:so instead of having an insecure unpatched libxml2 that you don't know about that some module built from source, you have an insecure unpatched libxml2 that you don't know about that some module bundled as a binary? you have a hard dep on a specific version of a system library, and you distribute a pre-compiled FFI binding. Soricidus posted:also we have to live in the real world, where a lot of python runs on linux and distributing binaries for linux is painful to say the least java manages it
|
# ? Jul 24, 2015 02:03 |
|
eschaton posted:ref counting is a form of garbage collection i disagree
|
# ? Jul 24, 2015 02:04 |
|
Symbolic Butt posted:it's true, this is all bad but I don't get your beef with reference counting. are you like a mark and sweep kind of dude? mark and sweep is babby's first garbage collector. it is the naive approach, the simplest thing that could possibly work. ref counting isn't even that. it's less than the trivial attempt. it's a five year old shoving poo poo under the bed and saying he cleaned his room
|
# ? Jul 24, 2015 02:05 |
|
http://www.catb.org/jargon/html/koans.html posted:One day a student came to Moon and said: “I understand how to make a better garbage collector. We must keep a reference count of the pointers to each cons.”
|
# ? Jul 24, 2015 02:09 |
|
lol
|
# ? Jul 24, 2015 02:10 |
|
Ludwig van Halen posted:whats even the point of using final or const It's important when you don't want other code to mutate you state, but not providing mutators in the first place effectively gives you that.
|
# ? Jul 24, 2015 02:10 |
|
python has precompiled dependencies in the form of wheels, and the garbage collector does cycle detection
|
# ? Jul 24, 2015 02:19 |
|
Ludwig van Halen posted:whats even the point of using final or const as just discussed, there's no good reason to use final on local vars as of java 8 but: when you use final on fields, you can make them visible to child classes via the protected keyword without letting them be reseated when you don't initialize final fields you get a compiler error final on methods means nobody can override the method final on classes means nobody can inherit from that class and so nobody can reassign static constants its all about specifying what other people can do to your code const is for the same reason, and has similar uses with fields & inheritance and globals* but primarily, you pass out const things to avoid needing to defensively copy every time somebody wants to look at some data. if the compiler didn't enforce it, you'd get code:
|
# ? Jul 24, 2015 03:00 |
|
for me a good reason to use final is so i dont have to think as hard
|
# ? Jul 24, 2015 03:40 |
|
Speaking of not thinking hard, QA caught this in my code today:code:
|
# ? Jul 24, 2015 04:54 |
|
lmao nice job
|
# ? Jul 24, 2015 05:03 |
|
CPColin posted:Speaking of not thinking hard, QA caught this in my code today: How did the compiler not scream at you? I mean that's just a stack overflow waiting to happen but wouldn't the compiler just glare at you and ask where the implementation was?
|
# ? Jul 24, 2015 06:58 |
|
sometimes blowing the stack is the desired behavior
|
# ? Jul 24, 2015 07:02 |
|
maybe we should ask about it on stackoverflow.com
|
# ? Jul 24, 2015 07:32 |
|
Space Whale posted:How did the compiler not scream at you? the implementation's right there, silly bobbilljim posted:maybe we should ask about it on stackoverflow.com lol
|
# ? Jul 24, 2015 08:39 |
|
this is why you need tail call elimination, gets rid of those nasty stack overflows and lets your code work as written
|
# ? Jul 24, 2015 08:45 |
|
R# gives you a nice little ⟳ icon next to such functions
|
# ? Jul 24, 2015 12:41 |
|
Space Whale posted:How did the compiler not scream at you? recursion is a valid technique
|
# ? Jul 24, 2015 15:28 |
|
yeah and maybe the compiler should be able to notice when there's no base case and warn you
|
# ? Jul 24, 2015 16:03 |
|
Ludwig van Halen posted:recursion is a valid technique lol no it isnt
|
# ? Jul 24, 2015 16:17 |
|
Bloody posted:lol no it isnt i don't know about this one bloody, i think you might be incorrect.
|
# ? Jul 24, 2015 16:24 |
|
nope. recursion is dumb, bad, and useless. it's a way for people to feel clever while writing loops, and cleverness is always bad.
|
# ? Jul 24, 2015 16:25 |
|
tail recursion is cool and good
|
# ? Jul 24, 2015 16:33 |
|
recursion is a good way to describe some algorithms abstractly which should then be implemented as loops
|
# ? Jul 24, 2015 16:33 |
|
an infinite loop could never happen
|
# ? Jul 24, 2015 16:39 |
|
A fsm is a good example of a thing that can use recursion and tail call elimination
|
# ? Jul 24, 2015 16:41 |
|
recursion is good and fun if you really like massive stacks i had to write a recursive write/sorted print for a binary tree in an interview once, that was fun
|
# ? Jul 24, 2015 16:51 |
|
recursion is a good technique for describing some algorithms. using it in production code without TCO or something seems pretty dumb though
|
# ? Jul 24, 2015 16:59 |
|
Awia posted:recursion is good and fun if you really like massive stacks i like big stacks, and i can not lie.
|
# ? Jul 24, 2015 17:01 |
|
heh, yeah, lemme just traverse this graph iteratively
|
# ? Jul 24, 2015 17:19 |
|
fleshweasel posted:recursion is a good technique for describing some algorithms. using it in production code without TCO or something seems pretty dumb though i agree with this poster what languages besides scheme require TCO? i would like to know about them and jerk off to recursive algorithms in new and exciting languages
|
# ? Jul 24, 2015 17:33 |
|
using recursion looks cool and good, right up to the point a colleague punches you
|
# ? Jul 24, 2015 17:41 |
|
Barnyard Protein posted:i agree with this poster if you want to jerk off to recursion, use haskell, the ultimate jerking-off language
|
# ? Jul 24, 2015 17:43 |
|
my entirely bespoke custom crystal web framework/docker frontend is coming along nicely. it can attach or even unattach from multiple containers stderr/out/logs!!!!!
|
# ? Jul 24, 2015 18:10 |
|
|
# ? May 25, 2024 21:58 |
|
Arcsech posted:if you want to jerk off to recursion, use haskell, the ultimate jerking-off language
|
# ? Jul 24, 2015 18:31 |