• Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Programming!

I'm trying to install MonoDevelop, but I need to install GTK# first, and it won't install because it gives a write error: "cannot write to file atk-sharp.dll: verify that you have access to that directory". As far as I know, I have full Administrator permissions and I'm giving permission to the installer each time I run it.

I'm wondering if anyone here would be able to help?
 
I'm currently trying to make something in C++ that reads in words on separate lines from a .txt and assigns each of them to their own class string. I've got the reading-in part done, but I want to have it do this:
  • For each word in the file, create a new class variable
  • Assign an ID to each word (and an "ID" member variable of that word's class variable)
  • Have that word's class variable be named its ID
  • Assign the word to its class variable
But I don't know how to have it make a new class variable for each word, because I don't know how to dynamically allocate class variables.
 
I know I've dropped this in here before, but I've made this in PHP:

https://snivy.info/cc/index.php

Don't ask why I made it, I was just bored one evening and have since gradually improved on this in the years it's been around.
 
I'm currently trying to make something in C++ that reads in words on separate lines from a .txt and assigns each of them to their own class string. I've got the reading-in part done, but I want to have it do this:
  • For each word in the file, create a new class variable
  • Assign an ID to each word (and an "ID" member variable of that word's class variable)
  • Have that word's class variable be named its ID
  • Assign the word to its class variable
But I don't know how to have it make a new class variable for each word, because I don't know how to dynamically allocate class variables.

Instead of creating a new variable for each word, why not use an array of strings? In that case, you can have a single variable that references an array of strings that contains every word, and instead of creating an additional ID, you can use the index of array to refer to individual strings within it.
 
Instead of creating a new variable for each word, why not use an array of strings? In that case, you can have a single variable that references an array of strings that contains every word, and instead of creating an additional ID, you can use the index of array to refer to individual strings within it.
I worked out how to do it! I feel really happy now :) :D Thank you Cocoa!


Do any other IDEs work as well for C# as Xamarin? I don't think I'll be able to install Xamarin :(
 
Last edited:
I worked out how to do it! I feel really happy now :) :D Thank you Cocoa!


Do any other IDEs work as well for C# as Xamarin? I don't think I'll be able to install Xamarin :(

Visual Studio Community edition is the other popular choice, it's the same as the full version of Visual Studio, but for personal use/small developers.
 
I'm a self-taught programmer, and I've dabbled in a number of languages. My two "main" languages are C# and sometimes Python when I'm in the mood. I've experimented with Java before, but it came off as an annoying form of C# to me. I've actually been into Lua stuff lately, because it's so easy to pick up. Apart from that, I've tried C++ and C but they're so low-level that the transition from C# is tough. In the past I was a VB.NET programmer but I've thankfully left that far behind me.

As for web stuff, I know the mandatory HTML/CSS stuff and I've messed around with PHP and JavaScript before.

Visual Studio is the best for C#, imo, although there's other IDEs that may work. Head to MSDN and ask about it.

Quite true. The only thing Xamrin has over Visual Studio is the number of programming languages (assuming you have the right OS, that is), though that has been changing too.
 
I think NetBeans can also handle multiple languages, if memory serves. Programmer's Notepad as well, which is included in devkitpro, although it may be on its own as well.

Most of those Java-type IDE's boast multiple languages these days. But Programmer's Notepad is just a syntax-highlighting text editor, isn't it? I know I have it on another computer with devKitPro, but I've never used it.
 
If configured properly, it can also build and deploy. With devkitpro, you can build Wii applications and use Wiiload to send it to the Homebrew Channel to run through local hosting.

Huh, useful. I had a feeling it would have stuff like that, or they probably wouldn't bother with it. Speaking of devKitPro, has anyone bothered to learn/use ASM outside of ROM hacking for stuff like homebrew and whatnot?
 
So is there anybody here who goes to college for programming? What languages does your institution teach/not teach? Just curious.

Moi. o7 Don't know if I survived this year though. As far as I know, my place teaches C++, C#, C, Objective-C, Jet, Ruby, Phython, Java, and all'a those other lovely web-based scripting languages. Not so sure legacy languages are taught, but the lecturers are certainly proficient in 'em. Probably more there too, like those vague 'new' languages.

Do any other IDEs work as well for C# as Xamarin? I don't think I'll be able to install Xamarin :(

If you wanna see some real magic, get the Resharper C# plug-in for Visual Studio. Bit of a pain to set up, but if you're a registered student you can get a free Jetbrains sub for 1 year and have access to all of their programs. I'd use it with discretion though - I know guys that became a bit too reliant on it, and could not code C# from scratch then.
 
