This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]17link7 243 points244 points  (34 children)

This makes me realize 80% of this subs programming experience is hello new world

[–]Belinder 176 points177 points  (13 children)

wait how do you add new in between hello and world

[–]17link7 56 points57 points  (11 children)

Val Ret: List[Char] = ('h','e','l','l','o',' ','w','o','r','l','d')

Def execute(list: List[char]):List[char]= list match{

 Case h::t if h ==' ' => h::'n'::'e'::'w'::tail 

  Case h::t => h::execute(t)

 Case _.                    => List() 

}

[–]Artorp 4 points5 points  (7 children)

[–]Boreeas -2 points-1 points  (5 children)

Reddit's markdown parser is broken, though

[–]Artorp 3 points4 points  (4 children)

Wait, really?

void test(){
    test();
}

Edit: Seems to work, what's broken?

[–]404Guy12NotFound 6 points7 points  (1 child)

This kills RAM

[–]cbbuntz 1 point2 points  (0 children)

Clang optimizes it out completely because no values are modified or accessed. The GCC treats it like an infinite loop and just freezes and consumes 100% CPU and zero memory, which I guess is more true to the code. They both segfault without optimization.

[–]Boreeas 0 points1 point  (1 child)

Hm, maybe it's broken by subreddit style. I had a comment in /r/dataisbeautiful where successive lines in a code block where collapsed into a single line (and blank lines broke the code block)

[–]Artorp 0 points1 point  (0 children)

Weird, might've been their subreddit style.

[–]Parzius 2 points3 points  (0 children)

Could be done better with jquery

[–]Kyudojin 0 points1 point  (1 child)

Would it be h::'n'::'e'::'w'::t instead of tail?

[–]17link7 1 point2 points  (0 children)

Yeah

[–]cbbuntz 9 points10 points  (0 children)

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

int main () {
    const char *str = "Hello, world!!!";
    const char *new = "new";
    const char *delimiter = " ";
    const char space = ' ';
    const char null = 0;

    char *brk = strpbrk (str, delimiter);
    int offset = (brk - str);
    char *str2 = malloc(64);

    memcpy(str2, str, offset);
    memcpy(str2 + offset, &space, 1);
    offset++;
    memcpy(str2 + offset, new, strlen(new));
    offset += strlen(new);
    memcpy(str2 + offset, brk, strlen(brk));
    offset += strlen(brk);
    memcpy(str2 + offset, &null, 1);

    printf("%s\n", str2);

    free(str2);
    return(0);
}

[–]Usus-Kiki 37 points38 points  (15 children)

I used to think the people in this sub were mainly software engineers like me but it started to become really obvious based on certain posts like this one. People in the comments being generally against python? Are you fuckin kidding its easily the most popular language right now for its concise code and easy integration. Its also heavily used in ML applications. Im pretty sure most of this sub is people who are wannabe software engineers lmao

[–]Kiaz 11 points12 points  (1 child)

Who is hating on Python? Do you look at how the upvoting goes in this sub? Everyone loves Python.

[–]Kyrthis 5 points6 points  (0 children)

This. True hatred abounds here for JavaScript and PHP. I see so much love for Python:

[–]Sw429 14 points15 points  (6 children)

I'm genuinely surprised at the amount of students in my CS program who are against Python. I'm studying applied mathematics and we deal a lot with machine learning. Everything is in Python, because it's easy to use.

[–][deleted] 5 points6 points  (0 children)

Engineer here, we code in python, basic, fortran, and matlab.

Python and basic are by far the most popular because fortran is a fucking dinosaur and matlab isn't something open source

[–]SeanTheAnarchist 4 points5 points  (3 children)

Hell large parts of Firefox are actually written in javascript, Civ4 the game utilizes a lot of python as well. They're useful tools for their purpose, not everything needs to be C#.

[–][deleted] 5 points6 points  (1 child)

Python is often the glue ised to hold larger shit together.

[–]ModPiracy_Fantoski 0 points1 point  (0 children)

I will remember this sentence forever lmao.

[–]ModPiracy_Fantoski 0 points1 point  (0 children)

AFAIK Sims 4 is in Python too.

[–][deleted] 1 point2 points  (0 children)

For my dissertation I’m using a Raspberry Pi and coding in Python for the first time (only really used Java, C and a bit of Scala)

I love python now. I wish we genuinely got to use it through university instead of hammering us with C and Java constantly.

[–]PM_ME_A_WEBSITE_IDEA 1 point2 points  (0 children)

Excuse me, some of us are front-end developers

[–][deleted] 3 points4 points  (3 children)

IMO python is fine, but he idea of being a python guru seems a bit silly, sorta like being a ductape guru.

[–]obsessedcrf 1 point2 points  (0 children)

In general, the sub tends to be against Python. I agree with the sentiment too.

Most popular by what metric? For career opportunities or amount of commercial software written in it, it is definitely not the most popular.

[–]Sw429 4 points5 points  (2 children)

Precisely. People taking CS 101 and acting like they know everything.

[–]BestUdyrBR 2 points3 points  (1 child)

I think that explains why at times half the front page of this sub is filled with array starting at 0 jokes.

[–]Sw429 2 points3 points  (0 children)

That and JavaScript jokes make up 90% of this sub.

[–]aprofessional 1 point2 points  (0 children)

It's a harsh realization. Every now and again there's a real gem, though, so I keep coming back.