u/Scaliwag - 10 Archived Voat Posts in v/programming
u/Scaliwag
  • home
  • search

u/Scaliwag

0 posts · 10 comments · 10 total

Active in: v/programming (10)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: GitHub's new far-left code of conduct explicitly says "we will not act on reverse racism' or 'reverse sexism'"

So now people don't get sarcasm even with the /s tag?

3 03 Aug 2015 16:59 u/Scaliwag in v/programming
Comment on: GitHub's new far-left code of conduct explicitly says "we will not act on reverse racism' or 'reverse sexism'"

Good because reverse racism and reverse sexism are like what? Being non-racist and non-sexist. Who would want to punish people for not being racist? I mean, they could, but doesn't make it less dumb, anyway.

That probably means they will act on plain straightforward racism that some blacks, whites, yellows, whatevers have against others and so on. Which is fine, it's their site./s

4 03 Aug 2015 16:36 u/Scaliwag in v/programming
Comment on: Where should I migrate my projects to (from Github)?

The word "equality" morphed from "equal before the law, same standard, same rights and obligations" to "omgz everyone is the same" a long time ago. It seems to be what happens when people don't grow up and take overly simplified explanations you give to children at face value.

If you are the same as a murderer or rapist, bad news, you should be arrested and I guess some people would even want your head for being like that.

3 23 Jul 2015 17:05 u/Scaliwag in v/programming
Comment on: Fast as C: How to write really terrible Java

x-posting:

Mostly I wanted to illustrate that there's hidden costs to every language feature. You don't have to write bizarre code to get Java to perform extremely well, but when you want the last few percent out of it, the code starts to look like gnarly hand-crafted C code (and starts to optimize as well).

Take a look for example at this n-body benchmark where you have straight-forward C++ and Java implementation code. C++ is just about 3 times faster and at the same time it is about the same performance as a straight forward C implementation. The 3 implementations have about the same level of abstraction.

And fairly sure that while you could have turned the Java code inside out, loosing readability, you could also apply some expression templates to the C++ in order to make it even faster without loosing much readability just creating some helper types. Which you couldn't even do in C, not without loosing a lot of readability like you'll need to do in Java, even though optimized Java would probably still be slower.

C++ abstraction does imply a hidden cost a lot of the time, but as shown above code with the same abstraction level as Java code is still faster a lot of the time, and sometimes abstraction can lead to faster more compiler friendly code as using expression templates can do -- either by rolling your own or using something like blitz++ or blaze

4 06 Jul 2015 13:10 u/Scaliwag in v/programming
Comment on: anybody ever hear of Nemerle?

I've only heard about it, but never used it. What I find interesting about its powerful macro system.

Although F# 4.0 will also include seamless quotations to allow passing ASTs in a more straight-forward way which would allow for further expand its generic programming capabilities.

1 03 Jul 2015 04:20 u/Scaliwag in v/programming
Comment on: What a C programmer should know about memory

Garbage collection does not necessarily mean tracing garbage collection.

Reference counting works fine most of the time, unless you're doing some real-time software.

0 01 Jul 2015 03:22 u/Scaliwag in v/programming
Comment on: TIS-100: An emulator for a CPU that doesn't exist

Cool. There are a couple of those already:

  • https://github.com/melograph85/tis100
  • https://github.com/barsae/TIS100
  • https://github.com/rcolinray/tis-100-rs
  • https://github.com/hthh/tis100sim

Rust, JS, C#, C. Not downplaying your accomplishment at all, OP. It's a nice project and personally I find it interesting to see how different people approach things. For example, there's a C implementation where the guy takes advantage that instructions mnemonics are at most 3 characters long and treats the string as an integer lol it's a cool hack, reminded me of FourCC.

Also, some other guy tried to create an instruction encoding for it:

https://docs.google.com/document/d/1WQdrEY7b0D0xvLK2UJvIhYuvplM5HVes75P_tYxjjbU/edit

2 01 Jul 2015 03:00 u/Scaliwag in v/programming
Comment on: Newbie question regarding OOP

I'm assuming that if you are using the "point" object for a car, that "point" data is going to change as the car moves around the track. This would make it unsuitable for immutable data because immutable data isn't supposed to change.

But, I'll admit my ignorance, maybe C# and F# have this covered. I'm fairly sure that such a thing would not fly in C++ though.

If you want to go the immutable route you would not mutate the point, just return a new one. This is not exclusive to F# by any means. It's pretty common in other languages, even in C++ you can work that way if you're const correct.

0 30 Jun 2015 21:39 u/Scaliwag in v/programming
Comment on: Newbie question regarding OOP

I think polymorphism would only make it less straightforward, though. Which increases boilerplate, reduces readability and so on.

But we agree, a better solution would probably involve generic programming which can be bone using templates, for example. But that's would not be strict OOP, and purists would certainly frown upon it. Using templates would be a more functional approach, where you separate algorithms from the data they work upon, which is counter to OOP dogma. That's my point.

0 30 Jun 2015 21:16 u/Scaliwag in v/programming
Comment on: Newbie question regarding OOP

It also keeps code DRY

That is the OOP way. But by no means it guarantees DRY.

What if you want to measure distances between points in a different coordinate system. Now points have to know about a bunch of coordinate systems. Oh and we want lines to do that too. Now you have to do the same code on the lines class, and then polygon, and so on.

That's why a more functional approach where a generic CordinateSystem class could manipulate all kind of objects you give it, without those objects knowing how you want to use them. A point is a point, it doesn't matter if it represents cartesian coordinates, geographic coordinates, etc.

0 30 Jun 2015 14:31 u/Scaliwag in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.