[-] [email protected] 1 points 5 days ago

My understanding of the Zune HD (or whatever the iPod Touch competition was) was the same. Technically better in every strict metric, but no app market to speak of.

[-] [email protected] 2 points 6 days ago

My mistake. Please forgive me. I'll pray to Supreme Gates and focus on my KPIs.

[-] [email protected] 2 points 6 days ago

I haven't played the game much so I don't know.

[-] [email protected] 2 points 6 days ago

Reminder that Aunt Jemima is the Mammy stereotype.

1909 advertisement for Aunt Jemima pancake mix in the New York Tribune

[-] [email protected] 2 points 6 days ago

And then something something something no clip backrooms.

Ooh ooh or,

Where do you think all those cleared lines in Tetris go? I twisted the square to the left enough that it loosened and popped out of my screen. What I saw inside was shocking...

[-] [email protected] 4 points 6 days ago* (last edited 6 days ago)

People got wise to it lol. People were posting flowcharts about not buying games until they were on flash deals if you want them. Also some years I think they did something that led people to believe only having specific games on your wishlist was advantageous which led to people removing everything from their wishlist except for stuff that was more expensive. That disproportionately hurt indie devs.

All in all I think I'm glad it's gone. Plus the games (like that racing thing) never made sense to me.

[-] [email protected] 3 points 6 days ago

They said "good" at Tetris, not "God" at Tetris! Mostly a pun but yeah, there's of course a difference between the best in the world and really good casual players.

[-] [email protected] 4 points 6 days ago

Rotating the square in Tetris sounds like the start of a creepy pasta.

[-] [email protected] 2 points 6 days ago

Slightly less than double, actually. (Doesn't really change the meat of the argument or anything though.)

1
submitted 2 years ago by [email protected] to c/[email protected]

Which do you prefer of these two? The goal is the same. If bar is null then make foo null and avoid the exception. In other languages there is the ?. operator to help with this.

foo = bar == null ? null : bar.baz();
foo = bar != null ? bar.baz() : null;

I ask because I feel like the "English" of the first example is easier to read and has less negations so it is more straightforward, but the second one has the meat of the expression (bar.baz()) more prominently.

60
rule (programming.dev)
submitted 2 years ago by [email protected] to c/[email protected]
10
submitted 2 years ago by [email protected] to c/[email protected]

I don't know what it is about this, but like after I'm done working out and got that goofy feeling runner's high it just hits so hard.

1
submitted 2 years ago by [email protected] to c/[email protected]

I've tried solutions explained here and here. I am trying to subscribe to some communities on the TTRPG Network. Am I missing something?

10
Big Max Pumpkin Flower (programming.dev)
submitted 2 years ago by [email protected] to c/[email protected]

I'm growing a Big Max pumpkin this year. This is my second year gardening and first time trying to grow a pumpkin.

Does anyone know if this is a male or female flower? I think I'm supposed to seal the female ones until later but also think I remember reading the male ones come first.

1
Duke, the Java mascot (www.oracle.com)
submitted 2 years ago by [email protected] to c/[email protected]
3
submitted 2 years ago by [email protected] to c/[email protected]
5
submitted 2 years ago by [email protected] to c/[email protected]

Archived link.

I think this is a good read to learn about what tabs and tabstops really are regardless of whether you agree that tabstops should be at different positions per line or with the controversial idea of using proportional fonts (this would work with monospaced fonts too).

1
submitted 2 years ago by [email protected] to c/[email protected]

I'm curious if there are things in the standard class library that you find useful but not widely used.

2
submitted 2 years ago by [email protected] to c/[email protected]

Though it is not possible in Java, the JVM can have multiple methods with the same name and parameter types so long as they have different return types. The JVM spec seems to call it "method descriptor" but I called it signature as I think that's more attention grabbing (and I'm showing how the JVM spec and Java spec differ).

No two methods in one class file may have the same name and descriptor

You can experimentally test this yourself with the Jasmin project. Jasmin is a tool that lets you write assembly code to assemble to JVM byte code. I also used this classfileanalyzer project to get some base Jasmin assembly.

