Jump to content
IGNORED

Programming


zlemflolia

Recommended Posts

  • Replies 467
  • Created
  • Last Reply

I keep meaning to get more involved in JUCE but then I start writing more music which takes a lot of my focus away. I'm working on two more albums/projects right now and then completely turning my focus to learning JUCE (since that will lead to yet another music project down the road).


Eventually, I'd like to make an app that generates music kind of in my style, but first I need to learn how to make synths/samplers/etc.

Link to comment
Share on other sites

Also Python fucking sucks as soon as you want to give your damn script thing to someone else.

 

That's fair, I was more talking about how it's built for happiness. If anything you might want to check out Ruby since it has strong lambda support.

 

 

Over two years later and I still haven't made much progress. I feel like software development is something that you have to concentrate on all of the time in order to get any good at it.

 

I think you will find after you get strong at 1 language all the other ones only take about a month or so ramp up time. You begin solving the same problems over and over just in slightly different ways, and new challenges are actually exciting things. I code form 9-5 and then I don't think about it outside of work or on weekends. It does have a meditative quality I find relaxing when I do practice a little bit.

 

I also strongly believe its something you are either born with or not.

Link to comment
Share on other sites

 

Wait, do you seriously not like lambdas?

 

I find people become obsessed with them and generate a unreadable fractal of garbage. I think the more seasoned one gets at programming the more they wants to read 100 lines of code in a few seconds like they are reading a book. Lambda abuse produces a choose your own adventure game on mushrooms.

 

I think an example of some extremely readable expressive code is the Golang core library.

Link to comment
Share on other sites

most of these complaints don't have to do with programming and have more to do with programming in shittily designed high level languages, working on shit tier codebases, and mixing together random shit.  admittedly this no doubt includes lots of if not most programming, but you can always get a job somewhere else where the work is better

 

just switch to C++ where you have some conception of what is happening on the CPU itself along with strong types, and these issues go out the window.  even lambdas are well defined in C++ at compiletime and can be reasoned about in many ways including template metaprogramming based reflection and handling

Link to comment
Share on other sites

hey a programming thread! i'm a hobbyist coder, made a few little arcadey games, like this

 

i've been playing lots of shmups on the switch lately (current faves: quad fighter k and gunbird 2) so started making one of those. except i need a way to make maps and script levels, enemy waves etc, so started working on a game editing tool for that (instead of just learning how to integrate lua or something because i'm an idiot maybe. it's fun tho :))

 

i program in C and OpenGL. well technically C++ but i mostly just use C style code.. much nicer using a C++ compiler because the slightly more modern syntax of is less of a hassle, but i don't have a clue about probably 99% of what's in it, lovely old C is where i'm at.

 

about having to do it all the time to get good at it - totally. i started as a kid with C64 BASIC.. long phases of not doing any programming.. limited spare time nowadays.. etc. only in the last few years am i in a good place with it, where most things are second nature and i can sit back and let the code flow. not to be discouraging or anything. things will click at a certain point! (and open up whole new realms of further things to learn, haha).. sometimes i want to get a bit more serious and learn some modern stuff like Unity, make more ambitious games. but nahhh i'll probs just stick to my ye olde arcade games in C. in the last few years i learnt how to do shaders so can make trippy visual fx and such.. what more could i need..

 

although. i would love to learn how to do proper audio code, to make a little synth/modtracker format i could build into my game engine... one day..

Link to comment
Share on other sites

hey a programming thread! i'm a hobbyist coder, made a few little arcadey games, like this

 

i've been playing lots of shmups on the switch lately (current faves: quad fighter k and gunbird 2) so started making one of those. except i need a way to make maps and script levels, enemy waves etc, so started working on a game editing tool for that (instead of just learning how to integrate lua or something because i'm an idiot maybe. it's fun tho :))

 

i program in C and OpenGL. well technically C++ but i mostly just use C style code.. much nicer using a C++ compiler because the slightly more modern syntax of is less of a hassle, but i don't have a clue about probably 99% of what's in it, lovely old C is where i'm at.

 

