u/Cuddlefluff - 30 Archived Voat Posts in v/programming
u/Cuddlefluff
  • home
  • search

u/Cuddlefluff

0 posts · 30 comments · 30 total

Active in: v/programming (30)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Java or Python

Compiling a program doesn't change the rules of the language - even when compiled Python still relies on dynamic typing (handled by an extra run-time) which guarantees type safety and correct (implicit) conversions regardless of circumstance.

0 18 Aug 2015 18:00 u/Cuddlefluff in v/programming
Comment on: Java or Python

Dynamic typing has a high associated cost in performance, so even when compiled (via C transpiling or JIT compilation) Python will typically run a lot slower than Java. And yes, I've used Python before.

0 18 Aug 2015 17:25 u/Cuddlefluff in v/programming
Comment on: Java or Python

It's an interpreted language, whereas Java gets compiled to native code by a JIT-compiler. Python's type system also means that types needs to be verified at run-time, which adds a very significant overhead.

0 18 Aug 2015 14:13 u/Cuddlefluff in v/programming
Comment on: Java or Python

I was trying to refer more to the way that Java loads each object's parent classes and so on into memory at runtime.

Java keeps all structures in memory in order to give a feature called reflection; meaning that a program knows everything about itself. This can be used for dynamic invocation of methods and enumeration of classes (for instance for plugin-functionality), also it can be used by the run-time itself to provide better code optimization.

Of course Java will always be slower than C/C++ because of the JVM overhead

Java needs to do a trade-off; Java can't always make the most optimal code because that would lead to a much longer load time (and impede performance during JIT-compilation). It's not due to JVM overhead - it's a consciously weighed decision.

Java can however sometimes perform better than C++ in certain situations. C++'s method of linking imposes a few restrictions of what code can and cannot be optimized properly because the context is unclear. For instance; Java can inline methods across dynamically linked libraries, something C++ cannot. Java can use CPU or GPU extensions that C++ needs specific compilation for (like new SIMD extensions).

I still stand by my claim that Java is much faster than Python.

Arguing against this would show a complete lack of understanding of the differences of Java and Python. Java will always outperform Python significantly. Firstly; Python is an interpreted language; it doesn't get compiled to native code. Even if you use something like a Python -> C transpiler, you will still be stuck with Python's type system which has a severe performance penalty due to the very nature of weak and dynamic typing.

1 15 Aug 2015 13:44 u/Cuddlefluff in v/programming
Comment on: Java or Python

A beginners language should have proper static typing. Python's severe performance penalty should get more focus when people make a choice in languages. A decade and a half ago, VB6 was shunned in "serious business" because of performance considerations, even though VB6 was significantly faster than Python (as long as you avoided the VARIANT datatype). The use of Python in business is a very dubious technical decision.

0 15 Aug 2015 13:31 u/Cuddlefluff in v/programming
Comment on: Java or Python

Java's trade-off compared to C++ is not in performance, but memory consumption. Java is comparatively equal to C++ in performance (average about 1.5x - 2x slowdown). Perl, Python and PHP is significantly slower, sometimes up to 200x slowdown, and with about the same memory consumption as Java (or even higher), the expected minimum generally being about 10x slowdown.

Java switched to JIT compilation in 1996 and still this myth is being thrown about, even though it has been patently false for 19 years.

0 13 Aug 2015 08:50 u/Cuddlefluff in v/programming
Comment on: What are some programming jargon everyone should be aware of?