Visual Studio Community edition
Visual Studio
Resharper C# plug-in for Visual Studio
Alas, I can't install Visual Studio for some unknown reason, and I code C++ in Code::Blocks. But I'll try again to install VS I guess, especially since I got .NET Framework 4.5 working - it wouldn't install before, but the latest version of Paint.NET managed to install it successfuly somehow. It's kind of funny that the purpose-installer of .NET Framework failed to install it but the Paint.NET installer which installs it on the side because it needs it to run manages to {XD}

If configured properly, it can also build and deploy. With devkitpro, you can build Wii applications and use Wiiload to send it to the Homebrew Channel to run through local hosting.
It's times like this I wish Wii ASM was easy to learn, but it is ASM, ha. The most custom I'll really ever make myself for a Wii is texture, model, sound or level hacks, but that's good enough for me, haha.
 
Syntactically, ASM is pretty easy to learn, especially considering that you have fewer operations than in a higher level language. The difficult part is the theory, rather than the syntax, especially since you directly access memory with very few abstractions.

A great place to start is with a simulator. There's a great simulator for the MIPS architecture, but if you want to play with hardware, coding ARM MIPS for the Raspberry Pi is also pretty well documented..
 
So what I did to read in the words from a txt file is make a void function which first reads in the contents of the file repeatedly to a temporary string, incrementing a global variable "wordCount" each time it reads. Then, the function creates a new string array called "words" with the wordCount as the size. It then reads the contents of the txt file into the members of the array.

A great part about this is that the function is mostly encapsualted in itself, apart from the global words and wordCount, which are global for convinence and could be contained inside the function if you really wanted to (but you'd have to pass it between functions). All you have to do is initialize the function at the start of main and the array is then accessible anywhere in the program.


So while this string array method has worked fine for my program so far, I would now like to be able to put each word-string into an object (either a class or struct) that stores multiple boolean values. Basically, is it possible to dynamically allocate a varying amount of class/struct objects?
 
I'm not a fan of IDEs. There was a time when I had to work with Eclipse and another one where I used Visual Studio, but most of them time I want to get something done, I prefer Vim/Notepad++ combined with a command line compiler. The only problem was getting Windows to let me use the compiler within the Powershell, but that can easily fixed by adding the right paths into PATH.
 
I'm not a fan of IDEs. There was a time when I had to work with Eclipse and another one where I used Visual Studio, but most of them time I want to get something done, I prefer Vim/Notepad++ combined with a command line compiler. The only problem was getting Windows to let me use the compiler within the Powershell, but that can easily fixed by adding the right paths into PATH.
For me personally, an IDE simplifies it and allows me to change anything about the program from within an interface. Code::Blocks is what I use so far, and it's fairly helpful. Perhaps as a beginner I'm better off with an IDE.


I'm still not sure how to solve my above problem. I don't know if it's possible to create a variable with a dynamic name each time, but it doesn't seem to be. The best solution I can think of is having a function that generates the struct/class variables each time, and returns it to the caller which then uses them.

But is it possible to dynamically allocate class variables?


EDIT: Never mind, I have solved every problem I have come accross so far. I feel content :D
 
Last edited:
For me personally, an IDE simplifies it and allows me to change anything about the program from within an interface. Code::Blocks is what I use so far, and it's fairly helpful. Perhaps as a beginner I'm better off with an IDE.
Many people (including me) recomment beginners to start with a normal text editor as it's really just the most simple configuration you can have, which basically forces you to know what you are doing. IDEs tend to take away a lot hassle that comes with programming, but when they don't, things get complicated, especially when you never experienced what's actually going on in the background.
 
Many people (including me) recomment beginners to start with a normal text editor as it's really just the most simple configuration you can have, which basically forces you to know what you are doing. IDEs tend to take away a lot hassle that comes with programming, but when they don't, things get complicated, especially when you never experienced what's actually going on in the background.
Well I've already got Notepad++, so I guess I can try compiling via command-line. But I'll still keep using Code::Blocks. What will I really be missing by using it?

------

On a subject of Rust, I read: Criticizing the Rust Language, and Why C/C++ Will Never Die. The article says that Rust is a language that tries to be as fast as C++ but also safe. Regardless of whether it's truthful or not, it was an interesting read for me.
 
I might look into Rust, it depends on how well I can learn other languages (C++/C#) first :).

I looked at C#, and since it's so very similar to C++, the general syntax is familiar to me. You can code for iOS/Android with C#? That's definitely a good reason for me to try it out. I'll get an IDE for it today and give it a shot :).


And by the way, does your username have anything to do with the language of the same name?

Don't let IDEs and Windows filth poison your brain young one. Learn the ways of a true text editor like Emacs or Vim.

Don't let them lure you with false pretences. You can program for iOS/Android using Javascript, with HTML/CSS for Ui design - it's not such a special feature.

C# is not nearly cross platform enough anyway, you still need to use Mono for GUIs and crap.

Anyway, as has been mentioned before, C is a must - especially if you work on Linux. While Rust and similar languages are interesting, they're not going to overtake the most influential language in the world. However, it's generally easier to get familiar with a higher level language (JavaScript is a great choice) first, and then learn C as a second or third language. Worrying about memory management and things is a bit of a hassle for beginners who are still trying to learn basic control flow. However, once you know one language well you can generally pick up the basics of another in mere minutes - there is always a lot of cross-pollination of ideas in programming that makes it easy to pick up another language. (Most high level languages draw inspiration from C, Lisp, etc.)
 
It's certainly valid to learn how your code gets translated down to a machine's understanding using basic tools first, but dismissing IDEs entirely is also insane. You gain nothing by forcing yourself to do repetitive things on a text editor that an IDE can save time on (like autocomplete, live type inference, line-by-line error reporting etc.).

Maybe you are unfamiliar with Emacs, but it's a lot more extensible that any IDE will ever be. Not only can it be extended to have those features you've listed, but it can have pretty much anything you can think of. I use it as an IRC client and a hex editor for example. The key bindings certainly improve your productivity tenfold. Watch a video of someone live editing in Emacs if you want to see what I mean.

Too bad web technologies are exceptionally slow compared to native environments. For someone who's learning how to program, this can be just about the least intuitive way to go around doing it.

This was in response to someone suggesting that C# can be used to develop for mobile platforms - I was merely pointing out that it is not exceptional in this regard. But they're not that slow - for normal applications they sufficiently performant and much more convenient.

Maybe not Rust (although who knows), but at some point, some language certainly will. People probably once said the same thing about Pascal and Fortran. :)

Maybe I phrased that badly. I was trying to make the point that C is incredibly influential as far as language design and syntax are concerned. I was saying that its unlikely that any language will become more influential than C. As Rust (and most other "modern" languages) is/are already heavily influenced by C, any derived languages will also have thus been influenced by C. This influence can only grow.

Agreed; it's not really about the languages you know. It's about how quickly you're able to transition from one to the next.

It's important to realise that the language itself is not everything — you need to know all the main frameworks/libraries that really give the language its power. When learning a new environment, the hardest part is not the language; it's usually the frameworks (and the mindset behind them) that go with it.

Yes, I agree. Frameworks and language nuances are the most important bit about learning a new language. Keeping up with the times is also incredibly time consuming.
Knowledge of design patterns like MVC will certainly help with any future application development you might do.
 
Then you have turned Emacs into an IDE. :) My gripe is not with Emacs in particular, it's with the idea that an out-of-the-box text editor is somehow objectively 'better' for every single use-case than an out-of-the-box IDE.