about having to do it all the time to get good at it - totally. i started as a kid with C64 BASIC.. long phases of not doing any programming.. limited spare time nowadays.. etc. only in the last few years am i in a good place with it, where most things are second nature and i can sit back and let the code flow. not to be discouraging or anything. things will click at a certain point! (and open up whole new realms of further things to learn, haha).. sometimes i want to get a bit more serious and learn some modern stuff like Unity, make more ambitious games. but nahhh i'll probs just stick to my ye olde arcade games in C. in the last few years i learnt how to do shaders so can make trippy visual fx and such.. what more could i need..

 

although. i would love to learn how to do proper audio code, to make a little synth/modtracker format i could build into my game engine... one day..

look into CSound for this purpose

 

https://en.wikipedia.org/wiki/Csound

 

I haven't used it but it seems to fit your goals

Link to comment
Share on other sites

Zeffolia: thanks :) but that's not quite what i meant.. i think Csound is more, a tool which you can use to program sounds in its own language (iirc? been many years since i tried it) .. what i want to do is make my own such tool from scratch(ish), so that it can be built into my games so they can generate their own sound effects, for example, rather than use an already existing external tool. i get that it basically comes down to filling a buffer with numbers and sending it to the soundcard.. it's the specifics of coding that in C i know nothing about. (Csound might be a good way to learn what kind of things to do when it comes to actually filling that buffer with numbers tho!)

Link to comment
Share on other sites

 

 

Wait, do you seriously not like lambdas?

 

I find people become obsessed with them and generate a unreadable fractal of garbage. I think the more seasoned one gets at programming the more they wants to read 100 lines of code in a few seconds like they are reading a book. Lambda abuse produces a choose your own adventure game on mushrooms.

 

I think an example of some extremely readable expressive code is the Golang core library.

Ah, I think I know the kind of thing you're talking about - I see that in C# a lot actually with LINQ expressions. People use it for gnarly data marshaling functions and the like.

 

I like lambdas in JS because when I spot duplication I can easily pull them out into their own little utility functions. That itself might be the choose your own adventure on shrooms thing you're talking about, but I guess I've rationalized it as making little friendly lego-sized pieces I can plug in more cleanly than writing functions that are 80% the same, all over the application. I usually like to name my lambdas too, even if I only use them once, so I can make things a little more self-documenting.

 

Also function composition makes me smile, but maybe it's just a phase I need to get out of my system by giving Clojure or Haskell an honest effort to learn.

 

What are some of your favorite examples in Golang core?

Link to comment
Share on other sites

what i want to do is make my own such tool from scratch(ish), so that it can be built into my games so they can generate their own sound effects, for example, rather than use an already existing external tool.

The game Spore from about 10 years back used an embedded PD runtime to create its sound effects. 

https://www.uni-weimar.de/kunst-und-gestaltung/wiki/images/Usage_of_Pd_in_Spore_and_Darkspore.pdf

Link to comment
Share on other sites

Over two years later and I still haven't made much progress. I feel like software development is something that you have to concentrate on all of the time in order to get any good at it.

I'm a full time programmer and I still forget about code I wrote two months ago, when I come back to it I think "wtf was I doing".

Link to comment
Share on other sites

omg guys! if i knew programming the way you do id make symphonies in supercollider. danm!  :sad:

If it makes you feel any better, I woke up stressing about whether all my code is unreadable garbage and I'm probably going to spend a good chunk of my morning googling how not to do that.

Link to comment
Share on other sites

 

omg guys! if i knew programming the way you do id make symphonies in supercollider. danm!  :sad:

If it makes you feel any better, I woke up stressing about whether all my code is unreadable garbage and I'm probably going to spend a good chunk of my morning googling how not to do that.

 

 

 

no, it doesnt, it makes me feel better when i hear how successful you are ;)

 

is programming related to your daily job? it's faaar from mine and im still stressed :)

Link to comment
Share on other sites

