|
Only delay needs to be volatile to implement a timeout, right?
|
# ? Oct 4, 2018 19:50 |
|
|
# ? Jun 8, 2024 02:32 |
|
pokeyman posted:Parse error at the en dash? Lexer error surely
|
# ? Oct 4, 2018 20:34 |
|
This is what happens when you don't do mandatory code review and let people work on their own. I found an identical chunk of code repeated 34 times in this (relatively small) project I just inherited. It's not the only chunk of code like that. As far as I can tell, the project's LoC count primarily consists of copy/paste. There are no methods anywhere. It also has a lot of patterns like: code:
code:
code:
|
# ? Oct 5, 2018 14:23 |
|
Munkeymon posted:The best shared state is none at all The developer, upon hearing this, was enlightened.
|
# ? Oct 5, 2018 16:00 |
|
New Yorp New Yorp posted:This is what happens when you don't do mandatory code review and let people work on their own. I've seen a NMEA sentence parser that did that for every field, separator, etc. The one line else clauses were hundreds of lines away. Thank god we don't have multiple return statements though!
|
# ? Oct 5, 2018 17:01 |
|
Carbon dioxide posted:.... That said, anyone programming multithreading programs by hand in TYOOL 2018 is asking for disasters, and instead they should just use a good concurrency library of their choice. ...Until you can’t because the rules are too complex to be serviced by the c# Task.Parallel or other libraries. Then you try to find someone who has multithreaded programming on their resume AND knows what a semaphore and mutex is and fail because the concurrency library is all they know and they’ve never had to deal with dependencies between the data being processed (shared state).
|
# ? Oct 5, 2018 17:48 |
|
namlosh posted:...Until you can’t because the rules are too complex to be serviced by the c# Task.Parallel or other libraries. I haven't needed anything more complicated than Task.Parallel since it came out
|
# ? Oct 5, 2018 18:34 |
|
namlosh posted:...Until you can’t because the rules are too complex to be serviced by the c# Task.Parallel or other libraries.
|
# ? Oct 5, 2018 20:48 |
|
Munkeymon posted:I haven't needed anything more complicated than Task.Parallel since it came out Tbh, I hadn’t either before my last job. Much like war, Financial Tech puts a man through many changes... ^^^^^^ I’ll have to check out TBB... thanks!
|
# ? Oct 5, 2018 21:15 |
|
hey everyone, tired of dealing with multiple parameters in methods? tired of trying to figure out what to do with return values? dependency injection a pain in the rear end? behold: before code:
code:
|
# ? Oct 6, 2018 00:21 |
|
It is me, I am the horror. In my data access layer classes, there are the expected insert/update/delete methods, then a group of Getxxx and Readxxx methods. The Get methods return a List of of objects, the Read methods return a single object. At the core of these methods are private methods that accept a string sql statement and a params array of SqlParameters. This allows me to do things like C# code:
C# code:
Today, after working with this stuff for three years, I just now realized that can use C# code:
|
# ? Oct 6, 2018 00:34 |
|
Bruegels Fuckbooks posted:hey everyone, tired of dealing with multiple parameters in methods? tired of trying to figure out what to do with return values? dependency injection a pain in the rear end?
|
# ? Oct 6, 2018 01:39 |
|
Magissima posted:let me guess, all of the "argument" fields are mutable too ding ding
|
# ? Oct 6, 2018 02:28 |
|
code:
|
# ? Oct 6, 2018 13:04 |
|
JawnV6 posted:You still haven't really explained why you think the timeout author doesn't understand 'volatile'? The declaration for hardware_thing isn't shown, it's presumably done properly and is reaching out to the MMIO every time. But if you don't have 'volatile' on delay/tmo, despite the fact that they reside in "normal" RAM, anything above -O0 is going to wipe out the entire loop.
|
# ? Oct 6, 2018 13:35 |
|
Soricidus posted:
this, then JavaScript code:
|
# ? Oct 6, 2018 19:40 |
|
Soricidus posted:
Well obv you can't just use a key value pair for this - some people might have multiple dong values or multiple butt values.
|
# ? Oct 7, 2018 14:47 |
But what if I have a tumor on my dong, eh buddy? I'd like to see a key-value pair represent that
|
|
# ? Oct 8, 2018 20:38 |
|
Polio Vax Scene posted:But what if I have a tumor on my dong, eh buddy? I'd like to see a key-value pair represent that code:
|
# ? Oct 8, 2018 20:49 |
|
https://twitter.com/rygorous/status/1049384200929914880
|
# ? Oct 8, 2018 21:18 |
|
The Linux kernel loves to use inline-asm hacks for things that could've been very reasonable language features if they had any patience.
|
# ? Oct 8, 2018 22:29 |
|
Xik posted:
|
# ? Oct 8, 2018 22:54 |
|
https://twitter.com/isislovecruft/status/1049503354391552000
|
# ? Oct 9, 2018 04:37 |
|
The one thing that makes me shudder is that there are language evangelists, I know someone who is a kotlin geek, She tries to tell everyone that Java is Dead, Rails is Dead, Groovy is Dead you should all go to Kotlin you can do so much with one line..... Yeah and you give up fine control when you shorten commands in that manner. even in java it sucks - with Java 10 var temp = new ArrayList<Widget>(); var temp2 = new LinkedList<Widget>(); temp.AddAll(temp2); <--- compile error Where as originally it would work because of this List<Widget> temp = new ArrayList<>(); List<Widget> temp2 = new LinkedList<>(); temp.AddAll(temp2); But each language has its arena for use, you wouldnt write a device driver in Kotlin you would use C/C++ or even assembler. Each language has its place or it wouldnt have been created. (except that religious language and operating system - that is idiotic) and those who scream to stop using the language you know and use something new because its new is wrong and they should be locked in a dark room watching php scroll by on a large monitor on the wall.
|
# ? Oct 9, 2018 06:47 |
|
That sure is an opinion.
|
# ? Oct 9, 2018 06:55 |
|
TheresaJayne posted:The one thing that makes me shudder is that there are language evangelists, You would have a point if you mentioned cost and risk. But technically Kotlin is both easier to write and maintain. Also your example doesn’t work since you can specify variable types in Kotlin (e.g var x: MyType = MyTypeSubclass().
|
# ? Oct 9, 2018 08:06 |
|
TheresaJayne posted:even in java it sucks - with Java 10 the compile error is because the method is called addAll, not AddAll the code will work fine otherwise, because addAll on any Collection subtype will accept any other Collection subtype
|
# ? Oct 9, 2018 08:27 |
|
Soricidus posted:the compile error is because the method is called addAll, not AddAll under java 10 var will be auto cast to the right hand object meaning that the var contents would be ArrayList and LinkedList in turn- ok i typed from memory and got a case wrong - i have been doing a lot of .NET recently
|
# ? Oct 9, 2018 09:56 |
|
TheresaJayne posted:under java 10 var will be auto cast to the right hand object meaning that the var contents would be ArrayList and LinkedList in turn- ok i typed from memory and got a case wrong - i have been doing a lot of .NET recently Both ArrayList<E> and LinkedList<E> pass typechecking against Collection<? extends E>, which is what addAll() takes. Even if you explicitly specify the types as ArrayList and LinkedList it works: code:
|
# ? Oct 9, 2018 14:23 |
|
TheresaJayne posted:except that religious language and operating system - that is idiotic Tell me more
|
# ? Oct 9, 2018 14:36 |
|
Slimy Hog posted:Tell me more Probably talking about TempleOS / HolyC. Imo, that's not a horror because even the schizophrenic author doesn't expect anyone else to use / maintain it.
|
# ? Oct 9, 2018 14:44 |
|
Well, that's the least of his worries now.
|
# ? Oct 9, 2018 14:49 |
|
Of course he was a goon: https://forums.somethingawful.com/member.php?s=&action=getinfo&userid=177830
|
# ? Oct 9, 2018 15:32 |
|
TheresaJayne posted:The one thing that makes me shudder is that there are language evangelists, Kotlin is amazing and Java is dead.
|
# ? Oct 9, 2018 16:00 |
|
No language is dead as long as enterprise exists.
|
# ? Oct 9, 2018 16:51 |
|
Taffer posted:Kotlin is amazing and Java is dead. https://www.youtube.com/watch?v=yfelqZpapZA
|
# ? Oct 9, 2018 17:26 |
|
Taffer posted:Kotlin is amazing and Java is dead.
|
# ? Oct 9, 2018 17:39 |
|
SupSuper posted:No language is dead as long as enterprise exists. No language is dead as long as we remember it in our hearts which is not how memory or hearts or dying works.
|
# ? Oct 9, 2018 17:40 |
|
Magissima posted:What about for those of us not stuck in the Android ghetto? Kotlin was cool and good before Android adopted it!
|
# ? Oct 9, 2018 17:54 |
|
|
# ? Jun 8, 2024 02:32 |
|
Kotlin is for those who want to get out of Java (a smart choice), keep using the jvm and useful java libraries (also a smart choice), but are too stuck in their ways to switch to superior Functional Programming entirely.
|
# ? Oct 9, 2018 18:46 |