It's better because it's extensible. You can change and redefine basically anything you want. It also encourages you to personalise it, so basically it becomes yours. The fact that you can hack away at your editor while using it is pretty amazing. It's not so amazing out of the box per se - the keybindings take a while to get used to; but as you extend it, it becomes better than an IDE ever could be.

I'm afraid I'll still have to disagree; this depends on your definition of a 'normal' application. Truly responsive UI is very difficult to achieve relative to the efforts required in native environments. 'Much more convenient'? Highly doubt that as well. Caching and persistence is also still very much a gray area, especially when this is still dependent on a reliable connection.

Maybe you're misunderstanding what I mean. It bundles all the assets into an application then renders it using the already present web renderers on the device. You don't need a connection all - it's a native app with a with code to bridge the gap between web and native apps - it's all local though. It simply enables you to use web technologies and frameworks to build an app.

By "normal" app, I just meant something that doesn't make to much use of native APIs - standardising the different APIs across multiple platforms is difficult. It is however, more convenient in many cases. You don't have to develop an app separately for multiple devices - you write it once and it works. This is especially useful if you already have a SPA web app - it takes little effort to port it to mobile.

Agreed; but the opportunity for a paradigm shift of the same magnitude isn't really a crazy thought. A language that completely throws away any predetermined notions from C is always just around the corner.

That would mean throwing a lot of our knowledge of language design out the window too; it certainly won't happen without a fundamental shift in hardware and the logic necessary to program it - but even quantum programming languages are influenced by C - in appearance at least.
 
Back
Top