Javascript is a garbage language, but it's not because of lambdas (which are great), it's because of shit like terrible scoping with 'var' (use 'let' instead), inconsistent 'this' binding (closures vs functions), null/undefined nonsense and terrible type coercion (=== operator), plus lots of other crap. It's also terrible because it's not type safe, making it useless for non-trivial development, thankfully Typescript fixes that for the most part - though it's still quite limited, without type introspection (reflection) you're limited in what you can do in terms of metaprogramming. What do you expect from a language that was created in a weekend though?

 

Another terrible part of the whole thing is the ecosystem: npm, proliferation of idiotic libraries for every kind of thing (learn to write the code yourself people, if you have more than 5 libraries in your codebase you're doing it wrong - though this is hard to avoid, due to libraries having dependencies on other libraries, so at least try and keep the number you willfully include to a minimum), the very existence of node, proliferation of build systems and other nonsense (you shouldn't need 5 different config json/yaml files and 10 different build steps to generate a web app). The development of all that useless and harmful cruft is mostly down to the limitations of the language to begin with (though not all, much of it was just needless stupidity), they really should've dumped it and started with a new language once people started writing non-trivial things 10 years ago or so. Hopefully wasm will finally kill it off in a few years and we can just write with proper languages targeting that, microsoft's blazor project is really exciting to me, the amount of code I've had to write over the last number of years that could have been avoided if a sensible model like that was available is not small.

 

There are some nice features to the language, especially if you use the latest features and use the right conceptual model (use a more functional style for one), it can be very expressive and powerful; but it requires a lot of mental overhead to keep on top of all the bad shit (and it's next to impossible to do, so you'll be fixing lots of horrible bugs caused by bad language design regardless).

 

 

C++ is also a pretty terrible language, designed by committee it has accumulated a load of terrible cruft over the years, and never addressed the core problems with the language properly (e.g. forward declarations, header files are only now being looked at with the new module proposals), and most of the big features they've added to the language have been poorly implemented (e.g. templates). It's still really powerful of course, and you can pick a nice subset of the language to use and ignore the bad parts for a better time. Go and Rust are nice developments though, and I've been following this new language (codenamed Jai) being created by game developer Jonathan Blow, which seems really nice too.

 

 

I spend most of my time with C#, VB.net (Basic is still my favourite language, it was what I learned first before Pascal and C back in the late 80s) and TypeScript. C# has developed really nicely over the last number of years, lots of really nice stuff being put in there, particularly happy with the new performance stuff being put in now (span<T>/stack allocation/ref returns etc/dotnetcore generally). Really hope they get around to adding some proper compile time metaprogramming though, I write a lot of reflection based runtime metaprogramming, this really should be handled by the compiler though, would speed things up a lot (and remove the need for me to write boilerplate caching code to try and fix those perf issues); they keep putting that stuff off though so not likely to show up any time soon (I'm talking about something like this: https://github.com/dotnet/roslyn/blob/master/docs/features/generators.md).

Link to comment
Share on other sites

C++ is also a pretty terrible language, designed by committee it has accumulated a load of terrible cruft over the years, and never addressed the core problems with the language properly (e.g. forward declarations, header files are only now being looked at with the new module proposals), and most of the big features they've added to the language have been poorly implemented (e.g. templates). It's still really powerful of course, and you can pick a nice subset of the language to use and ignore the bad parts for a better time. Go and Rust are nice developments though, and I've been following this new language (codenamed Jai) being created by game developer Jonathan Blow, which seems really nice too.

 

Forward declarations and headers are indeed an issue, but how are C++ templates badly designed?  C++ templates are amazing especially with template metaprogramming

Link to comment
Share on other sites

they're very powerful, but the syntax is a mess (if you do anything even vaguely complicated), and they really slow down compilation when overused (not sure if that's down to bad design, or bad compiler implementation)

 

the new metaclasses proposal looks quite nice, and would fix a lot of those problems I think, see: https://blog.jetbrains.com/clion/2017/11/towards-a-more-powerful-and-simpler-cpp-with-herb-sutter/

Link to comment
Share on other sites