Well, according to biblical scripture, PI is exactly three, and in the days of the greeks, PI was 22/7 (fool's PI)

1 30 Jul 2015 09:11 u/Cuddlefluff in v/programming
Comment on: [Question] PostgreSQL vs MySQL?

Unless configured intently, specifically and correctly, MySQL is a complete clusterfuck. Stick with PostgreSQL unless there's some sort of legacy reason to use MySQL.

However, for business applications and high-performance environments I recommend going for the higher tier (the non-free databases) as they tend to outperform and out-feature both of them by a very significant amount.

1 30 Jul 2015 00:57 u/Cuddlefluff in v/programming
Comment on: All decisions have consequences, but how did MS break OpenType fonts in such a way that it allows creation of an elevated user?

I'm not directly disagreeing with you, I just think that your opinion is one-dimensional and some of your opinions are up for discussion.

It's "interesting" that some people try hard to read stuff into everything. See the IIS server. Is it so hard to let a user-space listen on port 80 TCP? No.

You're right, IIS doesn't need to be a device driver, it's done like that purely to get performance enhancements. And if you look at the numbers, IIS outperforms all other web servers that come anywhere near close IIS in terms of functionality and flexibility. Kernel drivers will perform better than user-space programs because kernel-drivers doesn't have this giant police checking every bit and byte in case you do something wrong. It's not because Windows is inherently inefficient, it's because that's the price we pay for stability and security. This is why DOS was so goddamn fast; it just didn't care. Linux kernel drivers also has a performance benefit over user-mode space, which is why stuff that doesn't strictly need to access hardware resources also are put there; like video encoding software (would you trust user-space to compress 1080p video on-the-fly for real-time communication?)

No. Does it need to haggle IRQs? No. What is it doing in the frigging Ring0?! There. Is. No. Excuse.

Technically, it's Ring-1 :P Linux has one kernel ring, Windows has two; one for the OS and one for device drivers. If you ignore performance (which is why they did it), there's no other justifiable reasons for http.sys existence. I still think it's one-sided to consider that kernel drivers only ever should handle hardware, even when there can be other justifications for doing so.

The act of rendering is the job of a driver. The act of managing is not. Weirdly enough for all over OS's this works great.

That's your assumption, it might not have been a result from "managing" at all, we don't know.

3 21 Jul 2015 14:42 u/Cuddlefluff in v/programming
Comment on: Visual Studio 2015 and .NET 4.6 Available for Download

Open source doesn't necessarily mean free, and free doesn't necessarily mean open source. Examples : Unix is open source but it's not free, Visual Studio Community Edition is free but it's not open source.

1 21 Jul 2015 14:16 u/Cuddlefluff in v/programming
Comment on: All decisions have consequences, but how did MS break OpenType fonts in such a way that it allows creation of an elevated user?

They're disabled in the Kernel, where we're running.

No it's not, at least not for Windows 8.

Create a user-space daemon, and carefully give it the needed permissions

User-space programs (regular programs) don't have access to hardware resources and a privileged instruction set; they can't call interrupts, they can't register new interrupts, they cannot send or receive via ports, and they cannot change the IRQ priority (among other things). Because that would be a disaster, and it would completely go against the whole principle of kernel rings. Text-rendering on Windows is hardware accelerated, which necessitates a device driver to do it.

Also, check out who actually develops OpenType (it's not Microsoft)

4 21 Jul 2015 13:16 u/Cuddlefluff in v/programming
Comment on: Microsoft Security Bulletin MS15-078 [critical font vulnerability for just about every system supported by MS]

Windows has separated out device drivers from the kernel; no device drivers (except the ones required at boot) are a part of the kernel. Windows can do atomic locks on files, preventing viruses from hiding information from anti-virus software. Windows has a buttload of security features that few people know about, and in terms of security it is miles ahead of any other operating system. Problem is that it's also the most targeted operating system by a huge margin.

There was a huge infection that happened among Mac OS computers a few years ago, of course few people noticed because people think that Mac OS is somehow impervious to infection (with really, really poor reasoning) so nobody had the means to know that they were in fact sitting on an infected machine.

1 21 Jul 2015 09:23 u/Cuddlefluff in v/programming
Comment on: What programming language changed your outlook on creating software?

for(Person friend : friends.stream().filter(x -> x.Age > 25).collect(Collectors.toList()))

LINQ is so much more elegant

0 17 Jul 2015 09:12 u/Cuddlefluff in v/programming
Comment on: Come up with the most inefficient, poorly written, and complex way to print out "Hello World!".

How about examining PI to find the machine instructions in sequence to print it

0 16 Jul 2015 22:25 u/Cuddlefluff in v/programming
Comment on: Microsoft has release a "Sublime Text" clone that works on linux, MacOS and that other OS. I guess this is the end of the world. It's been nice knowing you gents.

Notepad is iconic. It is immutable.

0 15 Jul 2015 17:39 u/Cuddlefluff in v/programming
Comment on: Microsoft has release a "Sublime Text" clone that works on linux, MacOS and that other OS. I guess this is the end of the world. It's been nice knowing you gents.

It's a pre-release, they are interested in collecting usage data in order to figure out what needs fixing, and how things can be better. The EULA will change on release. The same type of EULA and privacy statements has been for all of Microsoft's pre-releases, and they have always changed it into being opt-in on the actual release.

0 15 Jul 2015 17:39 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

I've worked with both C++ and Java (among others) professionally in the past. I am currently employed as a C# developer.

1 15 Jul 2015 16:10 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

It is the design of the language which makes it easier. Writing libraries in C++ is a major pain in the ass with our without an IDE. Writing a library in Java is trivial, with or without an IDE.

Java code is easier to develop and maintain than C++, that's one of Java's primary strengths and why it got so popular so fast. This is not an opinion, it is fact.

1 15 Jul 2015 13:35 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

Writing a library in C++ is way more difficult than in Java. Firstly, you'll need two declarations, one regular and one export (the .h file included for the .lib, .so or .dll). Secondly, C++ has complete type erasure. Writing libraries with C++ is extremely tedious, while in Java it doesn't take any extra time at all; all public classes and methods can be loaded, and that's it. In C++ there's also two types of libraries, one for static linking and one for dynamic linking, and these needs to be determined depending on what they are supposed to do and how they are supposed to be integrated in the application. Which brings up another case; there is no penalty in Java for dynamic linking, but there is in C++; dynamically linked libraries in C++ needs to conform to what the program expects due to memory offsets, while Java doesn't care, because it not designed that way.

Tomorrow, ask the monkey in the cubicle next to you to create a library without his favorite IDE. Just give him notepad and a CLI. He will be outed for the magnificent fool he truly is.

Most of the Java developers you out as "monkeys" which went to college and only know Java, did actually learn Java with something like notepad and a command line, because for some reason that's how Java is taught in college. Using a text editor and cli also doesn't make you a better programmer. In fact I'd argue that it makes you worse, because you're wasting your own time and productivity because you refuse the help an IDE will give you. People convince themselves that they "can't" use an IDE because they're so used to having to browse a million different source code files just to figure out what that function they need actually does. And someone can't fathom how IDE's somehow can magically do that for you by pressing alt+f1 and show the source of the function in an instant without grepping at all. Stop being elitist about writing code in a manner that was typical in 1970 because you won't impress anyone.

Every time I bring up how IDE's are a good productivity tool, people start acting like they are doing some sort of task that is impossible to automate on a computer. It's not impossible, it's not even hard, and most IDE's will do them for you so you don't have to. It has nothing to do with "being better", it has to be with being blind and impenetrable to reason.

1 15 Jul 2015 11:44 u/Cuddlefluff in v/programming
Comment on: What programming language changed your outlook on creating software?

You mean Delphi?

0 15 Jul 2015 11:23 u/Cuddlefluff in v/programming
Comment on: What programming language changed your outlook on creating software?

I wish they give us more freedom for dangling pointers and low level access with C#, and especially directX like stuff.

You're free to use pointers to read and write unmanaged memory in C#.. You just need to mark the method as unsafe. If you want more control between managed and unmanaged memory you need to use System.Runtime.InteropServices.Marshal which can turn unmanaged memory segments into .NET reflected types, and do other stuff like allocate unmanaged heap memory (default in C# for pointers is via the stackalloc operator, since that's what you'll be using them for generally anyway) and stuff like that. There are no restrictions to pointers in C#, but you just have to be aware that C# is not C++, and managed and unmanaged memory are two different things :P

0 15 Jul 2015 11:22 u/Cuddlefluff in v/programming
Comment on: What programming language changed your outlook on creating software?

It makes it even harder to debug. It's due to scoping in JavaScript; each function creates a new scope, so that's the only way to make local variables. In other C-like languages, a new scope is introduced in every { } which makes variable locality easier to understand.

1 15 Jul 2015 11:15 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

I don't think you have much to support your position. Java's design is vastly different from C++, and it gives a lot of benefits for the programmer. For instance take writing libraries; completely trivial in Java, extremely non-trivial in C++. Multiple inheritance. Stack/heap and how that affects the lifetime of objects and how you deal with objects you no longer need depdending on where they're located. Thread-safety. Networking. Binary compatibility.

No, there's not a conspiracy between colleges and pointy-haired bosses that synthetically keeps Java alive. Java is a solid choice with very reasonable trade-offs and that's why people use it.

1 15 Jul 2015 10:53 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

C / C++ / D is going to outclass Java on every last metric you picked. (In the hands of a competent programmer). D isn't even what I would consider a mainstream mature language and it still makes Java look like the kid licking the windows in the back of the short bus.

C/C++/D usually outperforms Java, but that's not always the case. C/C++/D all use a lot less memory than Java, which is Java's main trade-off. At virtually every other metric (for instance maintainability, ease of development, deployment) Java wins by a fair amount.

D is however an awesome language and I really hope it reaches a popularity that some day makes C++ obsolete. I don't think that it will be able to compete with Java though, as it doesn't really solve the same problems Java does. It does however solve most if not all of C++'s intricate annoyances.

Now, I'll agree with you about the scripting languages. Most people who are scripting are just as bad as Java developers. But that's kinda the point of scripting languages. It's a solution for retards.

:D

1 15 Jul 2015 09:31 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

These are internet trends and do not correlate with the actual market. Java is everywhere and Java is in everything.

0 15 Jul 2015 08:45 u/Cuddlefluff in v/programming
Comment on: Top 10 Programming Languages (Spectrums 2014 Ranking)

Because given any metric there is always going to be a better choice.

I strongly disagree. Unless you ignore the metrics of performance, stability, ease of development, debugging and maintainability. Java is a solid choice. I'm much more concerned of the current influx of scripting languages being applied to general purpose development.

2 15 Jul 2015 08:11 u/Cuddlefluff in v/programming
Comment on: Programming is sexy

I've been a programmer professionally for about a decade now, and I've never personally met a female programmer, ever. I don't know why the field seems to be so generally unattractive to women, since it's just general problem solving and stuff that I'd suspect women would excel at, maybe even more-so than men. All it takes is a little bit of passion and a slight obsessive personality.

1 14 Jul 2015 11:56 u/Cuddlefluff in v/programming
Comment on: Does Voat not unit test or is it just not included in the GitHub repo?

Yeah, I think they're doing a great job as well.. Small infrastructure, few employees.. This kind of pressure completely murdered Reddit in the start for days on end. Hell, even now after being online for a decade Reddit is still completely unstable and unreliable. So yeah, definitely.

0 13 Jul 2015 22:50 u/Cuddlefluff in v/programming
Comment on: Does Voat not unit test or is it just not included in the GitHub repo?

They also needs to take a serious look at their use of try-catch because it is wrong :P

try
{
    ....
}
catch (Exception) <-- BAD!
{
    ....
}

This is not how exceptions are supposed to be handled. If you have an unhandled exception, there's an entire functionality in ASP.NET to handle that eventuality. Removing the "catch-all" clauses will reduce code duplication and improve debugging and logging.

0 13 Jul 2015 10:55 u/Cuddlefluff in v/programming
Comment on: How do /v/, /r/ urls work?

C# is very cool. What makes people think it's "less cool" than Python is that it's a language that has prerequisites you need to understand in order to use it properly, so it's not as easy to immediately get into making it less attractive for hobbyists. But in any technical terms it is thousands of times "better" than Python for a myriad of reasons.

I also immediately assumed it was made in Python, so I was pleasantly surprised to see that it was not.

0 13 Jul 2015 10:47 u/Cuddlefluff in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

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