Live data from Hacker News

What programming languages are used most on weekends?

stackoverflow.blog

281–290 of 299 posts

Re: What programming languages are used most on weekends?

#282

Earlier quoted context omitted.

In most of today "real world" languages you can't use pointers.

If you can get NullPointerException, then you are using pointers. May be you meant that you can't use pointer arithmetic, but pointers are used almost everywhere.

That is just a name, decided before Java settled on a consistent terminology. In C# it is NullReferenceException.

We get into nitpicking, but I would argue references and pointers are not the same. Pointer are by definition memory addresses, while references are opaque and could be addresses under the hood.

Note also that C# does have pointers, but they are separate from references.

Re: What programming languages are used most on weekends?

#283

Earlier quoted context omitted.

Functional Programming is about working with mathematical functions . Having "first-class functions" in the language is nice, but then passing function pointers around is nothing more than procedural programming [1] and yes, the difference is huge. As for those utilities you mention, Javascript is the most broken of them all: >>> ["10", "10", "10"].map(parseInt) [10, Nan, 2] [1] https://en.wikipedia.org/wiki/Procedur…

So that others don't have to spend time searching: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

What does that example prove, other than the two methods aren't compatible?

If a properly designed method were passed into map it would work fine.

In essence: ["10", "10", "10"].map(Number)

Re: What programming languages are used most on weekends?

#284

Earlier quoted context omitted.

If you can't use pointer arithmetic, you don't use pointers. Your language uses them internally, but not you. NullPointerException in Java/C# is a result of a leaky abstraction.

> If you can't use pointer arithmetic, you don't use pointers. Is it someone's definition of pointer? > Your language uses them internally, but not you. I'm actively using pointers that point to object. > NullPointerException in Java/C# is a result of a leaky abstraction. I don't agree. Java has uses pointers (which also called references and those are synonyms for Java), Java has concept of null pointer and I don't…

It is wikipedia[1] definition of pointer.

> In computer science, a pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address.

> [2] Pointers are the most primitive. Due to their intimate relationship with the underlying hardware, they are one of the most powerful and efficient types of references. Pointer "points to memory", so if you change value of a pointer, you change what memory it points to. In java you can't change what a pointer points to. It's only references.

> I'm actively using pointers that point to object.

No, you passively use references that point to object. You can't do *(ptr+1) in java. Leaky abstraction means that it's called a pointer but it isn't a real pointer. Also as another commenter said, in C# it's properly called a reference.

[1] https://en.wikipedia.org/wiki/Pointer_(computer_programming) [2] https://en.wikipedia.org/wiki/Reference_(computer_science)#E...

Re: What programming languages are used most on weekends?

#285

Earlier quoted context omitted.

> If you can't use pointer arithmetic, you don't use pointers. Is it someone's definition of pointer? > Your language uses them internally, but not you. I'm actively using pointers that point to object. > NullPointerException in Java/C# is a result of a leaky abstraction. I don't agree. Java has uses pointers (which also called references and those are synonyms for Java), Java has concept of null pointer and I don't…

It is wikipedia[1] definition of pointer. > In computer science, a pointer is a programming language object , whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address. > [2] Pointers are the most primitive. Due to their intimate relationship with the underlying hardware, they are one of the most powerful and efficient types of references. Pointer "points to…

Of course you can change the value of pointer in Java, just assign any other address. Even if I can't do pointer arithmetic in Java, they are still pointers, just without pointer arithmetic.

Re: What programming languages are used most on weekends?

#286
post #282

Earlier quoted context omitted.

If you can get NullPointerException, then you are using pointers. May be you meant that you can't use pointer arithmetic, but pointers are used almost everywhere.

That is just a name, decided before Java settled on a consistent terminology. In C# it is NullReferenceException. We get into nitpicking, but I would argue references and pointers are not the same. Pointer are by definition memory addresses, while references are opaque and could be addresses under the hood. Note also that C# does have pointers, but they are separate from references.

Well, memory address is a memory address and pointer is a pointer. You can have virtual function pointer in C++, which is much more than just a memory address, it's a complex value, yet it's called a function pointer. If you're using that definition then yes, but I don't think that everyone uses it. For me pointer is an entity which points to some value, the key is an indirection, not an implementation. I think, that even C++ would allow compiler to implement pointers as something opaque (e.g. for safety).

Re: What programming languages are used most on weekends?

#287
post #255

Earlier quoted context omitted.

"Then again, sed works differently on different platforms" Well that kills my idea why to use awk/sed. What would you use @freehunter?

Perl, Python, Ruby

True, defeats the idea of a one liner in bash/awk/sed.

Re: What programming languages are used most on weekends?

#288
post #255

Earlier quoted context omitted.

Perl, Python, Ruby

True, defeats the idea of a one liner in bash/awk/sed.

Well the beauty of one-liners is that they're quick and dirty. They don't need to be portable, you don't usually maintain a one-liner for years. If you need something portable, you should use a real cross-platform language like Perl, Python, etc. Something that's independent of the OS you're running.

Re: What programming languages are used most on weekends?

#290
post #9

Happy to see Python-3.x taking over old Python.

Old Python, I like that. Sounds like my manager in a recent conversation: "Don't say [competing product name], say 'the legacy [product type]'. It drives home the idea that our product is the future and that product is the past." I'm not making any judgement on the status of the Python community, just appreciating your choice of wording.

Welp, apparently all managers have something in common…
Post reply on HN