Javascript is a garbage language, but it's not because of lambdas (which are great), it's because of shit like terrible scoping with 'var' (use 'let' instead), inconsistent 'this' binding (closures vs functions), null/undefined nonsense and terrible type coercion (=== operator), plus lots of other crap. It's also terrible because it's not type safe, making it useless for non-trivial development, thankfully Typescript fixes that for the most part - though it's still quite limited, without type introspection (reflection) you're limited in what you can do in terms of metaprogramming. What do you expect from a language that was created in a weekend though?

Yes to all the above, except I wouldn't say "garbage" or "useless", just that it has some huge flaws. I go one further than 'let' and use 'const' whenever I can (although, of course, you can still mutate objects assigned to const). Reflection would be nice, as would operator overloading. 

 

Also I feel dirty whenever I have to use 'this' in JS and I generally dislike using classes in it.

 

Another terrible part of the whole thing is the ecosystem: npm, proliferation of idiotic libraries for every kind of thing (learn to write the code yourself people, if you have more than 5 libraries in your codebase you're doing it wrong - though this is hard to avoid, due to libraries having dependencies on other libraries, so at least try and keep the number you willfully include to a minimum), the very existence of node, proliferation of build systems and other nonsense (you shouldn't need 5 different config json/yaml files and 10 different build steps to generate a web app). The development of all that useless and harmful cruft is mostly down to the limitations of the language to begin with (though not all, much of it was just needless stupidity), they really should've dumped it and started with a new language once people started writing non-trivial things 10 years ago or so.

I actually like npm and small (but not micro-) libraries as a general concept, but they should be added cautiously and, yeah, you don't want to invite people to your party who are going to bring 5 of their friends that you don't know. It's troubling when your dependency tree gets more than 2-3 levels deep. And, on the other hand, in the cases of the really useful general utility libraries like Ramda, lodash, Sanctuary, etc. you end up having to learn different dialects and reading pretty hacky-looking syntax for things that probably should have been built into the core API.

 

It's the shit like node-sass that really gets on my nerves, though, with node calling into python to run a C++ library just to transpile SASS into CSS. And this is the standard way of using SASS in node. W T F

 

There are some nice features to the language, especially if you use the latest features and use the right conceptual model (use a more functional style for one), it can be very expressive and powerful; but it requires a lot of mental overhead to keep on top of all the bad shit (and it's next to impossible to do, so you'll be fixing lots of horrible bugs caused by bad language design regardless).

Yeah, I like the functional approach, it feels more like an audio or MIDI flow to me than OOP. I really like the Array methods (map, filter, reduce) in particular, although I think more proper functional languages build these into the syntax more elegantly. And then you still need to bring your own combinators because the language doesn't provide any.

 

And, yeah, it often feels like perpetually sanding down the rough edges of the language trying to clean things up. I probably have some Stockholm syndrome from being so used to JS.

 

C# has developed really nicely over the last number of years, lots of really nice stuff being put in there, particularly happy with the new performance stuff being put in now (span<T>/stack allocation/ref returns etc/dotnetcore generally). Really hope they get around to adding some proper compile time metaprogramming though, I write a lot of reflection based runtime metaprogramming, this really should be handled by the compiler though, would speed things up a lot (and remove the need for me to write boilerplate caching code to try and fix those perf issues); they keep putting that stuff off though so not likely to show up any time soon (I'm talking about something like this: https://github.com/dotnet/roslyn/blob/master/docs/features/generators.md).

This looks really interesting but I'm having a hard time imagining how to use it - do you know of any examples? Also what does your runtime metaprogramming look like - something like extension methods?

Link to comment
Share on other sites

This looks really interesting but I'm having a hard time imagining how to use it - do you know of any examples? Also what does your runtime metaprogramming look like - something like extension methods?

 