For the lazy, here is the Java code I started with,

public class Example {
  public static void main(String[] args) {
    System.out.println(foo());
    System.out.println(fooInt());
  }
  static String foo() {
    return "1";
  }
  static int fooInt() {
    return 1;
  }
}

Then I got this Jasmin code and replaced each fooInt with foo

; Example.j

; Generated by ClassFileAnalyzer (Can)
; Analyzer and Disassembler for Java class files
; (Jasmin syntax 2, http://jasmin.sourceforge.net)
;
; ClassFileAnalyzer, version 0.7.0


.bytecode 63.0
.source Example.java
.class public Example
.super java/lang/Object

.method public <init>()V
  .limit stack 1
  .limit locals 1
  .line 1
  0: aload_0
  1: invokespecial java/lang/Object/<init>()V
  4: return
.end method

.method public static main([Ljava/lang/String;)V
  .limit stack 2
  .limit locals 1
  .line 3
  0: getstatic java/lang/System/out Ljava/io/PrintStream;
  3: invokestatic Example/foo()Ljava/lang/String;
  6: invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
  .line 4
  9: getstatic java/lang/System/out Ljava/io/PrintStream;
  12: invokestatic Example/foo()I
  15: invokevirtual java/io/PrintStream/println(I)V
  .line 5
  18: return
.end method

.method static foo()Ljava/lang/String;
  .limit stack 1
  .limit locals 0
  .line 7
  0: ldc "1"
  2: areturn
.end method

.method static foo()I
  .limit stack 1
  .limit locals 0
  .line 10
  0: iconst_1
  1: ireturn
.end method

After assembling Example.class with Jasmin and running javap -c Example I get this output,

Compiled from "Example.java"
public class Example {
  public Example();
    Code:
       0: aload_0
       1: invokespecial #28                 // Method java/lang/Object."<init>":()V
       4: return

  public static void main(java.lang.String[]);
    Code:
       0: getstatic     #33                 // Field java/lang/System.out:Ljava/io/PrintStream;
       3: invokestatic  #32                 // Method foo:()Ljava/lang/String;
       6: invokevirtual #10                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
       9: getstatic     #33                 // Field java/lang/System.out:Ljava/io/PrintStream;
      12: invokestatic  #11                 // Method foo:()I
      15: invokevirtual #24                 // Method java/io/PrintStream.println:(I)V
      18: return

  static java.lang.String foo();
    Code:
       0: ldc           #27                 // String 1
       2: areturn

  static int foo();
    Code:
       0: iconst_1
       1: ireturn
}

And of course, running Example.class outputs

1
1

I hope you've enjoyed this interesting quirk of the JVM. It is a good reminder that while the JVM is primarily for Java, there are other languages that use it and some might even use this in a meaningful way somehow.

1
submitted 2 years ago by [email protected] to c/[email protected]

A great read for folks wondering why Java uses type erasure instead of "reified" generics. For the unaware, that means that a List<Integer> is a List<Object> at runtime. I had always wondered about it and why they didn't take the alternative route. For context, C# does have reified types so the actual type parameter is available at runtime.

I personally love reading in depth discussions about counter intuitive engineering decisions like this.

2
submitted 2 years ago by [email protected] to c/[email protected]

Howdy, I remember a podcast where they have the example of Microsoft Excel as an example for an introduction to functional programming. I believe it was an SE Radio podcast on Clojure or that build tool it uses. It doesn't really matter.

I already understood functional concepts and try to use them where I can in Java and other languages. (It is easier to reason about immutable data and pure methods.) I found the metaphor of Excel very interesting though. Because that's basically what it is. I'm sure there are ways to have it not act functionally but the vast majority of the time it is, and I think more people have the basic vocabulary of Excel than functional programming.

Has anyone ever used this or heard of it being used as an example while teaching fp?

view more: ‹ prev next ›

JackbyDev

0 post score
0 comment score
joined 2 years ago
MODERATOR OF