One of the more complicated bits of the current thing I'm working on involves me generating a bunch of metadata about my classes (which are Entity Framework models mostly, but also some POCOs, and event sourced classes) using reflection and expression trees created from lambdas, this gets sent to my TypeScript app via JSON, which constructs some UI for filtering/ordering/updating the data, any changes made are sent back to the server, which then creates a bunch of expression trees and compiles them for use in LINQ queries and lambdas to update the class members (rather than reflection invokes, which are super slow). With some proper code generation features I could do all of this at compile time and not have to deal with the slow startup times to run all the reflection/expression tree stuff and the need to do a lot of caching on first use of the runtime-compiled stuff. A simpler version of this would be to create high performance serialization code.

 

The most common example given for code generators is to do a mixin style thing, implementing INotifyPropertyChanged for example. See here for more info: https://github.com/dotnet/csharplang/issues/107, here's some more examples: https://github.com/dotnet/csharplang/issues/341

 

I really like extension methods too, been using them a lot recently. They're going to improve them in future releases, be able to do extension everything (e.g static members, properties, not just class instance members). I've been getting back to a more procedural way of coding, with more judicious use of OO, back to how I used to code back in the DOS days, but with better language features it's far less of a mess than it was back then. More extension goodness will help with that.

Link to comment
Share on other sites

One of the more complicated bits of the current thing I'm working on involves me generating a bunch of metadata about my classes (which are Entity Framework models mostly, but also some POCOs, and event sourced classes) using reflection and expression trees created from lambdas, this gets sent to my TypeScript app via JSON, which constructs some UI for filtering/ordering/updating the data, any changes made are sent back to the server, which then creates a bunch of expression trees and compiles them for use in LINQ queries and lambdas to update the class members (rather than reflection invokes, which are super slow). With some proper code generation features I could do all of this at compile time and not have to deal with the slow startup times to run all the reflection/expression tree stuff and the need to do a lot of caching on first use of the runtime-compiled stuff. A simpler version of this would be to create high performance serialization code.

That's a pretty cool way of building a UI to interact with data models. Almost seems like a dynamically generated DSL that you interact with via a web UI / network requests.

 

I really like extension methods too, been using them a lot recently. They're going to improve them in future releases, be able to do extension everything (e.g static members, properties, not just class instance members). I've been getting back to a more procedural way of coding, with more judicious use of OO, back to how I used to code back in the DOS days, but with better language features it's far less of a mess than it was back then. More extension goodness will help with that.

I've really just started getting comfortable with them in the last few months and I also really like them, especially for when I want to do common operations on classes I can't (e.g. external code) or don't want to modify. It's a nice way of isolating type-specific concerns so that you can keep the level of abstraction more consistent.

Link to comment
Share on other sites

The most common example given for code generators is to do a mixin style thing, implementing INotifyPropertyChanged for example. See here for more info: https://github.com/dotnet/csharplang/issues/107, here's some more examples: https://github.com/dotnet/csharplang/issues/341

Ah, interesting stuff, thanks for the links.

Link to comment
Share on other sites

 

what i want to do is make my own such tool from scratch(ish), so that it can be built into my games so they can generate their own sound effects, for example, rather than use an already existing external tool.

The game Spore from about 10 years back used an embedded PD runtime to create its sound effects.

https://www.uni-weimar.de/kunst-und-gestaltung/wiki/images/Usage_of_Pd_in_Spore_and_Darkspore.pdf

ooh that's really cool.. so much power O_O

Link to comment
Share on other sites

they're very powerful, but the syntax is a mess (if you do anything even vaguely complicated), and they really slow down compilation when overused (not sure if that's down to bad design, or bad compiler implementation)

 

the new metaclasses proposal looks quite nice, and would fix a lot of those problems I think, see: https://blog.jetbrains.com/clion/2017/11/towards-a-more-powerful-and-simpler-cpp-with-herb-sutter/

 

the syntax can't really be simplified any more than they it is.  it's essentially template parameters + constexpr compiler inference.  it has a high learning curve admittedly, and also admittedly there is some ugly stuff though like the requirement to use typename when accessing type members

 

agreed on compilation time but it's not an issue when you use a proper isolation of components and don't include massive header-only things when it's not needed

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.